I'm using Flex 3.6 and ZEND AMF version 1.11
I have an array that shows in my trace using trace(ObjectUtil.toString(event.result));
It outputs as follows:
---This is a Test!---
//The Object Contains...
(Object)#0
code = "112"
path = "whateverthispathis"
Path is:
-----End of Test-----
In REST we used event.result.data.path
to get the path variable.
How do I get the path variable via Zend AMF without using XML and out of the PHP array I made posted below?
This is the PHP code I'm using to send it back to Flex:
$Data = Array();
$data = new params();
$data->path = $path;
$data->code = "10";
array_push($Data,$data);
return $data;
I have no problem throwing the results in lists, arrays, datagrids, etc., but there are times I just need to access 2 strings out of sometimes 20 strings only and this is why I'm asking.
Ok i have finally figured out my answer
The way we use Rest Services to access XML output like
That is accessed by using event.result.data.path; if using event:ResultEvent
Now with Zend AMF using examples based off Creating a Simple Crud Application and Shrinking and modifying the code to my liking yet the return of the php object remains the same...
I have to use this
and it outputs as follows in my flash debugger console
---This is a Test!--- Path is: mypath -----End of Test-----
Now
obj[0]
is basically the first Object Row "path" is the String in the Object set by using this sample code on the ZEND AMF PHP Class fileIf i wanted to access the
passed
value i'd have to usetrace("Path is: "+String(obj[0].passed));
which would output as10
If i wanted to Access the 2nd set of Object Values and so on... increment the
obj[0]
toobj[1]
and increase for any additional Rows In my case anyobj[1]
would output asnull
Since I have no additional rows at this time.Of Course mostly we hardly ever need to access multiple rows of Objects since thats commonly added as ArrayCollections or Arrays and Displayed in Datagrids and Lists and whatnot. Like the Simple Crud Demonstration at the link below shows.
Also i use Open Flex 3.6 SDK therefore in the Simple Crud Application i had to modify all the
s:
(Spark Containers) To mx: and eliminatefx:
Declarations as well thats just a note for those attempting to use the Simple Crud PHP Zend Application and not using Flex 4 nor Flex 4.5The Simple Crud i was referring to is linked as follows http://www.adobe.com/devnet/flex/articles/crud_flex_php_zend.html