我有以下功能用于更改 FYPadminSideV3 组件中的状态。但是,似乎甚至无法向 FYPadminSideV3 组件发送事件并从 FYPadminSideV3 组件调用 .currentState 函数。有谁知道原因吗??
protected function logoutButton_clickHandler(event:MouseEvent):void{
//set currentState="Login"; in main
var logout:Event = new Event("logout", true, true);
var mainComp:FYPadminSideV3 =new FYPadminSideV3();
logoutButton.dispatchEvent(logout);
mainComp.currentState="LOGIN";
//set state = Out; in there
this.currentState="Out";
}