views:

302

answers:

0

Hey guys, I been toying around with the new loader() event.

I create 2 files. One named par.swf with the code below in it, and the other named chi.swf. chi.swf has 2 frames. on frame one it has an input box with the instance name of textboxonframe1 and on frame 2 there is a input box named textboxonframe2 (I am creative, I know.)

For whatever reason I cant get variables loaded into textboxonframe2 from the parent. Any ideas?

Any help would be appreciated. I am new to the AS3 world.

 var loader:Loader = new Loader();
loader.contentLoaderInfo.addEventListener( Event.COMPLETE, onLoadComplete );


loader.load( new URLRequest("chi.swf") );
addChild(loader);
function onLoadComplete( event:Event ):void{
    var str:String = "foo";
    MovieClip(loader.content).gotoAndStop(1);
    MovieClip(loader.content).textboxonframe1.text = str; // works fine, gets set to foo
    MovieClip(loader.content).textboxonframe2.text = str; //errors
    MovieClip(loader.content).gotoAndStop(2);
    MovieClip(loader.content).textboxonframe2.text = str; //still errors? Why?

}