parent pass text string to child swf, as3
- by VideoDnd
Parent loads Child, and wants to pass text string to Child. How can Parent pass a string
to Child swf?
PARENT.SWF
//LOAD CHILD 'has a symbol on stage called LDR that CHILD loads into'
var loadCHILD:Loader = new Loader();
LDR.addChild(loadCHILD);
var bgURLTxt:URLRequest = new URLRequest("CHILD.swf");
loadCHILD.load(bgURLTxt);
//ATTEMPT TO COMMUNICATE WITH CHILD TXT
function handler(event:Event):void {
LDR = (event.target.loader.content as MovieClip);
var textBuddy:MovieClip = event.target.content.root.txtBuddy;
//MY TEXT
var txtTest:String;
txtTest = "my bad";
trace(txtTest);
}
CHILD.SWF
'has DynamicTextfield called txt'