Requires Effector Set 2. These behaviors are for use with the Alphamania Xtra and its add-on effector sets.
property sNum
property overMe
property bevel
property pressDepth -- how deep the bevel effect should go
property moveMode -- whether in up or down part of animation
property frameCount -- how much time left in this part of animation
property actionType, actionText -- what to do or where to go
on getBehaviorDescription me
return "A simple button behavior that plays a bevel animation when the user clicks. The bevel crop shrinks. This creates a "push" effect."
end
on getPropertyDescriptionList me
set list = [:]
addProp list, #bevel, [#comment: "Bevel:", #format: #integer, #default: 5, #range: [#max: 25, #min:1]]
addProp list, #pressDepth, [#comment: "Press Depth:", #format: #integer, #default: 128, #range: [#max: 255, #min:0]]
addProp list, #actionType, [#comment: "Action Type:", #format: #symbol, #range: [#goToFrame, #doLingo], #default: #doLingo]
addProp list, #actionText, [#comment: "Frame Name or Handle Name:", #format: #string, #default: "beep()"]
return list
end
on beginSprite me
set frameCount = 10
set moveMode = VOID
set overMe = -1
set sNum = the spriteNum of me
bevel(sprite sNum, [#animMode: #static, #bevel: bevel, #bevCrop: 255])
end
on mouseDown me
set overMe = TRUE
bevel(sprite sNum, [animMode:#range, numFrames:frameCount, startBevCrop:255, endBevCrop: pressDepth])
updateStage
end
on mouseEnter me
if the stillDown and overMe = FALSE then
bevel(sprite sNum, [animMode:#range, numFrames:frameCount, endBevCrop:pressDepth])
set overMe = TRUE
end if
end
on mouseLeave me
if the stillDown and overMe = TRUE then
bevel(sprite sNum, [animMode:#range, numFrames:frameCount, endBevCrop:255])
set overMe = FALSE
end if
end
on mouseUp me
if overMe = TRUE then
bevel(sprite sNum, [animMode:#static, bevCrop:255])
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