Flash Components      Flash Menu      Flash Gallery      Flash Slideshow      FLV Player      Flash Form      MP3 Player      PhotoFlow      Flash CMS      3D Wall      Flash Scroller

Flash / AS

Silverlight

WPF

ASP.net / PHP

Photoshop

Forums

Blog

About

 


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

 

 

 

 


AS1 OOP: Prototypes
         by senocular  

Encapsulation
The idea of encapsulation is that objects are “self contained” and the processes and properties of their inner workings should not be exposed in their use. This lends to the idea of objects being little black boxes.

The little black box is the solve-all solution to your problems. No one really knows how one works, it just does. In goes your problem, out comes the solution. There has been much talk recently about the little black box for home entertainment systems – the all-in-one VCR/DVD/DVR/cable/stereo/video game system/whatever. As a consumer, you won’t need to know how it works internally, just that it does work and it does everything for you that you would ever need in a home entertainment system. One of the ideas of OOP is to have little black box objects that do what they need to do without the developer having to worry about how it does it.

Also, as a developer, you would want to tamper-proof your object definitions so other people (or even yourself for that matter) can’t get into the inner workings of such objects and throw a wrench in the gears thus possibly causing problems in functionality. You want objects to be self- contained, portable entities that function as they should when they should without worry of failure (which is important in portability – the ability to move your object classes from one project to the next).

Some programming languages offer means to protect interior class workings giving you the ability to define public and private properties and methods. Public values are those readily accessible from an instance of a class – those which are supposed to be used to operate the instance. This would be the remote control to your black box home entertainment center. The remote represents you, the viewer’s, control. It doesn’t let you mess with resister 5A inside the box, but it does provide you with an interface for using the box. These equate often to method functions. Private values are those which are not accessible accept from within the inner workings of that object. This includes that 5A resister and anything else in the box that makes it work but the viewer isn’t supposed to know or mess with.

Sadly, Actionscript 1.0 does not support public or privately defined properties or methods. In Actionscript everything is public and openly accessible. It can be seen as a good thing as it does give you more control. However, in terms of being an OOP language, it’s a hindrance. They don’t call it Flash Actionscript for nothing; it’s really exposed. Thank you, thank you. I’m here all night.

 

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 menus, buttons and components Digicrafts Components
The best flash components ever! Entheos Flash Website Templates
Upload, publish, deliver. Secure hosting for your professional or academic video, presentations & more. Screencast.com Purchase & Download Flash Components
flash components Free Website | Make a Website
Learn how to advertise on kirupa.com