A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: actionscript 1 to actionscript 3 conversion

  1. #1
    Junior Member
    Join Date
    Apr 2007
    Posts
    9

    actionscript 1 to actionscript 3 conversion

    hi
    I am trying to convert this code from as1 to as3
    any help would be appreciated
    occ = ((dec=new String("000000").substr(0,7-(dec=(unescape(map[0]).charAt(int(i/7)).charCodeAt(0)-1).toString(2)).length)+dec).charAt(i%7)==1);

  2. #2
    AS2 intolerant person
    Join Date
    Jan 2009
    Location
    Swansea
    Posts
    352
    ok i had a go, but there are other variables in the algorithm which I have no idea what they are for. so can you show some of the previous code and explain what this code is meant to do please?

    flos

  3. #3
    Junior Member
    Join Date
    Apr 2007
    Posts
    9
    sth like this

    Code:
    (o = this.createEmptyMovieClip( "point" , 0 )).lineStyle(7,0xffcc00)
    o.moveTo(4,4)
    o.lineTo(4.5,4);
    map= new String("%C2%80%C2%80%C2%80%C2%80A%02A%02%5F%7E%60%3ESFR%26%5F%7E%60%3EA%01%01%02%5Fp%7C%3E%5Fp%7C%3EAbD%02%7F%7E%60%40%03%7E%60%21%03a%04%21%03o%3C%21%7Fo%3C%40%01%0D%19%01%7Fp%7C%40%03p%7C%21%03a%04%21%03p%7C%21%7Fp%7C%40A%02A%02%5F%7E%60%3E%5F%7E%60%3EG%01%012wp%7C8wp%7C8AbD%02%60%7E%60%7E%60%7E%60%7EA%01%01%02%C2%80%C2%80%C2%80%C2%80,%01%01%01%01%40%7F%40%7F%22%03%21C%22%03%21C%22%03%21C%40%C2%80%C2%80%7F%22%11%05C%22%11%05C%40%1F%3D%7F%02%01%01A%02%01%01A%02%01%01A%02%01%01A%02%01%01A%02%01%01A%02%01%01A%02%01%01A%02%01%01A%02%01%01A%02%01%01A%40%7F%40%7F%22%03%21C%22%03%21C%3A%7F%40O%0A%11%05I%0A%11%05I%40%1F%3D%7F%21%03%21%03%21%03%21%03%40%C2%80%C2%80%7F%01%01%01%01").split(",");
    for ( var i = 0, eats = 0 ; i < 28 * 31 ; i++ ) {
    	occ = ((dec=new String("000000").substr(0,7-(dec=(unescape(map[0]).charAt(int(i/7)).charCodeAt(0)-1).toString(2)).length)+dec).charAt(i%7)==1);
    	eat = ((dec=new String("000000").substr(0,7-(dec=(unescape(map[1]).charAt(int(i/7)).charCodeAt(0)-1).toString(2)).length)+dec).charAt(i%7)==1);
    	new Color(o.duplicateMovieClip("t_"+i,++d,{_x:(i%28)*8,_y:int(i/28)*8,occ:occ})).setRGB(occ?0xee9933:0x0);
    	if(eat)new Color(o.duplicateMovieClip("e_"+i,++d,{_x:(i%28)*8+2,_y:int(i/28)*8+2,_xscale:50,_yscale:50,onUnload:function(){if(!(--eats)){trace( "CONGRATULATIONS! LEVEL COMPLETE!");gameover=true;}}},eats++)).setRGB(0x00ff00);
    }
    Last edited by puratu; 08-10-2011 at 05:46 AM.

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