|
|
|
Animation on MouseUp
Added on 11/19/1999
|
Plays sequences of images on mouseUp, at same frame.
Aply behavior to sprite, select number of images for animation, select pause (in ticks) between them. Image names should be named by following convention:Naming convention is: base image (click on image)- without index, images to folow - with 1,2,3,etc indexes.
At the end of animation returns base (clicked) image.
--animation on MouseUp
--by Dejan Cicic
--Plays sequences of images on mouseUp.
--Naming convention is: base image - without index, images to folow - with
1,2,3,etc indexes.
--At the end of animation returns base (clicked) image.
--Select number of images and pause between them.
Property MySprite
Property MyCurrentMember
Property MyLastMember
property NumberOfTicks
property MyFlag
property MyOldMember
property MyRootName
on beginSprite me
set MyFlag to false
set MySprite to the spriteNum of me
set MyCurrentMember=the member of sprite mySprite
set myOldMember=MyCurrentMember
end
on ExitFrame me
if myflag then
repeat with i=1 to MyLastMember
set myCurrentMember =the name of member myOldMember&i
set the member of sprite mySprite=myCurrentMember
updatestage
makePause
end repeat
set myFlag to false
set the member of sprite mySprite=MyoldMember
end if
end ExitFrame
on makePause me
startTimer
set startTicks = the timer
set endTicks=startTicks + NumberOfTicks
repeat while the timer nothing
end repeat
end
on MouseUp me
set myFlag=true
end MouseUp
on getPropertyDescriptionList
Properties = [:]
AddProp Properties,#MyLastMember, ¬
[#Default:"1",#Format:#Integer,#range:[#min:1, #max:20],#Comment:"Number of Members to ¬
play"]
AddProp Properties,#NumberOfTicks, ¬
[#Default:"10",#Format:#Integer,#range:[#min:10, #max:120],#Comment:"Number
of tiks ¬
between members"]
Return Properties
end getPropertyDescriptionList
on getBehaviorDescription
BehDescription = "Plays sequences of images on mouseUp. Naming convention is: base image - without index, images to folow - with 1,2,3,etc indexes. At the end of animation returns base image. Select number of images and pause between them."
Return BehDescription
end getBehaviorDescription
on getBehaviorTooltip
ToolTip = "Plays sequences of images on mouseUp. Naming convention is: base image - without index, images to folow - with 1,2,3,etc indexes."
Return ToolTip
end getBehaviorTooltip
|
|