A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: things i need to know about class

  1. #1
    Junior Member
    Join Date
    Jun 2004
    Location
    Kwait
    Posts
    21

    things i need to know about class

    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
    :]

  2. #2
    a.k.a gltovar deadlock32's Avatar
    Join Date
    May 2001
    Location
    Naperville,IL
    Posts
    489
    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:

    PHP Code:
    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.

  3. #3
    Professional Flash Developer
    Join Date
    Aug 2007
    Location
    California
    Posts
    105
    I created just such a tutorial and it is live on my site right now:
    http://www.8bitrocket.com/newsdispla...?newspage=5905

    It is far too long to post here.

  4. #4
    Multitouch Aficionado
    Join Date
    Mar 2006
    Posts
    275
    Read Keith Peters' book (linked above). It's only $20 and it's fantastic.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center