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
File Read/Write
Linear and Property List AND String functions
Particle Explosion Effect
Dual Button With Rollover Effect
Slider bar-Alphamania
Check for Network Xtras
Drag&Drop Xtra
Circular Rollover behavior
DirectOS Xtra
Line Skip-Alphamania
 

 

 

Behavior Tri-State Button

Added on 6/10/1999

 

Compatibilities:
behavior D6_5 Mac PC

This item has not yet been rated

Author: BasMul

Tri-State Button

property ImageUp,ImageRoll,ImageDown,Clicked

on MouseEnter me
  if the Clicked of me then
    if the mousedown then
      set the member of sprite the spritenum of me = the ImageDown of me
    else
      set the member of sprite the spritenum of me = the ImageRoll of me
    end if
  else
    set the member of sprite the spritenum of me = the ImageRoll of me
  end if
end

on MouseDown me
  set the member of sprite the spritenum of me = the Imagedown of me
  set the Clicked of me = true
  pass
end

on MouseLeave me
  set the member of sprite the spritenum of me = the ImageUp of me
end

on MouseUp me
  set the member of sprite the spritenum of me = the ImageRoll of me
  if the Clicked of me then
    set the Clicked of me = false
    pass
  end if  
end

on MouseUpOutside me
  set the member of sprite the spritenum of me = the ImageUp of me
  set the Clicked of me = false
end

on beginSprite me
  set the Clicked of me = false
end

on getPropertyDescriptionList
  if the currentspritenum = 0 then
    set memdefault1 = 0
  else
    set memref = the member of sprite the currentspritenum
    set castlibnum = the castlibnum of memref
    set memdefault0 = member (the membernum of member memref) of castlib castlibnum
    set memdefault1 = member (the membernum of member memref + 1) of castlib castlibnum
    set memdefault2 = member (the membernum of member memref + 2) of castlib castlibnum
  end if
  
  set p_list = [#ImageUp  : [#comment: "Button Up Image:",#format: #member,#default: memdefault0],¬
                            #ImageRoll: [#comment: "Button Rollover Image:",#format: #member,#default: memdefault1],¬
                            #ImageDown: [#comment: "Button Down Image:",#format: #member,#default: memdefault2]]
  
  return p_list
end

on getBehaviorDescription
  return¬
              "This is a tri-state button without sounds"&RETURN&¬
              "In my opinion this button behaves like it should"&RETURN&¬
              RETURN&¬
              "PARAMETERS:"&RETURN&¬
              "ImageUp:   the cast member for the normal (not pressed state)"&RETURN&¬
              "ImageRoll: the cast member for the button when a rollover occurs"&RETURN&¬
              "ImageDown: the cast member for the button when a mousedown on the button is valid"
end  

 


Contact

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

Send e-mail