troubleshooting Question

ActionScript 3.0 pause timeline on multiple frames

Avatar of GhostWerx
GhostWerxFlag for Australia asked on
Adobe Flash
10 Comments1 Solution8832 ViewsLast Modified:
Hi all,

I got the attached code off of the adobe.com site from a tutorial.

The code when pasted in a frame will pause that frame. It works fine. My issue is if I then paste the same code in another frame Flash starts to kick out errors about multiple definitions of the same function, etc.

I want a function that I can define in say the first frame of a timeline. Then in another frame of the timeline I am able to set the pause time and call the function to pause the timeline.

So for example say I want the following pauses:

Frame 1: pause for 2 seconds.
Frame 20: pause for 3 seconds.
Frame 35: pause for 2 seconds.

What is the code I would place on each frame??

So to recap, I would like to define a function that pauses the timeline. Then on any frame where I would like a pause I can set the interval of the pause and execute the pause.

Thank you.
this.stop();
 
var timelinePause:Timer = new Timer(2000, 1);
timelinePause.addEventListener(TimerEvent.TIMER, timerHandler);
timelinePause.start();
 
function timerHandler(evt:Object):void {
this.play();
}
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 10 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 10 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros