# Loader Class Problem

**URL:** <https://forum.kirupa.com/t/loader-class-problem/272691>\
**Category:** flash\
**Created:** [October 7, 2008, 6:42pm UTC](https://forum.kirupa.com/t/loader-class-problem/272691 "2008-10-07T18:42:11Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Q80style](https://avatars.discourse-cdn.com/v4/letter/q/d9b06d/32.png) [@Q80style](https://forum.kirupa.com/u/Q80style)\
**Post date:** [October 7, 2008, 6:42pm UTC](https://forum.kirupa.com/t/loader-class-problem/272691/1 "2008-10-07T18:42:11Z")

</div>

Hi I’m creating a thumbnails that load in using the loader class. before loading the thumbnail I created containers for them and withing each container there are a couple of display objects one of which is called “\_container\_mc” which is the nested display object that I need to load the external thumbnails into. In addition to containing a couple of display objects, the container, works as a button. When one container is clicked it is deactivated and all the others are activated. It all works well until I load in the external thumbnails into the nested display object using the Loader Class.

This is the error message that I’m getting:

ReferenceError: Error #1069: Property box\_mc not found on flash.display.Loader and there is no default value.  
at main\_dynamic\_fla::MainTimeline/onClick()

Now, the property box\_mc is one of the display objects within the container which is no longer found now that I’m using the Loader Class. So just to clarify:

inside the main container I have the following display Object:  
buttons (The button being generated through a for loop)

inside buttons I have the following display objects:  
container\_mc - (this is the display object that the Loader Class is targeting)  
box\_mc

Here’s the code I’m using:

import gs.\*;

var swfLoader:Loader;  
var buttons:Button;  
var container:Container = new Container();  
var buttonsArray:Array = new Array();  
var \_duration:Number = 0.5;  
var currentButton:_;  
var otherButtons:_;

addChild(container);  
container.x = 70;  
container.y = 130;

for (var i:int = 0; i \< 4; i++)  
{  
buttons = new Button();  
container.addChild(buttons);  
buttons.name = “button” + i + “\_mc”;  
buttons.x = (buttons.width + 3) \* i;  
buttonsArray.push(buttons);  
buttons.buttonMode = true;  
buttons.percent\_txt.mouseEnabled = false;  
buttons.container\_mc.mouseEnabled = false;  
buttons.box\_mc.mouseEnabled = false;

```
swfLoader = new Loader();
swfLoader.load(new URLRequest("swfs/thumb" + i + ".swf"));
buttons.container_mc.addChild(swfLoader);

buttons.addEventListener(MouseEvent.ROLL_OVER, over);
buttons.addEventListener(MouseEvent.ROLL_OUT, out);
   
   //THIS IS WHAT'S CAUSING THE PROBLEM
buttons.addEventListener(MouseEvent.CLICK, onClick);

```

}

function over(e:MouseEvent):void  
{  
TweenLite.to(e.target.box\_mc, \_duration, {alpha:0.5});  
}

function out(e:MouseEvent):void  
{  
TweenLite.to(e.target.box\_mc, \_duration, {alpha:1});  
}

function onClick(e:MouseEvent):void  
{  
//trace(e.target.name);  
TweenLite.to(e.target.box\_mc, \_duration, {alpha:0.5});  
e.target.removeEventListener(MouseEvent.ROLL\_OUT, out);  
e.target.mouseEnabled = false;  
currentButton = e.target;  
enableOthers();  
}

function enableOthers():void  
{  
for (var j:int = 0; j \< buttonsArray.length; j++)  
{  
otherButtons = buttonsArray[j];

```
    if (otherButtons != currentButton)
    {
        otherButtons.mouseEnabled = true;
        otherButtons.addEventListener(MouseEvent.ROLL_OUT, out);
        TweenLite.to(otherButtons.box_mc, _duration, {alpha:1});
    }
}

```

}

Any help would be greatly appreciated.
