Utiliser un DataSet avec FLASH
Actionscript:
-
-
-
//This code can be directly copied and pasted onto frame 1 and should work
-
//practically as is. Obviously this is not recommended practice but it should
-
//give you a head start
-
-
import mx.remoting.*;
-
import mx.rpc.*;
-
import mx.utils.Delegate;
-
import mx.remoting.debug.NetDebug;
-
-
//Change the gateway URL as needed
-
var gatewayUrl:String = “<a href=”http://127.0.0.1/speechie/amfphp/gateway.php">http://127.0.0.1/speechie/amfphp/gateway.php</a>";
-
-
NetDebug.initialize();
-
service = new Service(gatewayUrl, null, “SpeechieClass”);
-
-
-
//renvoit la liste des membres>id
-
function getMembresSup(id)
-
{
-
var pc:PendingCall = service.getMembresSup(id);
-
pc.responder = new RelayResponder(this, “handleGetMembresSup”, null);
-
}
-
-
//get membres ici: renvoit la liste des membres
-
function getMembres()
-
{
-
var pc:PendingCall = service.getMembres();
-
pc.responder = new RelayResponder(this, “handleGetMembres”, null);
-
}
-
-
-
function handleGetMembresSup(re:ResultEvent)
-
{
-
//Implement custom callback code
-
trace(“handleGetMembresSup”);
-
}
-
-
function handleGetMembres(re:ResultEvent)
-
{
-
//Implement custom callback code
-
trace(“handleGetMembres”);
-
people_lb.dataProvider=re.result;
-
}
-
// appeler
-
//getMembres();
-
trace(“ici”);
-
var recData = [{id:0, firstName:“Frank”, lastName:“Jones”, age:27, usCitizen:true},
-
{id:1, firstName:“Susan”, lastName:“Meth”, age:55, usCitizen:true},
-
{id:2, firstName:“Pablo”, lastName:“Picasso”, age:108, usCitizen:false}];
-
-
//Assigns recData to the items property of the "myDataSet" DataSet component instance
-
myDataSet.items = recData;
-
-
//Adds schema types for the expected fields
-
var i:mx.data.types.Str;
-
var j:mx.data.types.Num;
-
-
//Makes the first item the current item
-
myDataSet.first();
-
-
//Traces through the properties
-
while ( myDataSet.hasNext() ) {
-
//access the data through the Dataset properties
-
trace(myDataSet.firstName + ” “ + myDataSet.lastName);
-
myDataSet.next();
-
}
0 Responses to “Linux : executer un script au demarrage”
Leave a Reply