# as1 to as2

**URL:** <https://forum.kirupa.com/t/as1-to-as2/185646>\
**Category:** flash\
**Created:** [April 14, 2006, 10:26pm UTC](https://forum.kirupa.com/t/as1-to-as2/185646 "2006-04-14T22:26:49Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![rodrigobellao](https://avatars.discourse-cdn.com/v4/letter/r/4da419/32.png) [@rodrigobellao](https://forum.kirupa.com/u/rodrigobellao)\
**Post date:** [April 14, 2006, 10:26pm UTC](https://forum.kirupa.com/t/as1-to-as2/185646/1 "2006-04-14T22:26:49Z")

</div>

hi there, i´m trying to convert the following code to action 2.0. when i use this with flash player 6 and as1 it works fine. i´m studing the logic of this code, but i know very little about as1. can anyone help me? i think the problem is with de scope of some variables. i don´t know.

- i already changed the lmc class to the last version. the link for the fla is [http://laco.wz.cz/tween/?page=examples](http://laco.wz.cz/tween/?page=examples). the file is [rollover zooming icons](javascript:showswf(‘zooming\_icons’,700,300))

#include “lmc\_tween.as”  
//  
init();  
function init() {  
timeline = _root;  
iconlinkage = “smallIcon\_mc”;  
squarecount = 34;  
maxcolumns = 8;  
//  
x\_border = 2;  
y\_border = 22;  
//  
leftbound = 50;  
topbound = 50;  
//  
maxScale = 300;  
normalScale = 100;  
//  
icons = [];  
for (var i = 0; i\<squarecount; i++) {  
var ico = timeline.attachMovie(iconlinkage, "ico_"+i, i);  
var idx = i%maxcolumns;  
var idy = Math.floor(i/maxcolumns);  
//  
ico.sx = ico.\_x=leftbound+(idx)_(ico.\_width+x\_border);  
ico.sy = ico.\_y=topbound+(idy)_(ico.\_height+y\_border);  
//  
if (icons[idy] == undefined) {  
icons[idy] = [];  
}  
ico.idx = idx;  
ico.idy = idy;  
ico.label = i  
ico.onRollOver = function() {  
scaleIcon(this, maxscale);  
};  
ico.onRollOut = function() {  
scaleIcon(this, normalscale);  
};  
//  
icons[idy][idx] = ico;  
}  
}  
//  
function moverows(idx, idy, mc) {  
var i = 0;  
while (i+idx\<maxcolumns) {  
i++;  
icons[idy][idx+i].\_x = mc.\_x+x\_border+mc.\_width+(i-1)\*(icons[idy][idx+i].\_width+x\_border);  
}  
}  
function scaleIcon(mc, endScale) {  
mc.scaleTo(endScale, .3, “easeoutback”, 0, {updfunc:moverows, updscope:\_root, updargs:[mc.idx, mc.idy, mc]});  
}

thanks everybody
