# How to Control external swf?

**URL:** https://forum.kirupa.com/t/how-to-control-external-swf/316262
**Category:** Uncategorized
**Created:** [November 17, 2010, 10:35am UTC](https://forum.kirupa.com/t/how-to-control-external-swf/316262 "2010-11-17T10:35:28Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![BoRuPeSO](https://avatars.discourse-cdn.com/v4/letter/b/aeb1de/32.png) [@BoRuPeSO](https://forum.kirupa.com/u/BoRuPeSO)
#### Post date: [November 17, 2010, 10:35am UTC](https://forum.kirupa.com/t/how-to-control-external-swf/316262/1 "2010-11-17T10:35:28Z")

</div>

hi, all

as3 is new for me, but i would like to write a script using loader to load an external swf, and control the external swf. But I find I can’t control the swf, because there are no fixed instance name.

here is my script.

function startLoad() {  
var mLoader:Loader = new Loader();

var mRequest:URLRequest=new URLRequest(“child.swf”);  
mLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, onCompleteHandler);  
mLoader.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, onProgressHandler);  
mLoader.load(mRequest);  
}

function onCompleteHandler(loadEvent:Event) {  
this.holder\_mc.addChild(loadEvent.currentTarget.content);  
// control the external swf  
this.holder\_mc.gotoAndPlay(12);  
}

function onProgressHandler(mProgress:ProgressEvent) {  
var percent:Number=mProgress.bytesLoaded/mProgress.bytesTotal;  
trace(percent);  
}

I could see the external swf, but i can’t control it at all.

i pressed “list object” when it published, i see movieclips inside the external swf listed out and named as “level0.holder\_mc.instanceXX(a number).xxxx\_mc”. But the number after the instance change everytime. I don’t know how can I control the external swf? is there anyone can help me. thanks a lot.
