# Finally moving to AS3

**URL:** https://forum.kirupa.com/t/finally-moving-to-as3/314020
**Category:** flash
**Created:** [September 16, 2010, 10:13am UTC](https://forum.kirupa.com/t/finally-moving-to-as3/314020 "2010-09-16T10:13:58Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![Michael\_Knight](https://avatars.discourse-cdn.com/v4/letter/m/f0a364/32.png) [@Michael\_Knight](https://forum.kirupa.com/u/Michael_Knight)
#### Post date: [September 16, 2010, 10:13am UTC](https://forum.kirupa.com/t/finally-moving-to-as3/314020/1 "2010-09-16T10:13:58Z")

</div>

the thing is my mind still thinks like as2 :diss:, i did some test it works but somehow i know theres somthing wrong on what i did. in this sample that i created i just simply loading 3 different colors all of them are external swf’s. my question is can you pls help me on whats the proper way in doing it…

heres the code

```auto

var loader:Loader = new Loader();
var movieRequest:URLRequest = new URLRequest("home.swf");
loader.load(movieRequest);
emc.addChild(loader);

btn1.addEventListener(MouseEvent.CLICK, home);
function home(Event:MouseEvent):void {
	var movieRequest:URLRequest = new URLRequest("home.swf");
	loader.load(movieRequest);
	emc.addChild(loader);
	//removeChild(emc);
	loader.unload();
	trace(emc.numChildren);
}

btn2.addEventListener(MouseEvent.CLICK, about);
function about(Event:MouseEvent):void {
	var movieRequest:URLRequest = new URLRequest("about.swf");
	loader.load(movieRequest);
	emc.addChild(loader);
	//removeChild(emc);
	loader.unload();
	trace(emc.numChildren);
}

btn3.addEventListener(MouseEvent.CLICK, contact);
function contact(Event:MouseEvent):void {
	var movieRequest:URLRequest = new URLRequest("contact.swf");
	loader.load(movieRequest);
	emc.addChild(loader);
	//removeChild(emc);
	loader.unload();
	trace(emc.numChildren);
}

```

thanks for everyone in advanced
