Some AS3 Constants

This is nice. We now have some constants that we can use instead of “magic strings”. What I mean, is that we have something kin to pre-made Enums for some common values in AS3.

At this moment, I think they’re actually static public const’s, not real Enums. So, I think that these flash classes just have something like this declared:

static public const EXAMPLE:String = "example";

(This is confirmed here.)

Nonetheless, they are a welcome sight (if they were in AS2, I never knew it.) Here are just a few examples. There are others that are easy enough to find with a little “code assist” searching.

flash.display.StageScaleMode
flash.display.GradientType
flash.events.MouseEvent
flash.events.KeyboardEvent
flash.events.FocusEvent
flash.events.DataEvent
flash.events.Event
     (well, you get the point.  there are more of these flash.events.XXXXX.)
Math

 
 
 

Leave a Reply

You must be logged in to post a comment.