Eu tenho na aplicação um botão cadastrar, nele é chamado um alert que possui dois tipos cadastros, eu tenho uma página mxml de cadastro, com dois States stateBase(Profissional) e stateEmpresa, eu queria chamar uma mxml passando o state escolhido, eu tente usar o this.currentState=‘stateEmpresa’, mas não deu certo, tem como eu fazer isso, esse é o código:
private function goToURL(myUrl:String):void
{
var urlToNav:URLRequest = new URLRequest(myUrl);
navigateToURL(urlToNav,"_self");
}
private function tipoPerfil(event:Event):void {
Alert.buttonWidth = 120;
Alert.buttonHeight = 30;
Alert.yesLabel = “Profissional”;
Alert.noLabel = “Empresa”;
Alert.show(“Selecione o Tipo de Cadastro:”,“Cadastro”, <a href="http://Alert.YES%7CAlert.NO">Alert.YES|Alert.NO</a>, null, selecionarTipoPerfil);
}
private function selecionarTipoPerfil(event:CloseEvent):void {
if (event.detail==Alert.YES)
goToURL(‘Cadastro.html’); //Funciona corretamente vai para o stateBase
else if (<a href="http://event.detail==Alert.NO">event.detail==Alert.NO</a>)
goToURL(‘Cadastro.html’); // Vai para o stateBase, eu queria ir para o stateEmpresa
this.currentState=‘stateEmpresa’;// Uma tentativa sem noção, não deu certo
}
Obrigado desde já.
