Categories
Featured jobs
» More ActionScript, Flash and Flex jobs.
» Advertise a job for free
Our network
Advertisement

 »  Home  »  Tutorials  »  Flash  »  Beginner  »  Using Document Classes in Flash CS3 Professional

Using Document Classes in Flash CS3 Professional

By Alpesh Vaghasiya | Published 12/31/1969 | Beginner | Rating:
Alpesh Vaghasiya

work in flash base company, Have a experience in Flex and ActionScript programming, Flash, Adobe AIR and love to do programming in ActionScript 3.0

 

View all articles by Alpesh Vaghasiya
Create Simple Hello Application Using Document Classes

Let's Get Started

Open Adobe Flash CS3 Professional.

You will be see welcome screen from that selected Flash File (ActionScript 3.0) becasue we are write our action script code in 3.0. if you want to write your code in ActionScript 2.0 then you have to select Flash File (ActionScript 2.0). see in below figers..


Press CTRL + S or File -> Save for save you file.When you click on save menu or press CTRL + S at that time one windows open and give name file as helloworld.fla. your fla file save name as helloworld.fla. see in below figer.



Let's Create helloWorld.as Classes. which we will link with document class.
press CTRL + S or File -> New one Windows will open from that select ActionScript File. see below figer.


Enter Following Code.

Line

Description

1

This indicate that the following is a package of codes/functions defining a class. Just remmeber to type it in the first line.

3

Import the class MovieClip into the program for later use.

5

Define the main class of this file: helloWorld. Note that the file name and class name must be the same.
public means that the class can be called from outside (we will come back to that later).
extends MovieClip means that our class will be built based on the class MovieClip.

7-9

Define the main function of that class. Note that this function name is same as the class name, i.e. helloWorld. This function will be executed for sure. Remmeber to add ( ) behind the function name.

8

Output something to the output window of the Flash IDE.


How to make it run?

Now come to back helloworld.fla, and see that property of stage. see below figer. you will be find document class see below figer. in that document class you have to give class name which you have to attach with that fla. see below figers.


Now let's test fla with CTRL + ENTER or Control -> Test Movie. you will see one windows with winodws. and in outup winodws you will be find Hello! which we write in trace statemen. it's mean that when you test helloworld.fla at that time it's link with class helloWorld.as. see below figer.


How would you rate the quality of this article?
1 2 3 4 5
Poor Excellent

Verification:
Enter the security code shown below:
img


Add comment

Spread The Word / Bookmark this content

Clesto Digg it! Reddit Furl del.icio.us Spurl Yahoo!

Comments
  • Comment #1 (Posted by kayes - dider7 at hotmail.com)
    Rating
    The convention for class naming is to capitalize the first letter of each word of a class name.
     
Submit Comment



Search Entire Site
Add to Google
Advertisements
Article Options
Latest New Articles
Set up a simple IIS Server for Flash
by Peter McBride

Day 1 at FITC Toronto 2008
by Anthony Pace

Simple reflection effect with AS2
by Jean André Mas

ActionScript.org Meets Josh Tynjala (aka dr_zeus)
by ActionScript.org Staff

Rapidly Create Online Flash Movies to Help Users Market, Sell and Support Software and Hardware
by Sabrina F

mailing list
Enter your email address:
mailing list
Subscribe Unsubscribe
© 2000-2007 actionscript.org! All Rights Reserved.
Read our Privacy Statement and Terms of Use...
Our dedicated server is hosted and managed by WebScorpion Webhosting.