// create a new CSSStyleDeclaration named TitleStyles
// and list it with the global styles list
_global.styles.TitleStyles = new mx.styles.CSSStyleDeclaration();
// customize styles
_global.styles.TitleStyles.color = 0xff0000;
_global.styles.TitleStyles.fontSize = 14;
function popup(wContent:String) {
myButton.onPress = function() {
tw = mx.managers.PopUpManager.createPopUp(this, mx.containers.Window, true,
{closeButton:true, titleStyleDeclaration:"TitleStyles"});
tw.title = "WINDOW";
tw.setSize(120, 60);
tw.contentPath = "name";
/**************************************
//HERE IS THE IMPORTANT PART TO INSERT
this.onEnterFrame = function() {
if (tw.content != undefined) {
delete this.onEnterFrame;
tw.content.myName.text = wContent;
}
};
/***************************************
tw.move(20, 20);
var handleCloseObject:Object = new Object();
handleCloseObject.click = function(evt:Object) {
evt.target.deletePopUp();
};
tw.addEventListener("click", handleCloseObject);
};
}
popup("Textfield from movieclip!");
|