I wrote a nice little game which works well in its .fla form. Because I wanted to include some menus with options, saves, etc, I followed the advice from http://www.actionscript.org/resources/articles/965/3/Better-Flash-Navigation-using-AS3-Classes/Page3.html I managed to get navigation from the menus right, but I really don't know what to do with the contents of my fla. Ideally, I think that it should sit in a class on its own (called Game.as) which if you looked at the link above would be linked from the Main.as (which is the linked class [that navigates the menus] from the main .fla file which holds all the assets). Am I right to think that the constructor class in Game.as would be very similar to an init() function in my .fla file ? In which case, the rest of the code for the game would be separate functions (called methods for classes, right?) stored outside the constructor. Or am I completely wrong and the game should not be in class on its own but instead sitting inside the Main.as because this very class is linked to the original .fla where all the assets are? All I need is a little nudge in the right direction because I can't find this info in any of my books and I don't know how to phrase it for google. Thanks in advance. Nik
You need to Export all the MovieClips and assets you want to access from classes in your FLA file. Open the properties of your MC or Bitmap and mark the export and write the package name into it.
http://www.flashandmath.com/howtos/as3link/
To the rest:
Every object is another class. This is object oriented programming. Your Menu is a class, your menu items are different classes. Your game is a class, your game items are different classes and so on.
With this you can create a class hierarchy and can "load" items you need at the specific situation.
http://www.adobe.com/devnet/actionscript/articles/oop_as3.html
Am I right to think that the constructor class in Game.as would be very similar to an init() function in my .fla file ? In which case, the rest of the code for the game would be separate functions (called methods for classes, right?) stored outside the constructor.
Yeah, you're right.