I'm trying to take a variable from the parent movieclip and use it in the child movieclip inside of a dynamic text field.
The variable has a value that is taken from a php file.
I'm completely lost at the moment and know that my code is probably completely wrong.
here it is:
parent movieclip:
var loader:URLLoader = new URLLoader();
loader.addEventListener(Event.COMPLETE,onLoaded);
loader.load(new URLRequest("../SC/FLA_cont-btn.php"));
function onLoaded(evt:Event):void
{
var data:URLVariables = new URLVariables(event.target.data);
variables.sponny = data.sponny_name;
}
Child movieclip:
trace((parent as MovieClip).variables.sponny);
sponsor_name.text = +variables.sponny;
I get 2 errors using this code:
1120: Access of undefined property event. 1120: Access of undefined property variables.
any help would be much appreciated!