parent pass text string to child swf, as3

Posted by VideoDnd on Stack Overflow See other posts from Stack Overflow or by VideoDnd
Published on 2010-04-29T08:29:55Z Indexed on 2010/04/29 8:37 UTC
Read the original article Hit count: 186

Filed under:
|

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'

© Stack Overflow or respective owner

Related posts about flash

Related posts about actionscript-3