RESOLVED*
I hope this is simple. Seems like i just have something a hair off.
On my stage, i have the List component with the instance name of "theList".
Along with the following code:
Now products.php, links to a mySql database and those two are playing together just fine. When I runCode:var loader:URLLoader = new URLLoader(); loader.addEventListener(Event.COMPLETE, onLoaded); var xml:XML; function onLoaded(e:Event):void { xml = new XML(e.target.data); var il:XMLList = xml.item; for (var i:uint =0; i <il.length(); i++) { theList.addItem({label:il.item.text()[i]}); trace(il.text()[i]); } } loader.load(new URLRequest("http://localhost:8888/MAMP/SHIELDS/products.php"));
I get the complete item list that looks exactly like this in the output window:Code:trace(il.text()[i]);
Perfect.Code:Beach Ball LawnChair Hammock Electric Razor Pool Cue Coffee Machine Organizer
I just can't get the item list to appear on my list component "theList" on line:
All i get is a blank rectangle for each item that i can roll over. No text though.Code:theList.addItem({label:il.item.text()[i]});
Thoughts?
Big thanks!!!
`Shields
*In my line:
i accidentally put the .item in before the text() and I didn't need to because i declared it earlier at:Code:theList.addItem({label:il.item.text()[i]});
i knew it was a dumb mistake. thanks for your timeCode:var il:XMLList = xml.item;




Reply With Quote