PDA

View Full Version : AS Window Component


vinco
07-14-2005, 05:59 AM
Hi there,

I have 2 questions in using the Window Component.

First I cannot set a default value to a TextInput that's included in the movieclip using contentPath. (See Code below)

Moreover, if I'm creating the Window component in AS, I cannot load it from another movieclip.

Otherwise, if I create the Window Component on the Stage, the Listener won't work to close the window.

Those are the things that drive me crazy tonight. If you could help me, I'd really appreciate it.

Thanks!
Vincent

import mx.managers.PopUpManager;
import mx.containers.Window;
var wRenamePage = PopUpManager.createPopUp(this, Window, false, {closeButton:true});
wRenamePage.title="Rename Page";
wRenamePage.contentPath = "mcForm";

var windowListener:Object = new Object();

windowListener.click = function(evt){
wRenamePage.deletePopUp();
}

windowListener.complete = function(evt){
evt.target.setSize(180,140);
evt.target.content.tPageName.text ="hello";
//evt.target.content.tPageName.text = "pagename";
}

wRenamePage.addEventListener("click", windowListener);
wRenamePage.addEventListener("complete", windowListener);

sleekdigital
07-14-2005, 10:10 PM
First I cannot set a default value to a TextInput that's included in the movieclip using contentPath. (See Code below)

I think the problem here is that when complete fires, although the window contents have been loaded, the text field has not initialized yet. The only thing I have come up with to handle this situation is to use setInterval or onEnterframe to poll the text field checking to see when one of its properties is defined as expected, then I know it is initialized and I set the text value.

Moreover, if I'm creating the Window component in AS, I cannot load it from another movieclip.

Otherwise, if I create the Window Component on the Stage, the Listener won't work to close the window.


not exactly sure what you mean by this, can you explain further?