Salut,
j'avance un peu je crois, j'avais une erreur de type NetConnection.call.failed
j'ai résolu l'erreur mais maintenant quand je veux voir si ma connection fonctionne :
mon fichier service :
Action Script
<?php
class HelloWorld{
function firstHello()
{
return "Hello World !!!";
}
}?>
mon script mxml:
Action Script
<?xml version="1.0" encoding="utf-8"?>
<mx:WindowedApplication xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" width="800" height="600" creationComplete="init()">
<mx:Accordion y="113" width="155" height="204" fontStyle="normal" x="10" selectedIndex="3">
<mx:Canvas label="Gestion Utilisateur" width="100%" height="100%" fontStyle="normal">
<mx:LinkButton x="10" y="10" label="Ajouter un utilisateur" width="128" height="17" enabled="true" fontSize="9" fontFamily="Verdana" id="addUser"/>
<mx:LinkButton x="10" y="29" label="Editer un utilisateur" width="123" fontSize="9" height="17" id="editUser" click="edition()"/>
<mx:LinkButton x="10" y="47" label="Supprimer un utilisteur" width="140" height="17" fontSize="9" textAlign="left" id="suppUser"/>
<mx:LinkButton x="10" y="65" label="Ajouter un groupe" height="17" width="128" fontSize="9" enabled="false"/>
</mx:Canvas>
<mx:Canvas label="Gestion Devis" width="100%" height="100%">
</mx:Canvas>
<mx:Canvas label="Contact" width="100%" height="100%">
</mx:Canvas>
</mx:Accordion>
<mx:Panel x="178" y="113" width="600" height="400" layout="absolute" id="Center">
<mx:Text x="23" y="10" width="128" height="15" id="titleMain"/>
</mx:Panel>
<mx:Script>
<![CDATA[
import mx.utils.StringUtil;
import flash.display.Sprite;
import flash.net.NetConnection;
import flash.net.Responder;
import flash.text.TextField;
import flash.text.TextFieldType;
private function init():void{
}
private function edition():void{
titleMain.text = "en Cours";
var netConnection:NetConnection = new NetConnection();
netConnection.connect("http://localhost/amfphp/gateway.php");
netConnection.call("user.HelloWorld", new Responder(resultHandler,result2));
function resultHandler(e:Object):void{
titleMain.text = "good";
}
function result2():void{
titleMain.text = "bad";
}
}
]]>
</mx:Script>
</mx:WindowedApplication>
quand je clique sur le bouton id=" editUser", le titleMain.text passe à bad, ce qui veut dire qu'il ne récupéré pas l'objet..
Suis-je dans le vrai?
Auriez vous une solution?