Thank you for you reply, ultraky2
I’m not using flash scenes. I should have never used that term to describe breaking up my code. I tried to use the word “screen” to define different a complete, logical chunk of the application. I’ll use the word “module” to describe that now.
A module could be considered similar to a flash “scene”, meaning that you could think of it as a separate entity within the application. This separation is only logical, though. So within the application you could have a module for drawing a picture, and another one for viewing that picture. You could think of the first module as a mini paint program, and the other one as a picture viewer. My goal is to have the drawing module and the viewing module (a gallery, maybe) as separate SWFs which are loaded on demand by a base SWF (whose purpose would basically be to load theses things and manage them while they live).
ultraky2, I actually have an abstraction in my framework which is an MVC subsystem. This very subsystem is what I’m trying to break down. So there’s something like:
<root_dir>/
framework_code/ <-- handles general, environment stuff.
modules/
controller/
model/
view/
Under the modules directory lives an MVC subsystem. The application that I’m actually creating is a video game, an RPG. So, to give concrete example: You could fight monsters in different locations. So you’ll randomly be walking in a town, and encounter a monster to fight. You’ll enter a little ‘Screen’ where you’ll be fighting that monster. So there will be different maps, different battle grounds, among other things. There will be a controller for each different module type. So there will be a controller that handles town maps, a controller that handles battle grounds, and so on. There will be many views for each controller (so many to 1 relationship). The models will be shared among all views.
modules/
controller/
town_map.as
battle.as
models/
views/
town_map/
icy_town.as
water_town.as
battle/
cave_battle.as
desert_battle.as
In this example, which is a real one that I have working, but which is not broken up into multiple SWFs, there are 4 modules (currently this thing is compiled into 1 swf):
- town_map -> icy town (consist of the town_map controller, the icy_town view, and makes uses of possibly all models)
- town_map -> water_town (consist of the town_map controller, the water_town view, and makes uses of possibly all models)
- battle -> cave_battle (consist of the cave_battle controller, the cave_battle view, and makes uses of possibly all models)
- battle -> desert_battle (consist of the desert_battle controller, the desert_battle view, and makes uses of possibly all models)
It’s simple to see the benefits of breaking this thing into multiple SWFS: less loading, proper code containment, among others.