Futurescale, Inc. PureMVC Home

The PureMVC Framework Code at the Speed of Thought


Over 10 years of community discussion and knowledge are maintained here as a read-only archive.

New discussions should be taken up in issues on the appropriate projects at https://github.com/PureMVC

Show Posts

| * |

  Show Posts
Pages: [1]
1  Announcements and General Discussion / Architecture / Should loaded view components be strongly typed by their mediator? on: March 24, 2010, 10:58:02
I have a view Mediator named MyMediator. It has a view component of type MyComponent so its getter looks like this:

:
import com.myproject.view.components.MyComponent;

protected function get myComponent():MyComponent
{
return MyComponent(viewComponent);
}

I also have an external swf whose document class is set to MyComponent. When I load up all of my application swfs I pass that loaded component to MyMediator:

:
facade.registerMediator( new MyMediator( myLoadedComponentReference ));
This is typically how I setup my mediators/components. However I realize now that because MyMediator imports MyComponent that I am compiling the MyComponent class in two places ( in the main application which holds my puremvc mediator and in the MyComponent swf ). This all seems very wrong to me as I believe things should only be compiled in one location, otherwise it's just wasting memory and potentially dangerous.

Do you guys have some opinions on all of this? Should loaded classes only be referenced by interface?

- rob
2  PureMVC Manifold / Demos and Utils / PureMVC Loadup Util giving fluctuating progress percentage on: March 09, 2010, 08:30:17
I've been working with the Loadup for Assets demo and I'm getting some strange returns in my test project. Currently I'm loading an xml file, 2 jpegs and a swf. Loadup loads the xml file first and sets its progress percent at 25%. It then briefly ticks up to 26.32577979788008% before immediately dropping off to 9% and then counting back up to 100%. Below is the output from the console so you can see the notes that are being sent and the progress percentage. I thought that the util was supposed to count up to 100% for an entire group of assets. Am I missing something? (apologies for the long line lengths).

*Edit: I've noticed that it will also tick up to 100%, then down to around 75% to finish another asset and then tick back up to 100%*

——————————————————————————————————————————————————————————————————————————————————
SEND NOTIFICATION: ApplicationNotifications.STARTUP
——————————————————————————————————————————————————————————————————————————————————
[object StartupCommand] running...
[object ApplicationMediator] created
[object ApplicationMediator] onRegister


——————————————————————————————————————————————————————————————————————————————————
SEND NOTIFICATION: LOAD_ASSET_GROUP
——————————————————————————————————————————————————————————————————————————————————


——————————————————————————————————————————————————————————————————————————————————
SEND NOTIFICATION: luAssetGroupLoadProgress
——————————————————————————————————————————————————————————————————————————————————
[object ApplicationMediator] :::::: handleNotification
Progress, %=25


——————————————————————————————————————————————————————————————————————————————————
SEND NOTIFICATION: luNewAssetAvailable
——————————————————————————————————————————————————————————————————————————————————
[object ApplicationMediator] :::::: handleNotification
xml/site_data.xml


—————————————————��————————————————————————————————————————————————————————————————
SEND NOTIFICATION: luAssetGroupLoadProgress
——————————————————————————————————————————————————————————————————————————————————
[object ApplicationMediator] :::::: handleNotification
Progress, %=25


——————————————————————————————————————————————————————————————————————————————————
SEND NOTIFICATION: luAssetLoaded
——————————————————————————————————————————————————————————————���———————————————————


——————————————————————————————————————————————————————————————————————————————————
SEND NOTIFICATION: luLoadingProgress
——————————————————————————————————————————————————————————————————————————————————
[object ApplicationMediator] :::::: handleNotification
Loading Progress: 25%


——————————————————————————————————————————————————————————————————————————————————
SEND NOTIFICATION: luAssetGroupLoadProgress
————————————————————���—————————————————————————————————————————————————————————————
[object ApplicationMediator] :::::: handleNotification
Progress, %=26.32577979788008


——————————————————————————————————————————————————————————————————————————————————
SEND NOTIFICATION: luAssetGroupLoadProgress
——————————————————————————————————————————————————————————————————————————————————
[object ApplicationMediator] :::::: handleNotification
Progress, %=9.233931554644707


——————————————————————————————————————————————————————————————————————————————————
SEND NOTIFICATION: luAssetGroupLoadProgress
———————————————————————————————————���——————————————————————————————————————————————
[object ApplicationMediator] :::::: handleNotification
Progress, %=18.462746629577666


——————————————————————————————————————————————————————————————————————————————————
SEND NOTIFICATION: luAssetGroupLoadProgress
——————————————————————————————————————————————————————————————————————————————————
[object ApplicationMediator] :::::: handleNotification
Progress, %=43.12657278943433
3  Announcements and General Discussion / Architecture / A good way to load my PureMVC app into a shell swf? on: March 07, 2010, 03:16:19
Going forward with all of my projects I would like to build a Shell.swf which loads Main.swf. Shell.swf would only hold a preloader and its purpose would simply be to keep my initial filesize down. Main.swf would create the PureMVC actors. I'm still learning how to keep my files tidy so they don't balloon but in my most recent project I used the LoadUp util with just a Main.swf and my entry point file ended up being 119kb after I connected all my proxies, commands and mediators.

What I'd really like to do is to keep using LoadUp but somehow tie it into the loading of the Main.swf by Shell.swf. Does this sound reasonable or do you guys have a better approach to this problem?

Thank you :D

- rob
4  Announcements and General Discussion / Architecture / What is considered the best practice for adding viewComponents to the stage? on: January 30, 2010, 12:10:50
First of all, thank you Cliff for all of your hard work on the framework and also your dedication to this forum. It's really great, as a self taught developer, to have places like this to go to which are active and responsive and help me along my way.

I have a rather simple application right now which displays a 3D timeline. The timeline has very little functionality and as such only needs one mediator. My current setup is an ApplicationMediator with a reference to the stage as its viewComponent, and a TimelineMediator with an instance of the 3D timeline as its viewComponent.

When I want to add the timeline to the stage/display list, I can think of two ways to do it. One way would be to send a notification with a reference to the timeline viewComponent as its body. Then the ApplicationMediator would handle that note and add it to stage. The other way is to have the ApplicatationMediator listen for a notification and then add the viewComponent through its mediator's reference in the facade.
:
addChild(facade.retrieveMediator(TimelineMediator.NAME).getViewComponent() as DisplayObject);
I've used both methods and they work well but I was wondering if there is an alternative best practice that maybe I don't know about? Is it ever wise to pass a stage reference to your Mediators and just forgo the ApplicationMediator/StageMediator all together?

Thanks!

- Rob
Pages: [1]