What it is I would like to do seems simple enough, but is confounded by the fact that I want to work within Flash's timelines, as opposed to within custom classes, .as files, flex, etc. I am an artist, and code is only as reusable as my assets (created/animated in Flash), so I tend to work in the timeline.
I want to have a script at the end of a child's timeline progress the timeline of its parent. Something like this would be on the end frame of the child, if it were a real AS3 script: this.parent.gotoAndPlay(2);
I have done "fixes" that work, but slow my program to an unacceptable rate. For example: I will save a public static Boolean in an imported custom class and have a "listener" on parent frame 1:
import customClass; if (Boolean = true) {gotoAndPlay(3);} // Waiting for child
on parent frame 2:
gotoAndPlay(1); // This creates the cheap loop
and on the last child frame:
import customClass; Boolean = true // Tells the parent when to leave its loop
This works, but is obviously not the best way... What I need is recursion within the same timeline frame, but without a stack overflow or numbered increments.
I suspect the answer lies with EventListeners, but I don't want to trigger it with a MouseClick or a Timer, I want to trigger it like this: new EventListener:EventListener (ThatGlobalVarAtTheEndOfYourChildTimelineHasBeenChanged); Then it'll progress when the Boolean has been changed to true.
I'm sure this is easy, and I feel like an idiot asking something so simple, but all of the documentation has me working on the stage, or with an object within an object I create in code, but it's not that easy with what I want to do because I'm making complex animations that use several timelines. Flash knows which object is within what, not me or my classes.
Thank you anyone for your help.