SoFunction
Updated on 2025-04-10

Flex handles data transmitted from the server side page 1/2


<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="/2006/mxml"
layout="vertical">
<mx:RemoteObject destination="helloService"
>
<mx:method name="hello"
result="sayHelloResult(event)"/>
<mx:method name="world"
result="sayWorldResult(event)"/>
<mx:method name="getMap"
result="getMapResult(event)"/>
<mx:method name="getList"
result="getListResult(event)"/>
<mx:method name="getSet"
result="getSetResult(event)"/>
</mx:RemoteObject>
<mx:HBox>
<mx:Label text="Input:"/>
<mx:TextInput />
<mx:Button label="say hello"
click="sayHello(event);"/>
<mx:Button label="say world"
click="sayWorld(event);"/>
<mx:Button label="get map"
click="()"/>
<mx:Button label="get list"
click="()"/>
<mx:Button label="get set"
click="()"/>
</mx:HBox>
<mx:HBox>
<mx:Label text="Result:"/>
<mx:TextArea />
</mx:HBox>

<mx:Script>

<!--[CDATA[
import ;
import ;
import ;
import ;
import ;
[Bindable]
public var person:Person;
[Bindable]

public var map:ArrayCollection=null;

function sayHello(event:Event):void
{
var inputVar:String=;
(inputVar);

}

function sayWorld(event:Event):void
{
var inputVar:String=;
(inputVar);

}

private function sayHelloResult(event:ResultEvent):void
{
=();
((), "Return result");
}

private function sayWorldResult(event:ResultEvent):void
{
=();
((), "Return result");
}

private function getMapResult(event:ResultEvent):void
{
for (var key:String in )
{
var list:ArrayCollection=[key] as ArrayCollection;
for (var key1:Object in list)
{
("map item key is: " + key + " value is: " + key1);
}

}
}

private function getList():void
{
();
}

private function getListResult(event:ResultEvent):void
{
var ac:ArrayCollection= as ArrayCollection;
for (var i:int=0; i < ; i++)
{
var p1:Person=(i) as Person;
("list item name is: " + +" \n another usage : "+(i).name);
}

}
private function getSet():void
{
();
}

private function getSetResult(event:ResultEvent):void
{
var ac:ArrayCollection= as ArrayCollection;
for (var i:int=0; i < ; i++)
{
var p1:Person=(i) as Person;
("set item name is: " + );
}

}
]]-->
</mx:Script>
</mx:Application>