I have a list of links and what I am trying to create is an effect that when
your mouse moves over the link it will scale up and the other links will move.
I have this script, but I am unsuccessfull in making it work correctly, the
buttons all insert but the animation is not working properly. Please Help.
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);
//k
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]});
}
>> Stay informed about: Zooming Icons