# Load SWF help

**URL:** <https://forum.kirupa.com/t/load-swf-help/298383>\
**Category:** flash\
**Created:** [October 17, 2009, 8:23pm UTC](https://forum.kirupa.com/t/load-swf-help/298383 "2009-10-17T20:23:20Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![sluke](https://avatars.discourse-cdn.com/v4/letter/s/53a042/32.png) [@sluke](https://forum.kirupa.com/u/sluke)\
**Post date:** [October 17, 2009, 8:23pm UTC](https://forum.kirupa.com/t/load-swf-help/298383/1 "2009-10-17T20:23:20Z")

</div>

Hi all,

I’ve recently started to learn AS3.0 and have hit a problem.

I need to load an external SWF into a movieclip, and get the name of the SWF from a variable from a class. The variable is called getSWF and is defined as

```auto
public var getSWF = "movie.swf";

```

When I trace(getSWF); on the first frame of the main time line it outputs fine. However when I use the following code on the movieclip :

```auto
var testtest= getSWF;
var imageRequest:URLRequest = new URLRequest (testtest);
var imageLoader:Loader = new Loader();
imageLoader.load(imageRequest);
addChild(imageLoader);

```

I get the error:

1120: Access of undefined property getSWF.

Though if I change the variable testtest to movie.swf it works fine, any ideas?

Cheers for looking
