flex-en-php
Code (php)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" width="408" height="358">
<mx:Script source="functions.as" />
<mx:HTTPService id="info" result="ongo(event)" showBusyCursor="true" url="http://127.0.0.1/test.php" useProxy="false" />
<mx:DataGrid dataProvider="{myData}" editable="false" width="350" height="144" x="29" y="93" >
<mx:columns>
<mx:DataGridColumn width="100" headerText="ID" dataField="id"/>
<mx:DataGridColumn width="100" headerText="Naam" dataField="name"/>
<mx:DataGridColumn width="150" headerText="E-mail" dataField="email"/>
</mx:columns>
</mx:DataGrid>
<mx:Button x="296" y="245" label="clear data" click="del()"/>
<mx:Button x="193" y="245" click="info.send()" label="update data"/>
</mx:Application>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" width="408" height="358">
<mx:Script source="functions.as" />
<mx:HTTPService id="info" result="ongo(event)" showBusyCursor="true" url="http://127.0.0.1/test.php" useProxy="false" />
<mx:DataGrid dataProvider="{myData}" editable="false" width="350" height="144" x="29" y="93" >
<mx:columns>
<mx:DataGridColumn width="100" headerText="ID" dataField="id"/>
<mx:DataGridColumn width="100" headerText="Naam" dataField="name"/>
<mx:DataGridColumn width="150" headerText="E-mail" dataField="email"/>
</mx:columns>
</mx:DataGrid>
<mx:Button x="296" y="245" label="clear data" click="del()"/>
<mx:Button x="193" y="245" click="info.send()" label="update data"/>
</mx:Application>
Code (php)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
2
3
4
5
6
7
8
9
10
11
12
13
14
// ActionScript file
//functions.as
import mx.rpc.events.ResultEvent;
[Bindable]
public var myData:Object;
public function ongo(evt:ResultEvent) :void{
myData = evt.result.people.person;
}
//functions.as
import mx.rpc.events.ResultEvent;
[Bindable]
public var myData:Object;
public function ongo(evt:ResultEvent) :void{
myData = evt.result.people.person;
}
Code (php)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
//PHP output
<people>
<person>
<id>1</id>
<name>karel</name>
<email>[email protected]</email>
</person>
<person>
<id>2</id>
<name>klaas</name>
<email>[email protected]</email>
</person>
<person>
<id>3</id>
<name>piet</name>
<email>[email protected]</email>
</person>
<person>
<id>4</id>
<name>jaap</name>
<email>[email protected]</email>
</person>
<person>
<id>5</id>
<name>cees</name>
<email>[email protected]</email>
</person>
</people>
<people>
<person>
<id>1</id>
<name>karel</name>
<email>[email protected]</email>
</person>
<person>
<id>2</id>
<name>klaas</name>
<email>[email protected]</email>
</person>
<person>
<id>3</id>
<name>piet</name>
<email>[email protected]</email>
</person>
<person>
<id>4</id>
<name>jaap</name>
<email>[email protected]</email>
</person>
<person>
<id>5</id>
<name>cees</name>
<email>[email protected]</email>
</person>
</people>