Quick IntroductionQ)What are classes? A)If you have been familiar with OOP languages like C++ or Java, then you might be quite familiar with this term. Classes are body of codes, which are used in a modularized fashion in a program, which enables the reusability of a part of the code. Classes (in AS 2.0 context) always contain a constructor and various function bodies (known here as methods)if required, for either getting a value or returning a value, or both. In AS 2.0 classes are defined in a seperate .as file, which should have the same name as the class, and then an object of the class is made in the .fla actions. Q)What are objects? A)Objects are a reference to the class for which they are defined. The synatax in which they are defined in AS 2.0 in the main frame actions is:-
var objName:className = new className([parameters]);Now we will see the example and coding...
|» Level Intermediate|
Rating: 7 Votes: 9
|Iam a flash actionscript programmer.|
|Download the files used in this tutorial.|
|Download (0 kb)|
|More help? Search our boards for quick answers!|