A Flash Developer Resource Site

Results 1 to 1 of 1

Thread: Converting from AS 2.0 to AS 3.0

  1. #1
    Registered User
    Join Date
    Jun 2012
    Posts
    3

    Converting from AS 2.0 to AS 3.0

    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[i].attributes.xpos;
    obj.ypos = aNode[i].attributes.ypos;
    map.push(obj);
    dups(i);
    }
    };

    function dups(i){
    duplicateMovieClip(_root.button, "knop"+i, i+1000);
    ref = _root["knop"+i];
    ref._x = map[i].xpos;
    ref._y = map[i].ypos;
    trace(map[i].xpos);
    trace(map[i].xpos);
    };
    Attached Files Attached Files

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center