Problem reading an AS array in Java
Valerian <[email protected]>
| Newsgroups | gmane.comp.java.openamf.user |
|---|---|
| Message-ID | <[email protected]> |
Hello all,
I'm beginning with OpenAMF and having a problem :
In actionscript, i write an array like this one :
------------------------------------------------------------
myArray = new Array();
mySubArray = new Array();
mySubArray.push({value:"myvalue", value2:"myvalue"});
myArray.push({val1:"test", val2:0, val3:"test", val4:mySubArray});
myArray.push({val1:"test2", val2:2, val3:"test2", val4:mySubArray});
------------------------------------------------------------
and i send it to openAMF using :
------------------------------------------------------------
var saveService:Service = new
Service("http://localhost:8080/myapp/gateway",null, "com.company.app.MyClass",
null,null);
var pc:PendingCall = saveService.setData(myArray);
pc.responder = new RelayResponder(this,"onSaveOk","onSaveError");
------------------------------------------------------------
everything is ok for this part,
the array is sent to openAMF,
in method setData() of MyClass, i don't know how to get the value of the
different entries of myArray to store them into a MySQL database.
I've tried different things but none works, i'm begining with Java too.
-------------------------------------------------------
public String setData(ArrayList myarray) {
for(int i=0; i<myarray.size(); i++) {
ASObject test = (ASObject)myarray.get(i);
System.out.println(test.get("val1"));
}
return "test";
}
-------------------------------------------------------
Any idea how to do this stuff ??
If you can help me :-)
Thanks,
Valérian
-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf