property sNum
property speed
property stretch
property overMe
property actionType, actionText -- what to do or where to go
on getBehaviorDescription me
return "A simple button behavior that applies roil when the user clicks. "
end
on getPropertyDescriptionList me
set list = [:]
addProp list, #speed, [#comment: "Speed:", #format: #integer, #default: 7, #range: [#max: 20, #min:0]]
addProp list, #stretch, [#comment: "Stretch:", #format: #integer, #default: 6, #range: [#max: 8, #min:0]]
addProp list, #actionType, [#comment: "Action Type:", #format: #symbol, #range: [#goToFrame, #doLingo], #default: #doLingo]
addProp list, #actionText, [#comment: "Action Text:", #format: #string, #default: "beep()"]
return list
end
on beginSprite me
set sNum = the spriteNum of me
set overMe = -1
end
on ApplyRoil me
roil(sprite sNum, [#speed: speed, #stretch: stretch])
end
on RemoveRoil me
removeEffect(sprite sNum, #roil)
end
on mouseDown me
set overMe = TRUE
applyRoil(me)
updateStage
end
on mouseEnter me
if the stillDown and overMe = FALSE then
applyRoil(me)
set overMe = TRUE
end if
end
on mouseLeave me
if the stillDown and overMe = TRUE then
RemoveRoil(me)
set overMe = FALSE
end if
end
on mouseUp me
if overMe = TRUE then
RemoveRoil(me)
set overMe = FALSE
action(me)
updateStage
end if
set overMe = -1
end
on mouseUpOutside me
set overMe = -1
end
on action me
if actionType = #goToFrame then
if value(actionText) > 0 then
go to frame value(actionText) -- go to frame number
else
go to frame actionText -- go to frame label
end if
else if actionType = #doLingo then
do actionText
end if
end
Contact
MMI
36 South Court Sq
Suite 300
Newnan, GA 30263
USA