First time here? First time here? Newsletter Signup Newsletter
651326 Members and growing! | Flash Jobs
Search tutorials
Author: Aditya Sharma aka adit_ya_sharma | Website: http://www.ctoffakes.tk
Most programmers like me who have been thinking of moving on from Actionscript 1.0 to 2.0 better know the new basis of the language, which includes strict data typing and use of classes. In this simple tutorial, I'll give you the basic introduction to classes and a easily understandable example for observing the functioning of it when applied on a MovieClip. Iam assuming that the reader has an 'Intermediate' actionscripting knowledge and fundamental programming concepts (functions, variables etc).

Quick Introduction

Q)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

Added: 2005-10-12
Rating: 7 Votes: 9
(10 being the highest)
» Author
Iam a flash actionscript programmer.
» Download
Download the files used in this tutorial.
» Forums
More help? Search our boards for quick answers!

Comments

  • There are no comments yet. Be the first to comment!

  • You must have javascript enabled in order to post comments.

Leave a Comment
  • Your email address will not be published. All fields are required.
Featured Flash FLA
» Author: work2survive
» Title: Girl Walking 1kb
» Description: Walking girl, animation just takes 1kb, using high heels shoes, and fashion model attitude.
Featured Sound Loops
Image for equalize

Audio Player

» Author: BoxCat
» Title: CPU Talk
» Description: From the cyberpunk RPG, "Nameless: the Hackers" Completely Free to use! Keywords: edm hip hop rap electronic mysterious mission hacking chase exciting spy ios ambient chilling love happy sad angry suspense
Latest Font
» Author: Fábio FAFERS
» Description: I created this font for free use. Everyone can apply it in personal or business texts. Its free, but I want to be communicated in case of business use. Donations are accepted to keep the project of free fonts alive! Thank you all
Featured Sound Fx
Image for equalize

Audio Player

» Author: nathan
» Description:

A recorded sound of the Dimensional Fork Gate.