I’m working on a Flash MX application which involves a Parent movie and a Child movie.
I’ve loaded the Child movie into the Parent movie using LoadMovie. The instance name of the Child movie is Child1.
In the Child movie I have a user-defined function called getChildXML (we don’t need to get into more details about the function).
The point here is that I want to call the getChildXML function from the Parent movie. Is that possible? I’ve tried something like Child1.getChildXML(); but with no luck.
is used to reference a parent movieclip. In your movieclip Child1,
trace(this._parent);
would output the Parent clip. If your getChildXML is a straight function in that Child1 (and not an XML proto or something) then using this._parent will refence the Parent clip.
Thanx for the reply. But it doesn’t solve my problem. I want to call getChildXML from the Parent clip and not vice-versa. Is it possible to access a child movie’s methods from a parent movie?
Okay, this is what I’m trying to do, the getChildXML function constructs and returns a string (which is some XML). I want to call this function from the Parent movie.
I wrote
strXML = child1.getChildXML();
when I try something like
trace (strXML);
or
trace(child1.getChildXML());
I get “undefined” in the output window.
I am writing this code in the first frame of the parent movie using this.onEnterFrame.