Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Accessing a main timeline function from a object's timeline

Community Beginner ,
Jun 14, 2014 Jun 14, 2014

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?

TOPICS
ActionScript
431
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

LEGEND , Jun 14, 2014 Jun 14, 2014

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.

Translate
LEGEND ,
Jun 14, 2014 Jun 14, 2014

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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Jun 14, 2014 Jun 14, 2014

Thank you, Ned!

Works perfectly

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jun 14, 2014 Jun 14, 2014
LATEST

You're welcome

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines