PDA

View Full Version : PopUp Window


MadamZuZu
08-02-2007, 06:48 PM
Hello,

i'm having a litle problem understand how this works...

i have a pop up window.
it will come up, when you click on one of two buttons.

in that pop up window, i have a ViewStack, with 2 different Canvases.

I call it like so:


private function showLogin():void
{
// Create a non-modal TitleWindow container.
var helpWindow:IFlexDisplayObject =
PopUpManager.createPopUp(this, MyHelpWindow, false);
}

what can i do, to determine which buttons has been pressed, and show the accordin canvas?

.... is there a way to pass in which button i clicked?
Thanks!

drkstr
08-03-2007, 01:56 AM
Do you mean like this?

<mx:Button label="I am a Button" click="trace('Do something');" />
<mx:Button label="I am also a Button" click="trace('Do something else');" />

Or did I misunderstand what you were wanting to do?

Regards,
...aaron

drkstr
08-03-2007, 03:51 AM
Oh wait, I think I misunderstood. You want your pop up window to know which button was clicked to pop up the same window?

In your pop up window class, I would create a function that lets you set the index for the view state based on which button was clicked.

It would work something like this

public function showLoginWindow( index:int ):void {
var loginWindow:LoginWindow = LoginWindow(PopUpManager.createPopUp( this, LoginWindow , true));
loginWindow.setViewState(index);
}


Where LoginWindow is a component based on TitleWindow. When a button is clicked, it will pass the index to the function. Adapt to your program as needed.

Best regards,
...aaron