Home Tutorials Forums Articles Blogs Movies Library Employment Press

Go Back   ActionScript.org Forums > Flash General Questions > Flash 10 General Questions

Reply
 
Thread Tools Rate Thread Display Modes
Old 08-08-2011, 10:45 PM   #1
puratu
Registered User
 
Join Date: Nov 2006
Posts: 7
Default 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);
puratu is offline   Reply With Quote
Old 08-10-2011, 11:37 PM   #2
nyr68j
CGT Student
 
Join Date: Jul 2009
Location: Dundee
Posts: 48
Default

If you want me to help try and convert it you'll have to give a larger extract of the code because not all the variables are listed and I'm not even sure what the desired result of the code is. So if it's part of the function (as it looks like it's part of a for loop) post the function and I can probably manage to make convert it to an as3 format
nyr68j is offline   Reply With Quote
Old 08-11-2011, 09:14 AM   #3
puratu
Registered User
 
Join Date: Nov 2006
Posts: 7
Default

thanks for reply
here is the code
ActionScript 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); }
puratu is offline   Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 07:37 PM.

///
Follow actionscriptorg on Twitter

 


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2013 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.