Hi all. I'm trying to return a whole bunch of items (in an Array) from PHP using the following code:
var req:URLRequest = new URLRequest("http://mysite.com/somescript.php")
var loader:URLLoader = new URLLoader();
loader.dataFormat = URLLoaderDataFormat.VARIABLES
But basically I just get:
TypeError: Error #1010: A term is undefined and has no properties.
However, when I try to trace "e.target.data", I can see that the array name and values are actually there (with some Hexadecimal addressing in there as well).
On the server side, I'm outputting the array as per normal (Never tried outputting an array before), like so:
$row = mysql_fetch_assoc($result);
$items[$i] = $row['ItemNo'];
$returnVars['Items'] = $items;
$returnString = http_build_query($returnVars);
I know that http_build_query creates a key / value array out of the items within ReturnVars, and wasn't sure how it would handle creating a nested array sort of thing (an array within an array). Is this at all possible or would I need to output the values one dimension at a time more or less in seperate http queries?
you should probably create a string (with a delimiter) in php and then split that string to create your array in flash.
yes! That would work perfectly, I can't believe i didnt think of that. Thanks heaps.