I’m trying to target a .swf that I loaded into a movie clip (mc_container) but it seems like I’m missing something. Can you take a look and see where I went wrong?
mc_container.loadMovie("mc_photoSwap.swf");
//homepage Animation Swap Images
function photoSwapAni(){
switch(random(3)){
case 0:
_root.mc_container.gotoAndPlay("ani_1");
trace("case 0");
break;
case 1:
_root.mc_container.gotoAndStop(50);
trace("case 1");
break;
case 2:
_root.mc_container.gotoAndStop(100);
trace("case 2");
break;
}
}
var intervalID:Number = setInterval(photoSwapAni, 2000);
Also I see I’m going to have an issue with the random part because it could call the same animation twice or more times in a row. Should I ad some sort of if statement or is there a better way to do this random part of the code?