home *** CD-ROM | disk | FTP | other *** search
- on indexButton spriteNum
- puppetSprite(spriteNum, 1)
- set buttonList to []
- set myCast to the castNum of sprite spriteNum
- set pressedCast to myCast + 1
- add(buttonList, spriteNum)
- add(buttonList, myCast)
- add(buttonList, pressedCast)
- return buttonList
- end
-
- on down buttonList
- set mySprite to getAt(buttonList, 1)
- set myCast to getAt(buttonList, 2)
- set pressedCast to getAt(buttonList, 3)
- set the castNum of sprite mySprite to pressedCast
- repeat while the mouseDown
- if rollOver(mySprite) then
- set the castNum of sprite mySprite to pressedCast
- else
- set the castNum of sprite mySprite to myCast
- end if
- updateStage()
- end repeat
- end
-
- on up buttonList
- global gLastIndexButton
- set mySprite to getAt(buttonList, 1)
- set myCast to getAt(buttonList, 2)
- set pressedCast to getAt(buttonList, 3)
- if the castNum of sprite mySprite = pressedCast then
- if objectp(gLastIndexButton) then
- unSelect(gLastIndexButton)
- end if
- set gLastIndexButton to buttonList
- return 1
- else
- return 0
- end if
- end
-
- on select buttonList
- global gLastIndexButton
- set gLastIndexButton to EMPTY
- down(buttonList)
- up(buttonList)
- end
-
- on unSelect buttonList
- set mySprite to getAt(buttonList, 1)
- set myCast to getAt(buttonList, 2)
- set the castNum of sprite mySprite to myCast
- end
-