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:
// 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:
// 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…