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 / Re: Suggestion to "as YXZProxy" casting on: March 02, 2010, 03:52:44
Performance wise "Class()" casting is a lot faster then "as Class". Are you planning to change that in the next rlz?
2  Announcements and General Discussion / Architecture / Re: Suggestion to "as YXZProxy" casting on: February 16, 2010, 12:58:48
Just in Case of code improvment. Last project we had Somerset issues with piping where I followed the paradigm ;) good insane while debugging. Sometimes you don't think about those compiler stuff


Flo 
3  Announcements and General Discussion / Architecture / Suggestion to "as YXZProxy" casting on: February 16, 2010, 10:07:22
Hi there,

I've got a suggestion for the usage of the "as" casting in the as3 port. It's not really useful to do so. It makes it worst to debug the code.

Using this:

:
var userProxy:UserProxy = facade.retrieveProxy(UserProxy.NAME) as UserProxy;

and getting a NULL return of any reason will effect your code at another position in the code. That makes it harder to debug while the debugger jumps to the wrong position in the Code.


I would rather recommend using this:

:
var userProxy:UserProxy = UserProxy(facade.retrieveProxy(UserProxy.NAME));

then the player is immediately throwing an exception at the right position in the stack and not when the userProxy is used later in the code.


Cheers
4  PureMVC Manifold / Demos and Utils / Re: Startup as Ordered - A PureMVC AS3 / Flex Demo on: January 28, 2009, 08:02:45
Hey guys,

first of all - many thanks to all your incredible work on puremvc. I've done 2 successfull projects with it and less pain then with self written mvc frameworks.

In my new project I'm using the StartupManager for loading my init assets. That works really nice. But I also want to use it for...

... loading assets e.g. in the background while user is surfing the website.
... loading assets on demand e.g. a header image per page
... request asset; if loaded retrieve it; if not loaded, start loading; if loading in process, connect listeners to show loading process

I don't know if its the right utility for it. In my last projects I used the Bulkloader to do so....

I'm fine with sending notfications and I understand the differents bewteen frameworks using the flash event handling but it feels more comfortable for the on demand asset loading. For example:

The code is only fictitious to illustrate my approach:
:
In my mediator e.g. HeaderMediator:
var newAsset : AssetProxy = facade.retrieveProxy('images/header/header_xyz.jpg');
if(newAsset) {
  if(newAsset.isLoaded) {
    _headerComponent.update(newAsset.asset.data as UIComponent);
  } else if (newAsset.getBytesLoaded() > 0) {
    newAsset.addEventListener(LoaderEvent.PROGRESS, progressHandler); // e.g. iupdates the progress bar
    newAsset.addEventListener(LoaderEvent.COMPLETE, completeHandler); // updates the asset in the _headerComponent
  }
} else {
  newAsset = facade.registerProxy('images/header/header_xyz.jpg');
  newAsset.addEventListener(LoaderEvent.PROGRESS, progressHandler);
  newAsset.addEventListener(LoaderEvent.COMPLETE, completeHandler);
  newAsset.load();
}

Does anyone has experience for using the AssetLoader for asset loading after startup? I dont want to use two loader utilities.

#####UPDATE: I think that guy has the same problem... http://theresidentalien.typepad.com/ginormous/2009/01/startup-manager-for-puremvc.html


Cheers
Pages: [1]