Eloo Home about us
You are now at Eloo.VirtualReality.Flash Tutorials-


How to start this ActionScript Stuff?
-Make It Real!-

OOP

OOP is Object Oriented Programming. Although many places mark this topic for advanced flash ActionScript developers, I think it is still necessary to bring it up here. Because it will become easier and make sense to you about what you may be going to read in Flash Help document or the codes from others' works. However, due to the ultimate idea of this tutorial I'll just describe its concept and organization in Flash here. OOP is not a programming language, and it is a method of programming. Many programming language uses the logic of OOP, and ActionScript is not an exception, of course. ActionScript constructs a Flash Movie by building objects and objects. The number of objects in a Flash Movie can be very little, and also can be as much as those sands on the beach. At the same time, objects are something more than sands that they intelligent and organized or you can call them artificial life form.

In ActionScript1.0 and ActionScript2.0 both uses the logic of OOP, but a programmatic form of OOP was introduced by ActionScript2.0. Therefore, here we'll stand on the point of view of ActionScript2.0 to tell this Object Oriented Programming. Now, let's take a look at the illustration bellow.

An Illustration of OOP in Flash
OOP in Flash
How to look at this illustration of OOP in Flash?
  1. Can you recognize a common shape that exist in all places here?
  2. Can you see the word "class" here?
  3. Can you imagine what is the relation between those objects by their link connection?


So, the following is not going to be difficult, but need your focus. From the illustration above, those shapes of shallow cylinder appear four times in the picture present the objects. This "object" is still the same thing I've been mentioned previously. However, the new word you might notice is "class". Look carefully, although the top object is addressed as "class" (we call it is a class object), its shape is the same as other objects below it. Besides, those objects under the class object are all linked from the class object. The class object is in control of those other objects. Now, if we push this logic a little more forward, we can think of a class object is like the boss in a company. The boss and his staffs are all human. However, they have the difference of position. The boss makes rules for staffs to accomplish the project. This rule could be every thing, even includes how the staffs should behave like (ha!). Staffs follow the rules to behave (property), and follow the rules to do job (method). Afterward, the project will be done professionally, efficiently, and precisely.

"Class" is one of the new keywords brought together with ActionScript2.0 for introducing the OOP. In ActionScript1.0, a class object that we call it now didn't have special name for, still called object which constructs rules for other objects to obey. ActionScript2.0 takes this class object into a new level that separates it from others, and asks you construct this class object in an ActionScript file (as.). But! As I mentioned, in many places that they introduce OOP topic as an advance level, and this is also truth. For now, you don't need to worry about how to construct a class object. In fact, Macromedia Flash has built several nice class objects for you to use it, such as MovieClip class, Button class, Array class, TextField class (If you are curious about them, you can check out a nice index of ActionScript2.0 class from here http://www.visiblearea.com/visdoc/examples/mm/all/index.html).

This is the concept of basic OOP in Flash, and in the next section, we'll going to make some connection with the things we talked in the previous chapters.






--Index--
  
Project Log
New tips
(Jan 28th,2004)
Pass value of ASP querystring to FlashMovie rather useing loadVariables method.
Piano Chords Finder
(Oct 4,2004)
After a little tired of making flash for web, started making this music tool to entertain myself hee:)
New Tutorial
(Sep 19,2004)
Glad...Once I had topic about web programming. ActionScript is such a cute thing that gives designers so much imagination to explore.
player 3.0
(Sep 9,2004)
A new design from mp3 streaming player2.0, also add volume control.
Never imagine how you want to be creative.


Virtual Reality .What's new .Delphi .Asp   .Snippets&Resources .My articles
Flash Workshop .My Tutorials .My Tips .Feedback Log
Sound of Music .Latest works .My Compositions .My Performances
Color,Light,Visual What's new .Vector Art .Photo Fusion .My Stock
Physics .My Articles
Extras .Blog .Photo Album .Guestbook

Eloo Fiction Plant
Copyright 2004-2010©izlenim.com All rights reserved. 

- Last Update on: 25 December 2007 18:50:40 / Tuesday -