-
Flash CS4 Action script help
I have done an animation which includes a button that I want to use to start it.
I've added action script to stop the animation on the last frame, I just have no idea what action script to put in to start it when the button is pressed.
I have 14 layers + an action script layer. 7 of the layers are animated.
Any help would be much appreciated.
-
You can use the gotoAndPlay() method.
-
I'm a total noob mate. I dont fully know how to formulate the code.
I'm using this to stop the animation after 1 play -
addEventListener(Event.ENTER_FRAME, function(e:Event):void{
if(currentFrame == totalFrames) stop();
})
I have a normal start button, but don't know how or what actionscript to enter to start the animation off.
-
I sorted it.
Used the script -
play_btn.addEventListener(MouseEvent.CLICK, myButtonFunction);
function myButtonFunction(event: MouseEvent) {
gotoAndPlay(2);
}
That took me ages to figure out. At least i'll never forget it. )
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|