Keith130
August 1st, 2003, 12:01 PM
The following actionscript is some that I got from lostinbeta from an alpha fade question I had, that works fine but I now would like to have the movieclips get smaller at the same time as fading. So I put in some code that went like this
//set the transform
mc._xscale = (i*10);
mc._yscale = (i*10);
That worked but the duplicated MC's are all pointing to the starting point of the main "Ball" MC. I dont know how to fix it, as usall. Here is the bulk of the code :
//define variable to hold how man clips there should be
var i = 20;
//put original clip on top of all duplicated clips
ball.swapDepths(i);
//create function to add multiple balls
function addBall() {
//if variable i is greater than 0
if (i>0) {
//decrement it by 1
i--;
//duplicate the ball clip
mc = ball.duplicateMovieClip("ball"+i, i);
//set the alpha
mc._alpha = (i*10);
//transform script here ?
} else {
//else if variable i isn't greater than 0
//clear the interval (stop running this function)
clearInterval(myInterval);
}
}
//set the interval and call the addBall function every 15 milliseconds
myInterval = setInterval(addBall, 15);
//set the transform
mc._xscale = (i*10);
mc._yscale = (i*10);
That worked but the duplicated MC's are all pointing to the starting point of the main "Ball" MC. I dont know how to fix it, as usall. Here is the bulk of the code :
//define variable to hold how man clips there should be
var i = 20;
//put original clip on top of all duplicated clips
ball.swapDepths(i);
//create function to add multiple balls
function addBall() {
//if variable i is greater than 0
if (i>0) {
//decrement it by 1
i--;
//duplicate the ball clip
mc = ball.duplicateMovieClip("ball"+i, i);
//set the alpha
mc._alpha = (i*10);
//transform script here ?
} else {
//else if variable i isn't greater than 0
//clear the interval (stop running this function)
clearInterval(myInterval);
}
}
//set the interval and call the addBall function every 15 milliseconds
myInterval = setInterval(addBall, 15);