Skip to main content
Known Participant
April 4, 2008
Question

How to call function in parent clip?

  • April 4, 2008
  • 2 replies
  • 308 views
All --

I'm using loadMovie to pull in an external SWF. At the end of the external SWF, I'd like to put a snippet of code that can trigger a function defined in the master SWF. Tried a few different things, and I haven't been able to get it right. I'm guessing there's a straightforward way to do this, but I just don't know what it is.

Any help is greatly appreciated! Thanks in advance.
This topic has been closed for replies.

2 replies

Known Participant
April 4, 2008
Thanks David! Worked like a charm.
Inspiring
April 4, 2008
ndisdabestm

> At the end of the external SWF, I'd like to put a snippet of
> code that can trigger a function defined in the master SWF.

The global "this" property (without the quotation marks) refers to the
object at hand -- in this case, assuming your code is in a frame of the
external SWF's main timeline, that object would be that SWF's main timeline,
which is a movie clip. Knowing that means you have access to all the
properties, methods, and events of the MovieClip class, such as the
MovieClip._parent property. So, in the last frame of your external SWF ...

this._parent.nameOfFunctionInParentSWF();


David Stiller
Adobe Community Expert
Dev blog, http://www.quip.net/blog/
"Luck is the residue of good design."