Groups | Blog | Home
all groups > flash actionscript > march 2004 >

flash actionscript : Problem with PopUpManager


Shadowdream
3/27/2004 9:36:52 PM
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?
db NO[at]SPAM sv
4/20/2004 8:32:43 PM
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?

AddThis Social Bookmark Button