# Loading an AS2 SWF file from an AS3 SWF file, and getting some parameters in AS2 file

**URL:** <https://forum.kirupa.com/t/loading-an-as2-swf-file-from-an-as3-swf-file-and-getting-some-parameters-in-as2-file/245668>\
**Category:** flash\
**Created:** [December 2, 2007, 8:38pm UTC](https://forum.kirupa.com/t/loading-an-as2-swf-file-from-an-as3-swf-file-and-getting-some-parameters-in-as2-file/245668 "2007-12-02T20:38:03Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Zomis](https://avatars.discourse-cdn.com/v4/letter/z/e56c9b/32.png) [@Zomis](https://forum.kirupa.com/u/Zomis)\
**Post date:** [December 2, 2007, 8:38pm UTC](https://forum.kirupa.com/t/loading-an-as2-swf-file-from-an-as3-swf-file-and-getting-some-parameters-in-as2-file/245668/1 "2007-12-02T20:38:03Z")

</div>

This is my ActionScript 3.0 code:

```auto
var ldr: Loader = new Loader();
var upldata = "testabc=test1";
var v: URLVariables = new URLVariables(upldata);
var r:URLRequest = new URLRequest();
r.url = "as2.swf";
r.method = URLRequestMethod.POST;
r.data = v;

trace("loading", r.url);
ldr.addEventListener(Event.COMPLETE, fnccomp);
ldr.addEventListener(IOErrorEvent.IO_ERROR, fncerr);
function fnccomp(ev: Event) {
    trace("complete");
}
function fncerr(ev: IOErrorEvent) {
    trace("error", ev);
}
ldr.load(r);
addChild(ldr);

```

In the as2.swf file, there are two trace commands (using ActionScript 2.0 for this Flash file):  
trace(“as2.swf " + \_root.testabc);  
trace(”\_level0.testabc: " + \_level0.testabc);

This outputs:

```auto
loading as2.swf
as2.swf undefined
_level0.testabc: undefined

```

Changing this line:  
r.method = URLRequestMethod.POST;  
to  
r.method = URLRequestMethod.GET;  
results in:

```auto
loading as2.swf
Error #2044: Unhandled IOErrorEvent:. text=Error #2035: URL Not Found.

```

So, how to do this correctly so that I can access the “testabc=test1” variable/value from the as2.swf file?
