Is there a performance(or efficiency) difference between these two examples:
//update function
if(a == 2){
this.gotoAndStop(2);
}
vs
//update function
if(a == 2 && this.currentFrame != 2){
this.gotoAndStop(2);
}
Both examples would be tied to an ENTER_FRAME event. In example 1, the block is always setting the frame to 2, but example 2 only sets the frame to 2 if the condition is met and if it is not already at 2.
Is there a difference between constantly applying an effect and only doing it once if?