Hi all,
I am not sure if this is CRUX correct. I have a loginEvent that checks the user
details on the server via the UsuarioController, if the result of the service
call is correct I want to call a CommonEvent that will call the
CommonController. I have tried creating an Event and dispatching it directly
from the UsuarioController, but I get the following error:
Failed to execute 'dispatchEvent' on 'EventTarget': parameter 1 is not of type
'Event'.
When debugging the __proto__ of the event is org.apache.royale.events.Event.
I am creating and dispatching like this in the UsuarioController.
private function handleLoginResult( event : ResultEvent ) : void
{
appModel.currentUsuario = event.result as UsuarioVO;
appModel.currentUsuario =
RolHelper.fillBooleansRolUsuario(appModel.currentUsuario);
appModel.selectedUsuario = appModel.currentUsuario;
appModel.selectedState = AppModel.STATE_MAIN;
try
{
var
eventLoadConfiguraciones:CommonEvent = new
CommonEvent(CommonEvent.EVENT_LOAD_CONFIGURACIONES);
dispatchEvent(eventLoadConfiguraciones);
}
catch(e:Error)
{
Alert.show(e.message);
}
}
}
What is the correct way to do this?