I'm having a problem with the popup-windows created with PopUpManager.createPopUp. I first create an empty window with: [i]loginpopup = mx.managers.PopUpManager.createPopUp(_root,mx.containers.Window,true,{title:"Log ging in...", contentPath:"", closeButton:true});[/i] Now I want to attach a movie to the popup-window with: [i]loginpopup.content.attachMovie("logintxt","logintext",10);[/i] And then create the closebutton event listener: [i]windowlistener.handleEvent = function(evtObj){ if(evtObj.type == "click"){ loginpopup.deletePopUp(); } } loginpopup.addEventListener("click",windowlistener);[/i] The window pops up ok and the closebutton works but the attachMovie-command doesn't seems to work. I have figured out that the attachMovie command seems to execute before the window has been fully created and therefore nothing shows up in the window (I have tested this by executing the attachMovie-command at a later event and that works fine). I have tried to move the attachMovie-command to the window.complete event but that doesn't help. Anyone who knows how to solve this problem, is there an event that is triggered when the window is fully created and it's ok to modify the content in the window?
What if you do this: loginpopup = mx.managers.PopUpManager.createPopUp(_root,mx.containers.Window,true,{title:"Log ging in...", contentPath:"[b]logintext[/b]", closeButton:true}); then you won't need the [i]attachMovie[/i]() call?
Don't see what you're looking for? Try a search.
|