NAVIGATION:

 

SUPPORTERS:

FlashComponents
  Flash Templates
  Flash Gallery
  Flash Slideshow
  Flash Menu
  Flash Design
  Flash Video
  User Interface

 

FOLLOW:

RSS it down! Twitter it up! Facebook it like a fiend!

 

 

 

 

 
AS2 OOP: Class Structure
         by senocular  

Introduction
To learn classes all over again. Just when you thought you had it straight with ActionScript 1.0, Macromedia goes and does a thing like this. It's not as bad as it seems though. This new method of defining classes with ActionScript 2.0 can actually be easier than with ActionScript 1.0. That is, once you get past the fact that each class needs to exist in its own file (that can be hard to get used to). If you've already been doing this using #include, though, it may not be a big deal.

Whenever a class is defined with ActionScript 2.0, it gets its own .as (ActionScript) file. These .as files for classes can only have one class per file and need to have the same name as the class being defined within. For example, if you were defining a Plane class, its definition, including all its variables and methods, would be included in a Plane.as file. This may seem a tedious process at first, but its another step in maintaining organization and improving your coding practices. The advantages are less apparent in smaller projects. But with the bigger ones, you'll definitely see a difference.

Within these files goes the code that basically defines ActionScript 2.0. Elsewhere, such as within your main movie, you're still pretty much still dealing with ActionScript 1.0, or at least its familiar syntax. ActionScript 2.0, however, is the language for writing classes. So let's see how that works.

 

 

 

SUPPORTERS:

kirupa.com's fast and reliable hosting provided by Media Temple. flash components
Creative web apps. Make your own free flash banners and photo slideshows.
Buy or sell stock flash, video, audio and fonts for as little as 50 cents at FlashDen.

Flash Transition Effects

Flash Effect Tutorials

Digicrafts Components Flash effects. Art without coding.
Upload, publish, deliver. Secure hosting for your professional or academic video, presentations & more. Screencast.com Flipping Book - page flip flash component.
Flash-Gallery.com - Get your flash photo gallery (flash component or swf gallery Citrus Engine: Flash platformer and sidescrolling game engine
Learn how to advertise on kirupa.com

cdn
content delivery network (cdn)