Hi all!
I'm missing something crucial here I think...
I'm making a preloader/container swf for a site we're producing. My idea is to have a generic preloader swf that gets a number of settings from an xml file, saves them all in a Dictionary and then loads an external swf that is used to display the content. A pretty common approach I think, or isn't it?
The problem though is how do I access variables created in my preloader swf from the externally loaded swf? In AS2 I could just get the vars by starting with _root.whatever but that doesn't seem to be possible in AS3, right?
Preloader (parent) code...
package { import flash.display.Loader; import flash.display.Sprite; import flash.events.Event; import flash.net.URLRequest; public class ExampleA extends Sprite { private var loader:Loader = new Loader(); public function ExampleA() { loader.contentLoaderInfo.addEventListener( Event.INIT, onLoaderInit ); loader.load( new URLRequest( "ExampleB.swf" ) ); } private function onLoaderInit( e:Event ):void { Object( loader.content ).init( "hello" ); } } }package { import flash.display.Sprite; public class ExampleB extends Sprite { public function ExampleB() {} public function init( param:String ):void { trace( param ); // hello } } }