I am trying to position a MovieClip from XML file, in my project i’m using ActionScript 3.0 and i have got a code from the ActionScript 2.0 forum which is working perfectly fine, so i want to convert the below code to ActionScript 3.0
Can somebody help me in converting the below code from ActionScript 2.0 to ActionScript 3.0 ?
Thanks
Code:
myXML = new XML();
myXML.ignoreWhite = true;
myXML.load(‘xml.xml’);
var map:Array = new Array();
myXML.onLoad = function() {
aNode = this.firstChild.childNodes;
len = aNode.length;
for (var i=0; i<len; i++) {
obj = {}
obj.xpos = aNode*.attributes.xpos;
obj.ypos = aNode*.attributes.ypos;
map.push(obj);
dups(i);
}
};
function dups(i){
duplicateMovieClip(_root.button, “knop”+i, i+1000);
ref = _root[“knop”+i];
ref._x = map*.xpos;
ref._y = map*.ypos;
trace(map*.xpos);
trace(map*.xpos);
};