protected function save():void
{
var personServiceRO:RemoteObject = new RemoteObject();
personServiceRO.destination = "personService";
var token:AsyncToken = personServiceRO.save(new Person(id:Number)); --
Getting error here :: Expecting rightparen before colon
token.addResponder(
new AsyncResponder(
function(event:ResultEvent, token:Object = null):void {
// Result
},
function(event:FaultEvent, token:Object = null):void {
// Fault
}
)
);
<fx : Declarations>
<s:CallResponder/>
<services:
PersonService id="
personService">
<services:channelSet>
<!--connect to backend using channel -->
<s:ChannelSet>
<s:AMFChannel uri="http://localhost:9080/userweb/messagebroker/amf"
<s:ChannelSet>
</services:channelSet>
</services:Personservice>
</fx : Declarations>
<mx:TextInput id="id" x="269" y="58"/>
<mx:TextInput id="owner" x="269" y="93"/>
<!-- id and owner are fields in Person.as and Person.java -->
and this is my Person.as
import mx.collections.ArrayCollection;
[RemoteClass(alias="com.javaproject.TestPerson")]
[Bindable]
public class
Person
{
//constructor
public function Person(id:Number)
{
this.id=id;
}
public var id:Number = NaN;
public var owner:String;
public var work:ArrayCollection = new ArrayCollection();
}