# Calling child movie methods from a parent movie \[MX\]

**URL:** <https://forum.kirupa.com/t/calling-child-movie-methods-from-a-parent-movie-mx/23307>\
**Category:** flash\
**Created:** [June 16, 2003, 9:25am UTC](https://forum.kirupa.com/t/calling-child-movie-methods-from-a-parent-movie-mx/23307 "2003-06-16T09:25:46Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![hopesfall](https://avatars.discourse-cdn.com/v4/letter/h/f1d935/32.png) [@hopesfall](https://forum.kirupa.com/u/hopesfall)\
**Post date:** [June 16, 2003, 9:25am UTC](https://forum.kirupa.com/t/calling-child-movie-methods-from-a-parent-movie-mx/23307/1 "2003-06-16T09:25:46Z")

</div>

Hi…

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.

Please help!

Thanx.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [June 16, 2003, 9:55am UTC](https://forum.kirupa.com/t/calling-child-movie-methods-from-a-parent-movie-mx/23307/2 "2003-06-16T09:55:14Z")

</div>

\_parent

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.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [June 16, 2003, 10:03am UTC](https://forum.kirupa.com/t/calling-child-movie-methods-from-a-parent-movie-mx/23307/3 "2003-06-16T10:03:44Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [June 16, 2003, 10:46am UTC](https://forum.kirupa.com/t/calling-child-movie-methods-from-a-parent-movie-mx/23307/4 "2003-06-16T10:46:31Z")

</div>

ooo I misread

Child1.getChildXML doesnt work? Are you sure the clip is fully loaded when you try to call it?

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [June 16, 2003, 11:32am UTC](https://forum.kirupa.com/t/calling-child-movie-methods-from-a-parent-movie-mx/23307/5 "2003-06-16T11:32:04Z")

</div>

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.
