Skip to main content
June 24, 2009
Question

btn function in loaded swf to go to frame on timeline of loading swf

  • June 24, 2009
  • 1 reply
  • 541 views

Hello Everybody

I would need help with following functionality:

An external swf file (swfEx), which contains a button, is loaded into another swf file(swfLd).  When clicking the button contained in swfEx, it should navigate to a certain frame of the main timeline of the swfLd movie and at the same time remove swfEx from swfLd.

Thank you for your thoughts

This topic has been closed for replies.

1 reply

Ned Murphy
Legend
June 24, 2009

For the button event handler function code (assuming it is in the main timeline of the loaded swf) try using:

MovieClip(this.parent).gotoAndPlay(?);

MovieClip(this.parent).removeChild(this);

June 25, 2009

Hello Ned

Thanks again, your suggestion provided the solution in principle.

The removeChild function was however not that straight forward (at least not for me) as it had to be placed hierarchically above the movieclip which should be unloaded.  For this reason the event handler function placed in the button class of the child swf,

is calling a function which is placed in the parent.swf document class.