FORUMS: list search recent posts

Convert AS2 to AS3 (PHP, XML List)

COW Forums : Adobe Flash

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Jesper Neergaard
Convert AS2 to AS3 (PHP, XML List)
on May 11, 2010 at 9:54:12 am


I've followed the PHP, MySQL tutorial ( and finally got it to work - The problem was, that it has to be used in AS2.

Is there any way, to rewrite the code to work in AS3?
The code looks as follows;

var theXML:XML = new XML();
theXML.ignoreWhite = true;

theXML.onLoad = function() {
var nodes = this.firstChild.childNodes;
for(i=0;i<nodes.length;i++) {


Return to posts index

Adam Ashby
Re: Convert AS2 to AS3 (PHP, XML List)
on May 12, 2010 at 4:57:36 am

If you xml looked like this:

<item label = "one" />
<item label = "two" />
<item label = "three" />


var i:int = 0;
var xmlLoader = new URLLoader(new URLRequest(""));
xmlLoader.addEventListener(Event.COMPLETE, addToList);

function addToList(e:Event):void {
var xml = new XML(;

for each (var item:XML in xml.item) {
var label:String = item.@label;
theList.addItem(label, i);


if you're not using attributes, like:



var label:String = item.toString();

XML is much, much easier in AS3.

Adam Ashby
mutli-media artist

Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2018 All Rights Reserved