Copy link to clipboard
Copied
Hi,
I have an object on the stage, MovieClip, with an animation inside.
The animation is called from a class file.
I would like to call for a function, addBubbles, when the animation of the MovieClip has finished.
The function, addBubbles, is described on the main timeline, in the first frame.
But I would like to call for it from inside of that MovieClip, writing the code into the last frame.
How should I reference it, so it would work?
A couple ways would be to just use...
MovieClip(root).addBubbles(); OR MovieClip(parent).addBubbles();
Another way would be to have the MovieClip dispatch a custom event for which you have a listener assigned in the main timeline. THat listener in the main timeline would have an event handler function that calls the addBubbles function.
Copy link to clipboard
Copied
A couple ways would be to just use...
MovieClip(root).addBubbles(); OR MovieClip(parent).addBubbles();
Another way would be to have the MovieClip dispatch a custom event for which you have a listener assigned in the main timeline. THat listener in the main timeline would have an event handler function that calls the addBubbles function.
Copy link to clipboard
Copied
Thank you, Ned!
Works perfectly
Copy link to clipboard
Copied
You're welcome
Find more inspiration, events, and resources on the new Adobe Community
Explore Now