문제

Actually in my Flex sample applicaion have Main mxml called Demo.mxml.. in the main mxml file have login button when we click login button Login.mxml file called

protected function button2_clickHandler(event:MouseEvent):void
        {

            PopUpManager.createPopUp(this,Login);
        }

In Login.mxml file doing some authetication useing java..

public var userService:UserService = new UserService();
        [Bindable] public var userVO:UserVO = new UserVO();

        protected function loginUser(event:MouseEvent):void
        {

            var rpcAuthenticateUser:AsyncToken = userService.authenticateUser(userid_id.text, password_id.text);
            rpcAuthenticateUser.addResponder(new mx.rpc.Responder(handle_authenticate_success, handler_failure));

        }
........


 userVO=userService.getUser();
......

All are done in Login.mxml file correctly Now i am getting value.

How to get userVO object in Demo.mxml file ?

Actually i'm trying but it give some Null values......Plz help me

Thanks in Advance...
도움이 되었습니까?

해결책

create a model class that is a singleton See my answer here about making a singleton.

then in your Demo.mxml

[Bindable] public var model:MyModel = MyModel.getInstance();

then in your login form

public var model:MyModel = MyModel.getInstance();

then when you get the response from the service:

model.userVO = userService.getUser();

now in your Demo.mxml, userVO is now populated and usable there.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top