Flash / AS

Silverlight

WPF

ASP.net / PHP

Photoshop

Forums

Blog

About

 


FlashComponents
  Galleries
  Slideshows
  Menus
  Design & Effects
  Audio & Video
  User Interface
  Templates

 

 

 

 


AS1 OOP: Custom Object Classes
         by senocular  

Instances
The point of defining a custom class is to define what will ultimately be object instances of that class – the actual working object in which you use in Actionscript to contain data and/or add functionality to your movie. These instances are equivalent to the houses in the blueprint analogy. They’re the final product resulting from the deployment of the layouts provided from the blueprints of the constructor function. You can have as many instances as you want all from the same single class constructor – as many as you need to populate your Flash movie, or neighborhood if you will. Each instance created is then said to be an "instance of the class." House instances made from the House class are instances of the House class just as arrays are instances of the Array class.

Instances are really what you’re after with OOP. The idea is to develop a framework from which you would be able to create meaningful, functional, easy to work with object instances which help you get done whatever it is you need to get done in your Flash movie.

For example, arrays are instances of array objects. Arrays help you manage and handle variables and information. You use arrays because they offer a simple linear fashion of containing variables in a list. This list then has associated with it methods that let you handle this information – methods like push, shift, reverse, sort etc.. The Array class provides the ability for you to create these helpful objects. Using OOP you are then able to create your own foundation from which you are able to create your own custom instances with similar functionality, only their functionality will be as you specify and not limited to that which has been pre-defined for you in Actionscript. Then you will be able to reap the benefits of OOP.
 

Prev Page
 

kirupa.com's fast and reliable hosting provided by Media Temple. flash components
The Text Animation Component for Flash CS3
Check out the great, high-quality flash extensions. Buy or sell stock flash, video, audio and fonts for as little as 50 cents at FlashDen.
Check out our high quality vector-based design packs! Flash Effect Components

Flash Templates
CSS Templates
Dreamweaver Templates

flash menus, buttons and components
Digicrafts Components The best flash components ever!
Entheos Flash Website Templates Free Flash Page Flip
flash components Buy and sell FLAs at Ultrashock!
Upload, publish, deliver. Secure hosting for your professional or academic video, presentations & more. Screencast.com Purchase & Download Flash Components
Learn how to advertise on kirupa.com