Flash Video Player

Constants

by admin on September 21, 2007 · 0 comments

in Advanced Actionscript 3, Flash CS3, Tutorials

After having seen the properties (variables inside an Actionscript 3.0 class), we can now introduce the constants.

The constants are a new characteristic implemented in the version 3.0. In fact, with the 2.0 they were not present.

For convention, they are declared using a name in capital letters so to understand at first sight that we are dealing with constants and not variables (properties).

We can define the value of a constant but we cannot modify it.

If we use more words as the constant name, it is of good rule to add an underscore in between the words.

Examples:
- Event.COMPLETE, COMPLETE is a constant of the Event class.
- MouseEvent.CLICK, CLICK is a constant of the MouseEvent class.

Let us look at it with even more examples…

Read more

Share This Post

Related posts

{ 0 comments… add one now }

Leave a Comment

You can use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="">

Older post: Passing variables from HTML

Newer post: Graphic patterns