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

Pages: 1 [2] 3
Print
Author Topic: Startup as Ordered - A PureMVC AS3 / Flex Demo  (Read 39817 times)
philipSe
Sr. Member
****
Posts: 139


View Profile Email
« Reply #15 on: July 07, 2008, 07:50:53 »

Steve
Just want to make sure you know there is a separate swc for startup manager utility with multicore.  It is under a multicore folder, under trunk in the svn repository.  This is a hurried reply, and hence unable to be more precise.
Good luck.
----Philip
Logged
justSteve
Courseware Beta
Sr. Member
***
Posts: 55


View Profile Email
« Reply #16 on: July 07, 2008, 09:07:30 »

Opps....that'd be the problem. Sry.
Logged
philipSe
Sr. Member
****
Posts: 139


View Profile Email
« Reply #17 on: July 07, 2008, 09:55:06 »

Steve
Ok, now I can be more precise - tis the bin folder.

For startup manager utility, in the bin folder under trunk in the svn repository, there are 2 swcs, one for standard and one for multicore, the latter being named Utility_AS3_MultiCore_StartupManager_1_3.swc.  I haven't actually used this myself, but I would encourage its use and would appreciate feedback.

This bin folder is not part of any tagged release, as far as I know.

Cliff, what is the best way to make this available?  Is there read access to the repository?

Hopefully, this swc will resolve your problem.
Regards
----Philip




Logged
justSteve
Courseware Beta
Sr. Member
***
Posts: 55


View Profile Email
« Reply #18 on: July 07, 2008, 12:31:54 »

Using the MultiCore version:

Severity and Description   Path   Resource   Location   Creation Time   Id
1046: Type was not found or was not a compile-time constant: [org.puremvc.as3.interfaces]::IProxy.      StartupAsOrdered   Unknown   1215456244359   7070
1136: Incorrect number of arguments.  Expected 0.   StartupAsOrdered/src/org/puremvc/as3/demos/flex/startupasordered   ApplicationFacade.as   line 48   1215456244359   7068
1203: No default constructor found in base class org.puremvc.as3.multicore.patterns.facade:Facade.   StartupAsOrdered/src/org/puremvc/as3/demos/flex/startupasordered   ApplicationFacade.as   line 1   1215456244359   7069
Logged
Tekool
Sr. Member
****
Posts: 192


View Profile WWW Email
« Reply #19 on: July 08, 2008, 04:57:44 »

Philip, could you please change the constructor arguments of the *StartupMonitorProxy* to let us pass the proxy name as the first argument as usual with PureMVC ?

Something like :
:
public function StartupMonitorProxy ( proxyName:String=NAME, data :IResourceList = null ) should be a good idea.
Logged
Tekool
Sr. Member
****
Posts: 192


View Profile WWW Email
« Reply #20 on: July 08, 2008, 06:03:42 »

Forgive me, you need to know the exact name of the proxy when you refer to it in *StartupResourceLoadedCommand* or *StartupResourceProxy*.

Nothing too hard to deal with. :)

Sorry.
Logged
philipSe
Sr. Member
****
Posts: 139


View Profile Email
« Reply #21 on: July 08, 2008, 09:01:04 »

Steve
I don't have a ready answer for you.  The errors seem to be related to startup as ordered, isn't that right?  Where is the reference to the non-multicore IProxy coming from?  I would like to reproduce what you are doing, and then play with it.

Unfortunately. I am on holidays this week and next.  Internet access is not readily available.  And anyway, I'm supposed to be relaxing and so on....

I look forward to seeing info on any progress you make.
----Philip
Logged
justSteve
Courseware Beta
Sr. Member
***
Posts: 55


View Profile Email
« Reply #22 on: July 09, 2008, 03:53:23 »


Unfortunately. I am on holidays this week and next.  Internet access is not readily available.  And anyway, I'm supposed to be relaxing and so on....

I look forward to seeing info on any progress you make.
----Philip


You put me in a tough spot here....i don't want to be the source of unrelaxment by putting my problems in front of you - otoh, i don't want to cause stress by not updating on my 'progress'. ;) So in the spirit of 'not my brother's keeper' perhaps you can balance the stress of this puzzle against one of them fancy drinks with the umbrella in 'em.


Using the posted, current version of StartupAsOrdered, multicore, and StartupManager (pulling /scr from the svn trunks rather than the swc) I use a utility that globally searches and replaces text in all the projects files to change:

import org.puremvc.as3.
to:
import org.puremvc.as3.multicore

That requires changing back references to AsynchStub from:
import org.puremvc.as3.multicore.utilities.asyncstub.

back to:
import org.puremvc.as3.utilities.asyncstub.

I'm inclined to trust this method of refactoring (global search/replace) because I'm trusting FlexBuilder to flag any incorrectness, and in fact, if I try to compile at this point i get a complaint about number of arguments for ApplicationFacade.getInstance() - no message about 'type was not found'.

After I correct the signature for calling the AppFacade:

   public static const NAME:String = 'StartupAsOrdered';
   protected var facade:ApplicationFacade = ApplicationFacade.getInstance( NAME );      

