At 11/23/05 03:21 PM, Glaiel_Gamer wrote:
AS: Little Tricks and Tidbits!
Feel free to add your own little-known AS tricks to this thread.
The ?: Operator
How it works:
Can be very useful for short if statements. If there is no else part, use
Since "null" is too much for a nothing for me, I use 0 instead. The very same effect, but 75% shorter.
And yes, prototype is the second most-owning thingie in Flash (first are custom, registered classes). Got tired of gotoAndStop reloading frames? Use MovieClip.stopAt(frame):
The () are indeed needed (at least in Flash MX -6-, dunno MX 2004 -7-), or else it would check only the truth of the second part of the equality; so, if someFrame!=0, the ? would return true, whatever the _currentframe is.