Skip to main content
April 11, 2017
Question

access to _root from remote loaded swf

  • April 11, 2017
  • 1 reply
  • 1051 views

Hi. please help me. I have a AS2 program called Main.swf. It loads another(not mine) program (call it Base.swf). Both of these files are located locally on my computer. I load into my program Mine.swf an external file load.swf.

//Main.swf

System.security.allowDomain('*');

this.createEmptyMovieClip('module', 0);

module.loadMovie('http://192.168.10.102/loaded.swf');

From the loaded.swf file, I try to access _root which should be equal to Base.swf. But I can not do it. Although from the file Main.swf I can access _root.

//Main.swf

...

_root.someFunctionFromBase(); //it work

module._root.someFunctionFromBase(); //even so works

//loaded.swf

_root.someFunctionFromBase(); //undefined

How can I access variables and functions in _root from the loaded file?

This topic has been closed for replies.

1 reply

kglad
Community Expert
Community Expert
April 15, 2017

Main loads loaded and Main loads Base?

April 16, 2017

Sorry, probably not correctly explained. The sequence is as follows: Base <- Main <- loaded

kglad
Community Expert
Community Expert
April 16, 2017

if you want to reference objects in Main from loaded, use _parent.