# Loading movieclip into container?

**URL:** <https://forum.kirupa.com/t/loading-movieclip-into-container/313987>\
**Category:** flash\
**Created:** [September 15, 2010, 2:53pm UTC](https://forum.kirupa.com/t/loading-movieclip-into-container/313987 "2010-09-15T14:53:32Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![dudaah](https://avatars.discourse-cdn.com/v4/letter/d/ad7895/32.png) [@dudaah](https://forum.kirupa.com/u/dudaah)\
**Post date:** [September 15, 2010, 2:53pm UTC](https://forum.kirupa.com/t/loading-movieclip-into-container/313987/1 "2010-09-15T14:53:32Z")

</div>

Hi,

I recently had to move to as3 on a project because they wanted some special transition effects but now I can’t figure out the parent/child stuff as I am new to as3. Basically this is what I am trying to do.

I have a layout.swf where I load different swf files into a container called content\_area. The code I use in the main layout file is this;

```auto
stop();

// Container
var imageLoader:Loader = new Loader();

// Url Requests
var imageRequest:URLRequest = new URLRequest("front.swf");
var imageRequestWishlist:URLRequest = new URLRequest("wishlist3.swf");
var imageRequestWishlistTwo:URLRequest = new URLRequest("wishlist3.swf");
var imageRequestAbout:URLRequest = new URLRequest("about.swf");
var imageRequestDesign:URLRequest = new URLRequest("design.swf");
var imageRequestContact:URLRequest = new URLRequest("contact.swf");

// Intial Page Loaded
imageLoader.load(imageRequest);
content_area.addChild(imageLoader)
imageLoader.x = 0;
imageLoader.y = 0;

// Button Functions
function goFront (e:MouseEvent):void{
imageLoader.load(imageRequest)
content_area.addChild(imageLoader)
imageLoader.x = 0;
imageLoader.y = 0;
}
front_btn.addEventListener(MouseEvent.CLICK, goFront);

function goWishlist (e:MouseEvent):void{
imageLoader.load(imageRequestWishlist);
content_area.addChild(imageLoader);
imageLoader.x = -1;
imageLoader.y = -1;
}
wishlist_btn.addEventListener(MouseEvent.CLICK, goWishlist);

function goAbout (e:MouseEvent):void{
imageLoader.load(imageRequestAbout);
content_area.addChild(imageLoader);

}
about_btn.addEventListener(MouseEvent.CLICK, goAbout);

function goDesign (e:MouseEvent):void{
imageLoader.load(imageRequestDesign);
content_area.addChild(imageLoader);

}
design_btn.addEventListener(MouseEvent.CLICK, goDesign);

function goContact (e:MouseEvent):void{
imageLoader.load(imageRequestContact);
content_area.addChild(imageLoader);
}
contact_btn.addEventListener(MouseEvent.CLICK, goContact);

```

Now this one is working as it should. It loads the movies when I click on the buttons. BUT…

In the default loaded page, front.swf I have a button that should target the same content\_area inside the layout.swf file. I have tried various ways of adding the actionscript inside the front.swf file, at the moment I have this;

```auto
var imageLoaderOne:Loader = new Loader();
// Url Requests
var imageRequestWishlistTwo:URLRequest = new URLRequest("wishlist3.swf");

function wishlistButton (e:MouseEvent):void{
imageLoaderOne.load(imageRequestWishlistTwo);
content_area(this.parent).addChild(imageLoaderOne);
imageLoaderOne.x = -1;
imageLoaderOne.y = -1;
}

wishlist2_btn.addEventListener(MouseEvent.CLICK, wishlistButton);

```

Basically I want wishlist3.swf to load into content\_area of the layout.swf from the loaded front.swf.

Can any kind soul help me out with this one? I have read books, tutorials, forum posts but I just don’t get it.
