views:

58

answers:

2
+1  Q: 

How to "go back"

I'm creating a learning application in Flash and am trying to figure out how to program a "back" button using ActionScript 3. I'm guessing that I need to set a variable to find the previous frame and then set an Event Listener to listen for the back button, but I don't know how to program the variable to find the previous frame, especially since the frames won't necessarily be in numerical order. Is there some function that will do that, or how should I set the variable for this case?

+2  A: 
jdecuyper
A: 

You can use a stack (or a simple var) to track the changes of the frames. Every time you enter a frame, push thatframe label in the stack; so wou'll have 'back' function and if you need, even breadcrumbs

kajyr
How do I use a stack?
jar238
http://en.wikipedia.org/wiki/Stack_%28data_structure%29
kajyr