Bom dia senhores, estou um problema, primeiro erei explicar o que quero fazer e depois se alguém tiver uma solução eu fico grato.
1- Eu tenho uma view e nela tem um botão que no evento MouseClick.CLICK vai para o seguinte procedimento.
protected function onTeste(event:MouseEvent):void{
var alerta:ReservaEscolha = new ReservaEscolha();
var retorno:int;
alerta.show(this,"1","2");
retorno = alerta.getRetorno ();
trace("Passo devia ");
}
width="100%" height="100%" creationComplete="creationComplete(event)" backgroundColor="#606060">
<fx:Script>
<![CDATA[
import mx.events.FlexEvent;
public var retorno:int = 0;
[Bindable]
public var lb1:String;
[Bindable]
public var lb2:String;
public function show(pai:DisplayObjectContainer,l1:String, l2:String):void
{
this.open(pai);
lb1 = l1;
lb2 = l2;
}
protected function creationComplete(event:FlexEvent):void
{
this.width = screen.width + 10;
this.height = screen.height + 10;
this.y = (screen.height - this.height) / 2;
this.x = (screen.width - this.width) / 2 ;
border.width = screen.width - 30;
}
protected function UsarUsuario(event:MouseEvent):void
{
retorno = 1;
this.close();
}
protected function UsarOutroUsuario(event:MouseEvent):void
{
retorno = 2;
this.close();
}
public function getRetorno():int{
return retorno;
}
]]>
</fx:Script>
<s:BorderContainer id="border" backgroundColor="#71f377" horizontalCenter="0"
verticalCenter="0">
<s:VGroup top="10" bottom="5" gap="12" horizontalAlign="contentJustify" horizontalCenter="0"
verticalCenter="0" paddingBottom="2" paddingLeft="8" paddingRight="8" paddingTop="8">
<s:Button id="but" width="90%" height="20%" label="{lb1}" click="UsarUsuario(event)" fontSize="14" fontStyle="normal" fontWeight="normal" horizontalCenter="0"/>
<s:Button id="but2" width="90%" height="20%" label="{lb2}" click="UsarOutroUsuario(event)" fontSize="14" fontStyle="normal" fontWeight="normal" horizontalCenter="0"/>
</s:VGroup>
</s:BorderContainer>
</s:SkinnablePopUpContainer>
Só que na parte que destaquei em vermelho gostaria que executasse o alerta.show esperasse a pessoa escolher a opção e voltar para o onTeste(); para que junto com o getRetorno pegasse o valor corretamente, mas do modo que esta ele chama o alerta.show, só que continua executando o onTeste(), não conseguindo assim pegar o retorno corretamente.
Grato.