# Evt handler loading swf in mc on timeline, error 1119

**URL:** <https://forum.kirupa.com/t/evt-handler-loading-swf-in-mc-on-timeline-error-1119/290601>\
**Category:** Uncategorized\
**Created:** [June 17, 2009, 12:29am UTC](https://forum.kirupa.com/t/evt-handler-loading-swf-in-mc-on-timeline-error-1119/290601 "2009-06-17T00:29:10Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Parlian](https://avatars.discourse-cdn.com/v4/letter/p/ebca7d/32.png) [@Parlian](https://forum.kirupa.com/u/Parlian)\
**Post date:** [June 17, 2009, 12:29am UTC](https://forum.kirupa.com/t/evt-handler-loading-swf-in-mc-on-timeline-error-1119/290601/1 "2009-06-17T00:29:10Z")

</div>

Hello Everybody

I am going in circles with loading an external swf into a movieclip on the timeline and need help urgently.

There is a hotspot movieclip which is linked to following class:

package {

```
  import flash.display.MovieClip;
  import flash.events.*;
  import flash.net.URLRequest;
  import flash.display.DisplayObject;
  import flash.display.Loader;
  import Picture_Container;
  
  
  public class HotSpot1 extends MovieClip{
        var reqName:String;
        var target:DisplayObject;
              
        function HotSpot1():void{
              this.addEventListener(MouseEvent.CLICK, PictureCall);
              this.buttonMode = true;
        }
  
        public function PictureCall(event:MouseEvent):void{
              reqName = this.name + ".swf";
              trace(reqName);
              trace(this.parent.name);
              target = this.parent.getChildByName("picture_container");
              trace(target);
              trace(target.name);
              trace(this.parent.getChildIndex(target));
              trace(target.parent.name);
              
              var req:URLRequest = new URLRequest(reqName);
              var loader:Loader = new Loader();
              loader.load(req);
              //this.parent.picture_container.addChild(loader);
        }
  }

```

}

the .addChild(loader) code is the problem, therefore commented out. All the traces work perfectly and when clicking on the instance Page\_01 of the hotspot movieclip I get following output:

Page\_01.swf  
Gallery\_Background  
[object Picture\_Container]  
picture\_container  
103  
Gallery\_Background

However, if I activate the addChild line it throws following error:

1119: Access of possibly undefined property picture\_container through a reference with static type flash.display:DisplayObjectContainer.

The movieclip which should load the swf is linked to the class:

package {

```
  import flash.display.MovieClip;
  import HotSpot1;
  
  public class Picture_Container extends MovieClip{
        
        function Picture_Container():void{
              trace(this.parent.name);
              trace(this.name);
        }
  }

```

}

the traces work and the output shows:

Gallery\_Background  
picture\_container

Thanks to all of you for giving it your thoughts
