Hi,
I read up a bunch of vars and pop them in arrays to use in a series of if statements. That works fine. Right now I have a fixed number of items so I can just write the code below.
How could I set this up to work so that it could deal with any number of items in the arrays.
The length of all the arrays will always be the same.
It could even be one array I think, as items could be fed in in order.
Thanks in advance, Mark
PHP Code:
addEventListener(Event.ENTER_FRAME, loop);
function loop(e:Event):void {
if (this.currentFrame==1) {
if ((videomask_mc.height != vidHeightArray[1]) && (_ds.time >= startPoint[1]) && (_ds.time < endPoint[1])) {
TweenMax.to(videomask_mc, .5, {height:vidHeightArray[1]});
TweenMax.to(video, .5, {y:vidBase - topCropArray[1]});
TweenMax.to(controller_mc, .5, {y:masky + vidHeightArray[1]});
}
if ((videomask_mc.height != vidHeightArray[2]) && (_ds.time >= startPoint[2]) && (_ds.time < endPoint[2])) {
TweenMax.to(videomask_mc, .5, {height:vidHeightArray[2]});
TweenMax.to(video, .5, {y:vidBase - topCropArray[2]});
TweenMax.to(controller_mc, .5, {y:masky + vidHeightArray[2]});
}
if ((videomask_mc.height != vidHeightArray[3]) && (_ds.time >= startPoint[3]) && (_ds.time < endPoint[3])) {
TweenMax.to(videomask_mc, .5, {height:vidHeightArray[3]});
TweenMax.to(video, .5, {y:vidBase - topCropArray[1]});
TweenMax.to(controller_mc, .5, {y:masky + vidHeightArray[3]});
}
}
}