# AS3 loading and controlling external SWF movie

**URL:** https://forum.kirupa.com/t/as3-loading-and-controlling-external-swf-movie/270449
**Category:** flash
**Created:** [September 10, 2008, 4:23am UTC](https://forum.kirupa.com/t/as3-loading-and-controlling-external-swf-movie/270449 "2008-09-10T04:23:24Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![TheMagicMan](https://avatars.discourse-cdn.com/v4/letter/t/f4b2a3/32.png) [@TheMagicMan](https://forum.kirupa.com/u/TheMagicMan)
#### Post date: [September 10, 2008, 4:23am UTC](https://forum.kirupa.com/t/as3-loading-and-controlling-external-swf-movie/270449/1 "2008-09-10T04:23:24Z")

</div>

I’m able to load the actual external SWF movie, but I can’t seem to control it. I have already built a controller for my flash video player. The problem now is it only plays FLV and I want it to be able to take in SWF support. Again, I load the SWF fine, but controlling is the problem.

```
    function finished_loading (e:Event) {
        var externalMovie = MovieClip(swfLoader.content); // cast 'DisplayObject' to 'MovieClip'
        addChild(externalMovie); // add your swf directly to the stage
        externalMovie.gotoAndPlay("stop");
        trace("hi")
    }

    private function initSWF():void{
        swfLoader.load(new URLRequest("test_movie.swf"));
        addChild(swfLoader);
        swfLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, finished_loading);
        var externalMovie = swfLoader.content; // cast 'DisplayObject' to 'MovieClip'
        addChild(externalMovie); // add your swf directly to the stage
        swfLoader.gotoAndPlay("stop");
    }

```

I think this is the problem with the code. Casting it to a MovieClip only gives me a 1034 error.

Can someone help?  
Thanks.