The compiler tosses these errors.
:
Severity and Description Path Resource Location Creation Time Id
1046: Type was not found or was not a compile-time constant: [org.puremvc.as3.interfaces]::IProxy. StartupAsOrdered Unknown 1215599616171 7216
1061: Call to a possibly undefined method retryLoadResources through a reference with static type org.puremvc.as3.multicore.utilities.startupmanager.model:StartupMonitorProxy. StartupAsOrdered/src/org/puremvc/as3/demos/flex/startupasordered/view ApplicationMediator.as line 43 1215599616203 7217
1119: Access of possibly undefined property LOAD_RESOURCES_REJECTED through a reference with static type Class. StartupAsOrdered/src/org/puremvc/as3/demos/flex/startupasordered/view ApplicationMediator.as line 54 1215599616203 7218
1119: Access of possibly undefined property LOAD_RESOURCES_REJECTED through a reference with static type Class. StartupAsOrdered/src/org/puremvc/as3/demos/flex/startupasordered/view ApplicationMediator.as line 75 1215599616203 7219

And now, in lieu of my own relaxation, I have a few tons of concrete being air lifting to a new foundation I'm preparing for my new house to get ready for. Come to think of it, you may find the fact that you are (presumably) thousands of miles from my building site/circumstance much more relaxing than a umbrellaed drink!

http://picasaweb.google.com/Am.Steve


Logged
philipSe
Sr. Member
****
Posts: 139


View Profile Email
« Reply #23 on: July 09, 2008, 11:41:42 »

Steve
Ok, ok, I'm sorry I mentioned the 'relaxing' word.  Good luck with the new house.

You may already know: the multicore src of startupmananager (sm), from which the multicore swc was built, is under the multicore folder in trunk.  It is just standard with the import statements changed.

If there is a problem with this swc, I'm not asking you to resolve it - since I built it I should step forward to resolve it, and will do, and will give it priority over other things (including that r word).

Now, maybe you already believe/know that the prob is with the swc.

If we have the sm multicore swc, plus startupasordered (sao) changed for multicore, plus asyncstub (as) changed for multicore, and we get compile errors that cannot be resolved through sao or as, then it looks like sm is the problem.  Is that where we're at?  I can see that the error line that features 'undefined method retryLoadResources' would seem to indicate an sm error.  And now I realise that this method is superseded by 'tryToCompleteLoadResources()' in this latest sm, which indicates that the sao in use is not the latest version.  The latest sao is required for the latest sm.

Hope this helps.
----Philip
Logged
justSteve
Courseware Beta
Sr. Member
***
Posts: 55


View Profile Email
« Reply #24 on: July 11, 2008, 04:18:20 »

Thankx for the wishes of luck. I'm considering planting a sign at the top exit of my driveway so that as they leave, contractors will be reminded to do the same since i've caught a few of them muttering the phrase under their breath. Foundation's poured and curing a few hundred feet away. Bad luck of near biblical proportions are all that separate me from a major sigh of relief scheduled for early next week.
.
.
.

plus asyncstub (as) changed for multicore,

I'd missed this step first (and 2nd) time around.

The latest sao is required for the latest sm.

Yep...i missed that too. After adjusting for multi-core-ness all sm/stub/sao-related errors are eliminated. Hope this message finds you in time to resume some umbrellaed drink relaxation!

tx

Logged
philipSe
Sr. Member
****
Posts: 139


View Profile Email
« Reply #25 on: July 11, 2008, 08:19:53 »

That's great Steve.  Glad to know you have a clean compile.  BTW, we don't have umbrellas on our drinks in the West Of Ireland.
----Philip
Logged
neil
Jr. Member
**
Posts: 16


View Profile Email
« Reply #26 on: September 16, 2008, 04:11:32 »

Hi.

I have a Flex/Air project that runs perfectly when run from Flex Builder 3 in either debug or standard mode.
However, when I package the application as an Air installer and install and run it, the application mediator doesn't get called.
I took away the proxy registers from the StartupCommand files and the application mediator was now called, so I added the proxies back one by one, but it seems that it's a random problem not related to the actual proxies that I add back.

My gut feeling is that I need to implement the startupmanager. The model doesn't neccessarily need to be loaded in a specific order, but it may get rid of this problem.

Just to clarify, this only happens when the application is packaged, it doesn't happen when ruuning directly from Flex builder.

Anyone have any ideas?
Logged
neil
Jr. Member
**
Posts: 16


View Profile Email
« Reply #27 on: September 16, 2008, 04:35:36 »

Okay, this probelm was nothing to do with the order of startup. It was down to the sqlite db file being placed in a different folder than to where it is located when testing/debugging.

I copied over my db file and it all works great now.

Thanks,

Neil
Logged
mikih
Newbie
*
Posts: 4


View Profile Email
« Reply #28 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
« Last Edit: January 28, 2009, 08:16:32 by mikih » Logged
philipSe
Sr. Member
****
Posts: 139


View Profile Email
« Reply #29 on: July 12, 2009, 04:55:59 »

There is a new version of the Startup As Ordered demo in the code repository; in trunk, not tagged.

Here is the relevant extract from version.txt.

1.6 Presentation improved, to conform better to demo presentation
    standards.  Libs now has PureMVC 2.0.4 and StartupManager 2.0.
Logged
Pages: 1 [2] 3
Print