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  PureMVC Manifold / Demos and Utils / Re: StartupManager - A PureMVC AS3 Utility on: February 10, 2009, 04:11:08
Hi there,
I've been noodling around with the startupManager utility for a pure actionscript, multicore project and I've come across an issue I'd like to run by the forum:

I plugged the startupManager and all dependent libraries into my project (hacked the mx.core classes in just so it would run for the time being.. more on that later). When I run it I am getting an Error: multitonKey for this Notifier not yet initialized! at StartupResourceProxy/get monitor(). Stepping through the debugger I find that this is because the StartupResourceProxy for each resource isn't being registerProxied. The API docs say:

This method offers an alternative to that, as a shortcut for the client app, whereby the app does not have to create the StartupResourceProxy (sup) object for the IStartupProxy object. Instead, the StartupManager (SM) will create the sup object. But note that the app does not then have a reference to it and has not given it a name and has not registered it using registerProxy(). In fact, the SM will not give it a name and hence will not register it. This is fine as regards the SM operations.

I wonder if this is maybe true only for the AS3 Standard version because here in the Multicore version it seems to be necessary to register the proxy in order that the StartupResourceProxy can retrieve the facade in it's get monitor() method.

What I have ended up doing is registering the proxy using the url for the resource as a unique name:

:
public function addResourceViaStartupProxy( px :IStartupProxy ) :void {
var name : String = ( px as AssetProxy ).url ;
        facade.registerProxy( new StartupResourceProxy( name, px ) );
var r :StartupResourceProxy = facade.retrieveProxy( name ) as StartupResourceProxy;
        //var r :StartupResourceProxy = new StartupResourceProxy( "", px );
addResource( r );
}

Which seems to work. I'm just wondering if there is another way around this, or if I'm making some fundamental error or whether I am just the first person to notice this behaviour. Anyway would be interested in any thoughts.

Jon
Pages: [1]