# Accessing content of loaded swfs

**URL:** <https://forum.kirupa.com/t/accessing-content-of-loaded-swfs/265637>\
**Category:** flash\
**Created:** [July 10, 2008, 10:17pm UTC](https://forum.kirupa.com/t/accessing-content-of-loaded-swfs/265637 "2008-07-10T22:17:04Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![mofakiii](https://avatars.discourse-cdn.com/v4/letter/m/58956e/32.png) [@mofakiii](https://forum.kirupa.com/u/mofakiii)\
**Post date:** [July 10, 2008, 10:17pm UTC](https://forum.kirupa.com/t/accessing-content-of-loaded-swfs/265637/1 "2008-07-10T22:17:04Z")

</div>

Hello, I’m still relatively new to AS3 and I’m having a bit of a hard time with loaders, and would appreciate some insight.

Basically, I have a.swf which creates a loader that loads b.swf. b.swf is a 1 frame movie. On it’s main timeline there is a movieclip with an instance name of ‘box’. Is there any way a.swf can read/change values of the ‘box’ movie clip in b.swf?

Here is the code I presently have in a.swf…

```auto
var loader:Loader = new Loader();
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, completeHandler);
loader.load(new URLRequest("b.swf"));
addChild(loader);

function completeHandler(event:Event):void {
    trace(event.target.content.box.width)
}

```

I get the following error when I compile…

ReferenceError: Error #1069: Property box not found on flash.display.AVM1Movie and there is no default value.  
at b\_fla::MainTimeline/completeHandler()

I’m really not sure what I can do, and would greatly appreciate any help. Thanks!!!

---

<div class="post-metadata">

**Author:** ![tpspoons](https://avatars.discourse-cdn.com/v4/letter/t/b4bc9f/32.png) [@tpspoons](https://forum.kirupa.com/u/tpspoons)\
**Post date:** [July 10, 2008, 11:04pm UTC](https://forum.kirupa.com/t/accessing-content-of-loaded-swfs/265637/2 "2008-07-10T23:04:54Z")

</div>

try this:

```auto
var loader:Loader = new Loader();
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, completeHandler);
loader.load(new URLRequest("b.swf"));
addChild(loader);

function completeHandler(event:Event):void {
    var content:* = event.target.content;

    trace(content.box.width)
}

```

---

<div class="post-metadata">

**Author:** ![mofakiii](https://avatars.discourse-cdn.com/v4/letter/m/58956e/32.png) [@mofakiii](https://forum.kirupa.com/u/mofakiii)\
**Post date:** [July 10, 2008, 11:15pm UTC](https://forum.kirupa.com/t/accessing-content-of-loaded-swfs/265637/3 "2008-07-10T23:15:09Z")

</div>

It works, thanks for the help.

I actually realized in my example, I accidentally set the publish settings of b.swf to AS 2.0. After I changed it to AS 3.0 it worked like a charm. D’oh!
