1 person found this helpful
How do you connect the XML to the tileList?
I use a http request to get the data from a remote xml/php file like so:-
<mx:HTTPService id="entertainmentService" resultFormat="object" result="entertainmentResultHandler(event)" url="http://www.coolvisiontest.com/getentertainment.php"/>
Then I make the resultHandler which puts it into an array collection like so:-
private function entertainmentResultHandler(event:ResultEvent):void
And then I make that array collection bindable like this:-
private var EntertainmentFullAC:ArrayCollection;
I then set that array collection as the dataprovider for my tilelist. I have multiple array collections set up in the above way and the array collection of the tilelist changes between all of these depending on what button a user clicks at the top of the app but as I say the problem is if the user selects one that only has 1 node in it's xml fileit won't display.
In my tilelist I have an inline itemRenderer composed of an image and a label and these both display correctly unless a 1 noded array collection is selected.
After a bit of research I now realise that this problem has been discuseed before and an old suggestion was to use XMLList or XMLListCollection rather than array collection but I'm not sure if this would work in my example.
So by using "object" as your result format, you are not actually using XML
and the converter will guess as to whether you have one object or a list of
If you use "e4x' as the result format and XMLListCollection instead of
ArrayCollection it might be easier to get it to work.