Understanding the Role of Methods in ActionScript 2.0

 <  Day Day Up  >  

Understanding the Role of Methods in ActionScript 2.0

ActionScript has had a very interesting and unique history. It started in Flash 4 as a procedural language with limited syntax and functionality. It is now an object-oriented language that is similar to Java and known as ActionScript 2.0.

N OTE

There are many functions and methods with the same name in ActionScript 2.0; for example, there is both a gotoAndPlay function in ActionScript 2.0 as well as a gotoAndPlay method of the MovieClip class. To maintain backward compatibility, Macromedia will usually not remove old functionality.


ActionScript 2.0 is utilized by both designers and developers and these two audiences have very different needs. For example, when a designer uses a gotoAndPlay method on the main timeline, there is no need to instantiate an object because the main timeline is always instantiated . A developer may also create a user -defined function in ActionScript 2.0 on the main timeline; this is really a method of the main timeline object. As we will see throughout this book, it can be inefficient to attach code to timelines , and in many cases, pure class-based development can make more sense because it makes sense to include methods as parts of classes.

 <  Day Day Up  >  


Object-Oriented Programming with ActionScript 2.0
Object-Oriented Programming with ActionScript 2.0
ISBN: 0735713804
EAN: 2147483647
Year: 2004
Pages: 162

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net