Ah, this is the process of what I am working to achieve:
Before anything visual appears- 1. Load and parse - app_config.xml
- 2. Load and parse - assets.xml (for bulkloader)
- 3. Load and parse - containers.xml (application sprite or mc defined containers stack - eg getContainerById("overlay1") etc)
- 4. Instantiate a singleton of embedded assets (1 x SWF for use with util I have getEmbeddedAssetClassById(str); and a list of simple font registrations and a collection of other assets needed for a bulkloader ui progress loader later)
- 5. Application mediator - check assets.xml for asset count and preloader or not to preload and will have template code for textfield % done indicator but boolean available to not show bulkloader progress view component
- 6. Application mediator - Clean up / remove bulkloader progress views
- 7. Application mediator - Setup target projects ui and home screen (unknown at this time)
So you can see where I thought the prep came in handy, I needed the xml data to be loaded and parsed before we actually get into the applications target functionality and design.
I have noticed many examples I downloaded that didn't have modelPrepCommand.as and ViewPrepCommand and just goes straight to the StartupCommand.as, I think I will follow this route then as I can't see what I would actually place in these classes (model & view prepCommands.as).The EmbeddedAssetsPrep came from an example I downloaded exampling usage of the twitter api. I guess that's not quite correct then.
Question:I noticed the class path in your response for your constants was:
package net.zarqon.common.constants
I would have thought placing these in the model folder and if many a sub folder in the model folder would have been more appropriate? I would like to get a fixed folder structure, a pattern to lock down to and not deviate from, what are your thoughts on this?
I will alter my template application to work as follows,
let me know if you have see anything wrong with this:
- 1. Setup SWF & Instantiate the PureMVC
- 2. ApplicationFacade.as (
- 3. ApplicationStartupCommand.as - remove all addSubCommands and go straight for facade.registerMediator( new ApplicationMediator( note.getBody() ) );
- 4. Application mediator - Instantiate singleton of embedded_assets.as (model folder)
1 x SWF for use with getEmbeddedAssetClassByID(str);
Font registrations
and standard embed constants
(* will have to check if singleton is needed here, don't want embeds to stack file size each time I use a constant)
- 5. ApplicationMediator - Register proxy ApplicationConfigurationProxy.as
- 6. ApplicationConfigurationProxy.as - Load app_config.xml, parse & dispatch notification success or fail
- 7. ApplicationMediator - Register proxy BulkLoaderAssetsProxy.as
- 8. BulkLoaderAssetsProxy.as - Load assets.xml, parse & dispatch notification success or fail
- 7. ApplicationMediator - Register proxy ApplicationContainersProxy.as
- 8. ApplicationContainersProxy.as - Load containers.xml, parse & dispatch notification success or fail
- 9. ApplicationMediator - Setup bulkloader progress views (% loaded)
- 10. Bulkloader - load asset list (NOT SURE HOW AND WHERE THIS FITS IN AT THE MOMENT)
- 11. ApplicationMediator - Clean up bulkloader progress views (% loaded)
- 12. ApplicationMediator - Setup target projects ui and home screen (project build begins)
I will create "NotificationConstants.as" in the model folder for holding all notifications bar "STARTUP".QuestionMy first real world test application of the above PureMVC skeleton will be a very basic 3D application. Regarding some details you gave me in my previous post ("getting started").
Previously stated you said enter frame handling would be done in the views, I'm assuming that I will be creating my 3DScene (blank) as a view with its own mediator. The view having an enter frame which is handling rendering the 3D scene and 3D scene camera positioning and animation.
In most of my 3D applications, this would be where I perform animation on multiple 3D objects and on camera direction and position. Now assuming this is a view component in the PureMVC, this would mean that this view is aware of many other views (3D objects in the scene)? Is this allowed in the PureMVC? Is a view supposed to be aware and manipulate other views? What's your thoughts & suggestions on this?
An example would be a 3D scene with a carousel and hover camera, where I click on an item in the carousel. Each item is a view component, and has its own animation for rotation tweens but the positions in the 3D scene of each view would be manipulated in relation to camera direction, camera position and which item in the carousel was clicked resulting in quite varied animation.
Thanks again for all your help,
Darcey