Note that there are some explanatory texts on larger screens.

plurals
  1. POFlash AS3 - Events from Child to Parent Timelines
    primarykey
    data
    text
    <p>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.</p> <p><strong>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);</strong></p> <p>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:</p> <blockquote> <p>import customClass; if (Boolean = true) {gotoAndPlay(3);} // Waiting for child</p> </blockquote> <p>on parent frame 2:</p> <blockquote> <p>gotoAndPlay(1); // This creates the cheap loop</p> </blockquote> <p>and on the last child frame:</p> <blockquote> <p>import customClass; Boolean = true // Tells the parent when to leave its loop</p> </blockquote> <p>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.</p> <p>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.</p> <p>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.</p> <p>Thank you anyone for your help.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload