关于RemoteClass的问题
我想用flex和java通信,,返回的结果是一个Person的对象,但是Person有个car对象
但是呢,我RemoteClass(alias="test.Person")只能得到Person。。没有Car,在Car那里添加RemoteClass(alias="test.Car")好像也不行。
下面是代码:
flex的代码
package test
{[Bindable]
[RemoteClass(alias="test.Person")]
public class Person
{
public var id:int;
public var name:String;
public var car:Car;
public function Person()
{
}
}
}
package Car
{[Bindable]
[RemoteClass(alias="test.Car")]
public class Person
{
public var id:int;
public var name:String;
public function Car()
{
}
}
}
package test;
public class Person{
private Integer id;
private String name;
private Car car;
.... set get 省略
}
package test;
public class Car {
private Integer id;
private String name;
.... set get 省略
}
//登录返回结果处理方法
private function loginHandler(event:ResultEvent):void{
var p:Person=event.result as Person;
var car:Car=p.car;
Alert.show(car.name);
}