# Trace a String defined in "main.swf" from an external swf

**URL:** <https://forum.kirupa.com/t/trace-a-string-defined-in-main-swf-from-an-external-swf/289166>\
**Category:** Uncategorized\
**Created:** [May 27, 2009, 2:44am UTC](https://forum.kirupa.com/t/trace-a-string-defined-in-main-swf-from-an-external-swf/289166 "2009-05-27T02:44:37Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![quicksmack](https://avatars.discourse-cdn.com/v4/letter/q/fbc32d/32.png) [@quicksmack](https://forum.kirupa.com/u/quicksmack)\
**Post date:** [May 27, 2009, 2:44am UTC](https://forum.kirupa.com/t/trace-a-string-defined-in-main-swf-from-an-external-swf/289166/1 "2009-05-27T02:44:37Z")

</div>

is it possible to trace/get a variable that’s defined in a “main” .swf, from an external SWF that has been loaded onto the “main” SWF?

for example, if i have 2 SWF files called “main.swf” and “sub\_page.swf”…  
the code in “main.swf” is:

```auto
 // create and define a variable
var currentInformation:String;
currentInformation = "this is just a test...";

// load the external swf
loadSubPage();

function loadSubPage():void
{
    var addressOfRequest:URLRequest = new URLRequest("includes/sub_page.swf");
    var loader:Loader = new Loader()
    loader.load(addressOfRequest);
    loader.contentLoaderInfo.addEventListener(Event.COMPLETE, addPage);
}

function addPage(loadEvent:Event):void
{
    addChild(loadEvent.currentTarget.content);
}

```

the code in the “sub\_page.swf” is:

```auto
// try to trace the variable defined in "main.swf"
trace(currentInformation);
emptyTextBox.text = String(currentInformation);

```

would this be possible?  
im a currently getting errors as of now…  
i tried putting “Object(root)” before “currentInformation” and it still wont work…
