Contents
Articles
Behaviors
Books
Director News
Director Web Sites
FAQ
Games
Mailing Lists
News Groups
Project Examples
Reviews
Software
Tools
Useful Web Sites
Utilities
Xtras

Don't miss these
RUNNING LED's
Object Serializer
Check and launch dialup
getNameOfDate
Get Font List without using xtras!
Dynamic Pie Charts
Macromedia Flash 5 Authorized
Scale-Alphamania
Which Keys
XML to OBJ with lingo
 

 

 

Behavior Mouse Clicks: left, left double, right, right double

Added on 5/1/2002

 

Compatibilities:
D7 D8 D8_5 PC

This item has not yet been rated

Author: Sander Falise

Add functionality to left and right mouse clicks and even doubleclicks. Only tested on a PC with Director 8.5.1 but probably works with earlier versions too. Note: the timeout (me.timing) has been used to prevent single mouse clicks to happend before a doubleclick has the time to init.

property l,r,timing

on new me
  me.l = 0 -- left mouse timer
  me.r = 0 -- right mouse timer
  me.timing = 200 -- timeout for functions
  return me
end

on exitFrame me    
    if me.l = 0 then
      nothing
    else if me.l + me.timing < the milliseconds then
      me.l = 0
      -- !!! add function for left mouse click here !!!
    end if
    if me.r = 0 then
      nothing
    else if me.r + me.timing < the milliseconds then
      me.r = 0
      -- !!! add function for right mouse click here !!!
    end if
end

on mouseUp me
    me.l = the milliseconds
    if the doubleClick then
      me.l = 0
       -- !!! add function for double leftmouse click here !!!
    end if  
end

on rightMouseUp me
    me.r = the milliseconds
    if the doubleClick then
      me.r = 0
      -- !!! add function for double right mouse click here !!!
    end if
end

 


Contact

MMI
36 South Court Sq
Suite 300
Newnan, GA 30263
USA

Send e-mail