Join Todd Perkins for an in-depth discussion in this video Using static constants, part of Flash CS4 Professional: Object-Oriented Programming .
In this movie we're going to look at creating static constants. A static…constant is basically the same thing as a static variable except for it doesn't…ever change. So it's connected to a class, but it's unchangeable. Static…constants are typically used with events. I'm going to jump over to my TV class…here and I'm going to create a new public static constant and here's the…syntax, public static, and instead of var you're going to type const, short for constant.…
Let's say that this is going to represent an event. So let's say we add an…event called channel change. So I'll call this CHANNEL_CHANGE, notice that I'm…typing in all caps. It's not something you have to do for a static constant,…but it is what Flash does for all of its static constants. So you think of…mouseEvent.CLICK. Click is a static constant, it's in all caps. event.COMPLETE,…Complete is a constant and it's also in all caps.…Flash also separates words with underscores. I'm just following what Flash does…here to make it easy for me to remember the casing that I use for my static…
- Loading external text, images, and XML files
- Creating essential properties for a View class
- Defining a Model class
- Building and implementing interfaces and designs
- Debugging projects
- Building applications with Controller-class buttons
Skill Level Intermediate
1. ActionScript 3.0 Essentials
2. Advanced ActionScript Techniques
3. Object-Oriented Programming Fundamentals
4. The Model View Controller Design Pattern
5. Building a Model Class
6. Building a View Class
7. Building a Controller Class
8. Improving and Debugging the Application
9. Moving Forward
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.