Search content:

 

Personal Menu
Username:
Password:
Save password

Become a member

Forgot Password?

 

Don't miss these
Download Net Thing
A Star Lingo Pathfinding Algorithm
BitChecker
Regular expressions
Determine if a Year is a Leap Year
Windows for Shockwave 4.5
Simple projectile with gravity
Get Dropped Files
Datagrip
Button Animator on how close cursor is to it
MediaMacros Xtras Mall
 

 

 

Behavior Constrain Mouse to Stage Area

Added on 6/15/2000

 

Compatibilities:
behavior D7 D8 Mac PC

This item has not yet been rated

Author: TomWincek

This behavior uses the Free Set Mouse Xtra to confine the mouse to the stage area.

global mouseposLR, mouseposTB, Con1, Con2, Con3, Con4


on exitframe  
  --sets the variables wich are mouse location = the size of the stage
  set mouseposlr = the mouseH + the stageleft
  set mouseposTB = the mouseV + the stagetop
  --tests wether or not the mouse is leaving the stage
  if mouseposLR > the stageRight - 2 then set Con1 = true
  else set Con1 = false
  if mouseposTB < the stageTop + 2 then set Con2 = true
  else set Con2 = false
  if mouseposLR < the StageLeft + 2 then set Con3 = true
  else set Con3 = false
  if mouseposTB > the stageBottom - 2 then set Con4 = true
  else set Con4 = false
  --sets the mouse to snapback to the givin parameters
  case True of
    Con1:
      x = the stageRight - 2
      y = the mouseV + the stagetop
        setmouse x,y
      Con2:
      x = the mouseH + the stageleft
      y = the stageTop + 2
        setmouse x,y
      Con3:
      x = the stageLeft + 2
      y = the mouseV + the stageTop
        setmouse x,y
      Con4:
      x = the mouseH + the stageLeft
      y = the stageBottom - 2
       setmouse x,y
  end case
  go to the frame
end

on getBehaviorDescription me
  return "This behavior uses the Free Set Mouse Xtra to confine the mouse to the stage area."
end

 


Upload Provided by ABCUpload ASP

Contact

MMI
22 West Court Sq
Suite 2C
Newnan, GA 30263
USA

Fax - (206) 339-5833

Send e-mail