Hey guys,
I have this for loop that gradually scales in masks over a series of images and im trying to figure out how to randomly scale in the masks instead of based on their instance name. I know theres a way to do it using Math.random but have no idea how…
//function starts tiles animations
function tiles_start(clipName) {
clipName = eval(clipName);
clipName.copyName.alphaTo(100,.5,“linear”);
// loop animates masks based on instance name
for (i=1; i<28; i++) {
if (i<=5) {
clipName.collage[“clip”+i].scaleTo(100,2,“easeOutExpo”);
} else if (i>=5) {
clipName.collage[“clip”+i].scaleTo(100,4,“easeOutExpo”);
} else if (i>=10) {
clipName.collage[“clip”+i].scaleTo(100,6,“easeOutExpo”);
} else if (i>=15) {
clipName.collage[“clip”+i].scaleTo(100,8,“easeOutExpo”);
} else if (i>=20) {
clipName.collage[“clip”+i].scaleTo(100,10,“easeOutExpo”);
}
}
}
//function returns masks to original state and sets copy to zero
function tiles_return(clipName) {
clipName = eval(clipName);
clipName.copyName.alphaTo(0,1,“linear”);
for (i=1; i<28; i++) {
if (i<=28) {
clipName.collage[“clip”+i].scaleTo(0,1,“easeOutExpo”);
}
}
}
Thanks!