# Loading External Swf in Movie Clip

**URL:** https://forum.kirupa.com/t/loading-external-swf-in-movie-clip/304130
**Category:** flash
**Created:** [February 2, 2010, 7:25am UTC](https://forum.kirupa.com/t/loading-external-swf-in-movie-clip/304130 "2010-02-02T07:25:45Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![vikrant29nov](https://avatars.discourse-cdn.com/v4/letter/v/eb9ed0/32.png) [@vikrant29nov](https://forum.kirupa.com/u/vikrant29nov)
#### Post date: [February 2, 2010, 7:25am UTC](https://forum.kirupa.com/t/loading-external-swf-in-movie-clip/304130/1 "2010-02-02T07:25:45Z")

</div>

Need some help in loading external swf using AS 3.0

I am using the below code

```auto
var swfLoader:Loader = new Loader();
holderMC.addChild(swfLoader);
var bgURL:URLRequest=new URLRequest("Untitled-1.swf");
swfLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, loadProdComplete);
swfLoader.load(bgURL);
function loadProdComplete(e:Event):void {
    trace("file loaded");
}

```

and it is showing the error  
TypeError: Error #1009: Cannot access a property or method of a null object reference.  
at Untitled\_fla::MainTimeline/frame1()

Can anyone help me in fixing this error…
