well currently, I have this mask set up… and I set the mask if the numbers randomly evaluate correctly… I set the mask. Then if it evaluates false, it gets rid of the mask. The problem is that the first time through… the function works perfect… however when run again it doesn’t work. The code is placed on the first and only frame of an mc… and when I trace(this) it returns like _level0.instanceName the first time the function runs on all the mc’s however, the next time it runs this == undefined… I don’t understand that… Well I hope I explained it well, here is the code…
lightOn = function(){
var isItOn = Math.floor(Math.random()*5);
if(isItOn == 4){
trace(this);
this.light.setMask(dark);
lightOnInterval = setInterval(lightOn, 6000);
} else {
this.light.setMask(null);
}
}
lightOn();
lightOnInterval = setInterval(lightOn, 3000);