# Controling loaded SWF with AS3

**URL:** <https://forum.kirupa.com/t/controling-loaded-swf-with-as3/303466>\
**Category:** flash\
**Created:** [January 20, 2010, 7:51pm UTC](https://forum.kirupa.com/t/controling-loaded-swf-with-as3/303466 "2010-01-20T19:51:35Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![felipegm](https://avatars.discourse-cdn.com/v4/letter/f/e9bcb4/32.png) [@felipegm](https://forum.kirupa.com/u/felipegm)\
**Post date:** [January 20, 2010, 7:51pm UTC](https://forum.kirupa.com/t/controling-loaded-swf-with-as3/303466/1 "2010-01-20T19:51:35Z")

</div>

I’m loading a SWF into a main SWF using the code bellow, from senocular tutorials:

```auto

var request:URLRequest = new URLRequest("home.swf");
var loader:Loader = new Loader();

loader.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, loadProgress);
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, loadComplete);

function loadProgress(event:ProgressEvent):void {
    var percentLoaded:Number = event.bytesLoaded/event.bytesTotal;
    percentLoaded = Math.round(percentLoaded * 100);
    trace("Loading: "+percentLoaded+"%");
}
function loadComplete(event:Event):void {
    trace("Complete");
}

loader.load(request);
window_mc.textos_mc.addChild(loader);

```

I have buttons inside a movie clip, at the main movie (parent) and I want to control the home.swf movie that I just loaded. How can I do that?

I’m trying this, without any result:

```auto

function botao_clique(e:MouseEvent):void{
	MovieClip(root).window_mc.textos_mc.gotoAndStop(2);
}

```

Thanks for any help
