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 37 38 39 40 41 42 43 44 45 46
| <?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx" minWidth="955" minHeight="600" xmlns:servicessoap="services.servicessoap.*" >
<fx:Script>
<![CDATA[
import mx.controls.Alert;
import mx.events.FlexEvent;
// ma premiere fonction qui ouvre une session
protected function button_clickHandler(event:MouseEvent):void
{
ouvrirSessionResult.token = servicesSOAP.ouvrirSession(parseInt('idModule'));
}
internal var idModule:int=14;
//ici je stock le resultat de la fonction precedante
internal var idSession:int=ouvrirSessionResult.lastResult as int;
//la 2eme fonction pour authentification
protected function button2_clickHandler(event:MouseEvent):void
{
authentifierUtilisateurResult.token = servicesSOAP.authentifierUtilisateur(parseInt('idModule'),idSession,"identifiant.text","mdp.text");
}
]]>
</fx:Script>
<fx:Declarations>
<servicessoap:ServicesSOAP id="servicesSOAP" fault="Alert.show(event.fault.faultString + '\n' + event.fault.faultDetail)" showBusyCursor="true"/>
<s:CallResponder id="ouvrirSessionResult"/>
<s:CallResponder id="authentifierUtilisateurResult"/>
<!-- Placer ici les éléments non visuels (services et objets de valeur, par exemple). -->
</fx:Declarations>
<s:Button label="OuvrirSession" id="button" click="button_clickHandler(event)" x="110" y="97"/>
<s:TextInput x="81" y="181" id="identifiant"/>
<s:TextInput x="81" y="255" id="mdp"/>
<s:Button x="98" y="325" label="Button" id="button2" click="button2_clickHandler(event)"/>
<s:TextArea x="392" y="242" height="35" id="id_sess" text="{authentifierUtilisateurResult.lastResult}"/>
</s:Application> |
Partager