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 30 31 32 33 34 35 36
| <?xml version="1.0" encoding="UTF-8">
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" result="getResult(event)" fault="getFault(event)">
<mx:Script>
[CDATA[
private function getVars():void{
connection.method="post";
connection.resultFormat="flashvars";
connection.send();
}
private function getResult(event:resultEvent):void{
trace(event);
nom.text=connection.phpclass.nom;
prenom.text=connection.phpclass.prenom;
}
private function getFault(event:resultEvent):void{
trace(event);
Alert.show('la liaison n'a pas aboutie');
}
]]
</mx:Script>
<mx:HTTPService url="Provider.php" id="connection">
<mx:request>
<nom>keita</nom>
<prenom>abdou</prenom>
</mx:request>
</mx:HTTPService>
<mx:Canvas>
<mx:Label title="nom"/>
<mx:TextInput id="nom"/>
<mx:Label title="prenom"/>
<mx:TextInput id="prenom"/>
<mx:Button label="lancer la tache" click="getVars()"/>
</mx:Canvas>
</mx:Application> |