# AS3 loading

**URL:** <https://forum.kirupa.com/t/as3-loading/267084>\
**Category:** flash\
**Created:** [July 28, 2008, 3:53pm UTC](https://forum.kirupa.com/t/as3-loading/267084 "2008-07-28T15:53:49Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![three\_suns](https://avatars.discourse-cdn.com/v4/letter/t/4491bb/32.png) [@three\_suns](https://forum.kirupa.com/u/three_suns)\
**Post date:** [July 28, 2008, 3:53pm UTC](https://forum.kirupa.com/t/as3-loading/267084/1 "2008-07-28T15:53:49Z")

</div>

Greeting to all!

I learning OOP in AS3 and came across something that has me bound!

I am trying to load a external movieclip on to the stage from a movieclip. I am not getting any error but the file is not loading on to the stage. I have been getting the following message:  
TypeError: Error #1009: Cannot access a property or method of a null object reference.

The following is the script that I have inside the movieclip:

test1\_btn.addEventListener(MouseEvent.CLICK, myButtonFunction);  
function myButtonFunction(event: MouseEvent) {  
var request:URLRequest = new URLRequest(“happy.swf”);  
var loader:Loader = new Loader();  
addChild(loader);  
}

Am I missing something?
