First time here? First time here? Newsletter Signup Newsletter
Search tutorials
Author: Aditya Sharma aka adit_ya_sharma | Website: http://www.ctoffakes.tk

Circle Example

For explaining classes let's take a simple example of moving a circle to the right when the Right Arrow key is pressed. First task is to make a simple .fla document and a movieclip:- 1)Open your main flash program (which Iam hoping by now should be flash mx 2004 or higher) and create a new flash document(.fla). 2)Create a simple circle with the circle drawing tool and select the circle. 3)After selection, press F8 and select Movieclip and press ok to make it a MovieClip. 4)Look for the movie library, if it's not open then press Ctrl+L to open it. 5)Right click your circle MC(MovieClip) and then click on the 'Export for actionscript' radio button. 6)In the AS 2.0 class and in the instance name fields, write 'Circle' (without quotes, duh). 7)Select its properties and give it an instance name "circle_mc" (again, without the quotes). 8)Save your document for now, we will come back to it later.
Note: Be sure that of the case that you use in the MC instance, class name and file name, correctly. Here Iam using 'Circle' with an uppercase 'C' in the beginning.
Next we will take a look at the .as file creation and creation of the 'class' inside it...
» Level Intermediate

Added: 2005-10-12
Rating: 7 Votes: 9
» Author
Iam a flash actionscript programmer.
» Download
Download the files used in this tutorial.
» Forums
More help? Search our boards for quick answers!
Featured Flash FLA
» Author: Inocreato
» Title: RaiseTheBlocks
» Description: Raise all the blocks to win the game
Featured Sound Loops
Image for equalize

Audio Player

» Author: TomCat Carty
» Title: The Wood
» Description: Just a little game ending or it can maybe be looped. Recorders with music box and percussion to give the feel of well, I don't know, the woods? Free to use, just credit me. thank you
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: Davisigner
» Description: Hmm... what to say about this one? It's reminiscent of the closing notes of the opening music from the Three Stooges done in a church organ style with a closing cymbal crash. I'll give this one away gratis, but feel free to check out my free loops and potential upcoming license-mandated ones over in the respective part of Flashkit.