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
Get and Set IDTag3 II of a mp3 file.
HTML-ingo
simINET Xtra
Yak
Video Codecs
MIAW Event Leak
Manipulating Date and Time using Lingo
Detect MS Media Player v9
Set the blend of Sprite
CatFade
 

 

 

Behavior Standard 3 state button

Added on 11/12/1999

 

Compatibilities:
behavior D7 D8 Mac PC Shockwave

This item has not yet been rated

Author: MediaMacros (website)

This is a standard 3 state button. Drop it on your sprites and select the code to run on the mouseUp.

--Copyright 1999 Chuck Neal
--chuck@mediamacros.com
--If you find this code helpful, send me an e-mail and let me know. :-)

property spriteNum, defaultState, clickState, overState, whatDo

on getPropertyDescriptionList me
  p_list = [:]
  curMember = sprite(the currentSpriteNum).member
  p_list.addProp(#defaultState, [#format : #member, #comment : "Default image:", #default : curMember])
  p_list.addProp(#overState, [#format : #member, #comment : "Rollover image:", #default : member(curMember.number + 1)])
  p_list.addProp(#clickState, [#format : #member, #comment : "Click image:", #default : member(curMember.number + 2)])
  p_list.addProp(#whatDo, [#format : #string, #comment : "What to do when clicked:", #default : "go next"])
  return p_list
end

on mouseEnter me
  sprite(spriteNum).member = overState
  updateStage
end

on mouseLeave me
  sprite(spriteNum).member = defaultState
  updateStage
end

on mouseDown me
  sprite(spriteNum).member = clickState
  updateStage
end

on mouseUp me
  sprite(spriteNum).member = overState
  updateStage
  do whatDo
end

on mouseUpOutside me
  sprite(spriteNum).member = defaultState
  updateStage
end

on getBehaviorDescription me  
  return "This is a standard 3 state button. Drop it on your sprites and select the code to run on the mouseUp."
end

 


Contact

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

Send e-mail