;

PDA

Click to See Complete Forum and Search --> : things i need to know about class


albisher
08-04-2007, 06:49 AM
please please please

i am not a good programmer .. but i like to learn

as previous flash releases i was getting around using external .as file

and now it seems to be an advantage to do such thing....

1- is there any beginner,step by step, class tutorial (please point me to it)
2- how to build a simple class?
3- how to use it inside my .fla?
4- can i import class from some related folder? refrence is .swf?
or from my website?


thanks in advance
:]
:thumbsup:

deadlock32
08-05-2007, 01:02 AM
dude i know almost exactly how you feel except I have been using flash for a while so I decide to pick up an advance flash actionscript 3 book... big mistake. While I understood EXACTLY what the code did... I didn't understand document classes... so I could not actually start any example.

Anyway

First off I'd like to recommend this book:
Foundation: ActionScript 3.0 Animation, Making Things Move! by Keith Peters:
http://www.friendsofed.com/book.html?isbn=1590597915

Any way the basics:
the most basic class if you are using Flash CS3 is called a Document Class.

If you opened up Flash and chose a new Actionscript 3 Flash file you will see on the bottom of the screen in the properties bar a input box that says 'DocumentClass'

Save this empty flash in a directory of you choice.

next (with out closing that flash) click file and create a new document, this time pick Actionscript File.

Now you get a text editor to code in. Save this blank document in the same directory as your flash and name it 'DocumentClass'

now go back to the tab with your flash file and type in the name of the AS file you just created. Just so you know just because it will be the document class for this flash file does NOT mean it has to be named DocumentClass.

Go back to the AS file and start typing this in:


package
{
public class DocumentClass
{
public function DocumentClass():Void
{
trace("*groan* hello, world *sigh*");
}
}
}



make sure you save both files now. (and save any files that have changed before future testing)

Goto control and test move ([alt]+[enter])

your first cliche, I mean, actionscript 3 program.

8bitjeff
08-08-2007, 05:11 PM
I created just such a tutorial and it is live on my site right now:
http://www.8bitrocket.com/newsdisplay.aspx?newspage=5905

It is far too long to post here.

illustratedlife
08-08-2007, 07:05 PM
Read Keith Peters' book (linked above). It's only $20 and it's fantastic.