2008
10.05

Some things are better being tweened by hand, but imagine you want to run that tween and then call a function in the document class. There are several ways this can be achieved (check a movieclip’s progress on a timer / enter frame event or dispatch a custom event), but I like to keep it simple where I can, unless it is really necessary.

If we have a document class of type “TimelineClassCaller” and we have a movieclip carry out an animation and at the end we want to call a function within TimelineClassCaller, this is the type of call we would make:

TimelineClassCaller(parent).YeahMadeIt();

Where “YeahMadeIt” is the function within TimelineClassCaller. All we have done is cast the main movie before we make the call. Just make sure your pathing is correct (ie parent). As always it is easier to download an example to understand.

Bookmark and Share

No Comment.

Add Your Comment