Oh dear š This one really can mess up a game or application if you are publishing for Flash 6 player (or 7 in depending on coding restrictions), or at least have you stumped for a few minutesā¦..
Your mx.transitions.Tweenās can simply stop responding, or even better, your sprites dissappear (depending on the order the following occurs).
Hereās an illustrated problem:
This can occur in a purely AS2 (class based app), but Iām going to simplify it for now and put in some timeline based code. If you are using the Tween class to perform some animation, for example, I have a āball_mcā on stage. I use the following on the timeline:
import mx.transitions.Tween;
import mx.transitions.easing.Bounce;
attachMovie("ball_mc", "ball_mc", 1);
var t:Tween = new Tween(ball_mc,"_x",Bounce.easeOut,0,99,30,false);
t.start();
Works a treat. Now imagine Iām running some game, placing āballsā on screen at various incremental depths (Iām not using getNextHighestDepth() because its Flash Player 6), some how my depth counter gets to the magic 9876:
import mx.transitions.Tween;
import mx.transitions.easing.Bounce;
attachMovie("ball_mc", "ball_mc", 9876);
var t:Tween = new Tween(ball_mc,"_x",Bounce.easeOut,0,99,30,false);
t.start();
Now our ball dissappears, itās depth, overwritten. Seems that mx.transitions.OnEnterFrameBeacon uses depth 9876 for itās own, and no-one else can have it! Ar har har!
Oh well, another depth that needs to be checked on from time to time, put that one on top of the list that v2 components reserve when it comes to getNextHighestDepth() :p