tuor
01-05-2007, 09:45 AM
I have an issue assigning variables to components placed inside the window component when using “window.content”. Does anybody know how to make the following code work?
import mx.managers.PopUpManager;
import mx.containers.Window;
var myWindow:MovieClip = PopUpManager.createPopUp(this, Window, true, {closeButton:false, contentPath:"myMovieclip"});
var myWindowListener:Object = new Object();
myWindowListener.complete = function(evt_obj:Object) {
myWindow.setSize(myWindow.content._width+50, myWindow.content._height+50);
myWindow.content.myLabel.text = "label component"; // this does not work
myWindow.content.myDynamicText.text = "text field"; // this works
};
myWindow.addEventListener("complete", myWindowListener);
Here is the sample fla file for Flash MX 2004:
import mx.managers.PopUpManager;
import mx.containers.Window;
var myWindow:MovieClip = PopUpManager.createPopUp(this, Window, true, {closeButton:false, contentPath:"myMovieclip"});
var myWindowListener:Object = new Object();
myWindowListener.complete = function(evt_obj:Object) {
myWindow.setSize(myWindow.content._width+50, myWindow.content._height+50);
myWindow.content.myLabel.text = "label component"; // this does not work
myWindow.content.myDynamicText.text = "text field"; // this works
};
myWindow.addEventListener("complete", myWindowListener);
Here is the sample fla file for Flash MX 2004: