|
|
Show Posts
|
Pages: 1 ... 3 4 [5] 6 7 ... 10
|
61
|
PureMVC Manifold / Demos and Utils / Re: Startup for Assets - A PureMVC AS3 / Flex / StartupManager Demo
|
on: May 22, 2009, 03:09:12
|
@crypt Is there any sollution for this? To sequence the loading? As you may know, the StartupManager utility (SM) has a sequencing feature - see StartupAsOrdered demo. So, you could do the following, in your load assets command - make and register a StartupResourceProxy object for each asset; say ar1, ar2, etc - express the sequencing by using the appropriate requires statements, for example: ar2.requires = [ar1]; - use addResource() instead of addResourceViaStartupProxy(). other parameters about assets? Like id, name, url, comment... ? Maybe the following - extend IAsset to include the additional attributes - in your load assets command, when each asset is instantiated using the AssetFactory, set the additional attributes on the asset; this assumes that the additional attributes are available from the same source as the url string, so maybe groupOfUrls is not just an array of urls, maybe each array element contains the url plus the additional attributes. Hope this helps. ----Philip
|
|
|
62
|
PureMVC Manifold / Demos and Utils / Re: Startup for Assets - A PureMVC AS3 / Flex / StartupManager Demo
|
on: May 19, 2009, 03:03:32
|
@crypt The assetloader feature is part of the StartupManager utility (SM).
In that utility, there are 2 interfaces available for assets: IAsset and IAssetForFlex. The 3 supplied asset classes implement IAssetForFlex - the 3 classes are AssetOfTypeImage, AssetOfTypeSwf and AssetOfTypeText - the code content is extremely small. If you want to avoid IAssetForFlex, and thus avoid UIComponent, you could create your own versions of these asset classes to extend AssetBase and implement just IAsset.
Let me try to be more comprehensive in my reply. Say you want to continue to just include the SM utility as a lib component - the .swc file. In that case. it seems to me, you could do the following - create your own 3 classes as described above, but with different names - create your own AssetTypeMap class, different name, implementing IAssetTypeMap; the only change from the utility version is to substitute your own names for the 3 asset classes - create your own LoadAssetGroupCommand class, different name; the only change from the utility version is to substitute your own name for the AssetTypeMap class.
Hope this helps. ----Philip
|
|
|
63
|
PureMVC Manifold / Demos and Utils / Re: StartupManager - A PureMVC AS3 Utility
|
on: April 28, 2009, 05:22:47
|
I want to discuss an enhancement to the SM utility. ObjectiveCater for concurrent instances of StartupMonitorProxy. For general use, this would be more natural. In addition, there are specific types of use that this enhancement would facilitate, for example - have a long running instance for loading assets on demand, using the keepResourceListOpen feature
- create another instance to load some data resources and then, when finished, cleanup and remove reference to it
- create another instance to load some specific assets blah blah blah.
- create another instance blah blah blah.
In relation to this example use, see this forum entry http://forums.puremvc.org/index.php?topic=258.msg4477#msg4477Preamble to solution- the sm commands, StartupResourceLoadedCommand and StartupResourceFailedCommand, must be able to select the correct sm instance when processing the loaded/failed notifications from a client app
- would like to maintain backward compatibility, so that existing apps will run correctly with this (proposed) new version of sm, for example, notifications sent by sm currently include jobId as notification type and some apps maybe use this feature.
Solution- StartupMonitorProxy (smpx) constructor takes proxy name as optional arg
- disallow setting of jobId when smpx name is not the default, i.e. when not StartupMonitorProxy.NAME; so, jobId is retained for old usage but is not supported for new usage; it is considered redundant when each "job" can have its own sm instance
- the notification type, on notifications sent by sm, is the smpx name, unless there is a jobId in which case the notification type is the jobId as at present
- the contract between the sm and the client app is
- sm guarantees to send notifications with type smpx name unless there is a jobId
- client guarantees to send the resource loaded/failed notifications with type as smpx name if the smpx name is not the default; thus the sm commands will be able to select the correct sm instance based on the notification type.
Notes- the choice of smpx name as notification type, rather than a reference to the smpx instance, facilitates the following usage idiom: a smpx and a progress mediator can be instantiated as a pair, with the same name, enabling name comparison as the selection condition for notifications to be handled in the mediator.
So, any comments? .../ yes it's worth doing / no don't bother / the approach is wrong / ... ----Philip
|
|
|
66
|
PureMVC Manifold / Demos and Utils / Re: StartupManager - A PureMVC AS3 Utility
|
on: March 16, 2009, 05:12:32
|
Any chance that support for mp3s could be added to the next release? Could you help with some information? This would be a new type of asset. As a loader, do we have to use flash.media.Sound, rather than Loader or URLLoader? If we have a new asset class, say AssetOfTypeSound, and if it implements IAssetForFlex, what kind of UIComponent would be appropriate? Also, is the asset loader intended to work in flash? There are 2 interfaces available for assets: IAsset and IAssetForFlex. The 3 supplied asset classes implement IAssetForFlex. If you want to avoid IAssetForFlex, you could use your own asset classes to extend AssetBase and implement just IAsset. If you do this, it would be great to let us know here on the forum. Thanks ----Philip
|
|
|
68
|
PureMVC Manifold / Demos and Utils / Re: StartupManager - A PureMVC AS3 Utility
|
on: March 02, 2009, 08:37:41
|
Arising from the previous 2 posts, there is a new version of StartupManager in the code repository; in trunk, not tagged.
Here is extract from version.txt.
1.6.1 This release is backward compatible. Method addResourceViaStartupProxy() of StartupMonitorProxy now registers the new StartupResourceProxy objects.
By way of further description, here is an extract of relevant code
/** * See addResource() above. This method offers an alternative to that, as a shortcut for the * client app, whereby the app does not have to create the StartupResourceProxy (srp) object for the * IStartupProxy object. Instead, the StartupManager (SM) will create and register the srp object, * naming it as follows * <ul><li> * use the name supplied as the second, optional argument; if supplied</li> * <li>otherwise, create a name by prefixing a suitable string to the name of the given * IStartupProxy object; the prefix is specified in the var <code>prefixIfAutoSRPName</code>, which * has an initial value that should usually suffice for uniqueness * i.e. const StartupManager.PREFIX_IF_AUTO_SRP_NAME i.e. "smSR_"</li> * </ul> * This shortcut is probably attractive only if there are no dependencies between the resources, * because the app requires references to the srp objects, to express the dependencies. */ public function addResourceViaStartupProxy( px :IStartupProxy, resourceProxyName :String = null ) :void {
----Philip
|
|
|
69
|
Announcements and General Discussion / General Discussion / Re: event order in StartupManager
|
on: March 02, 2009, 03:48:41
|
In your application startup, I assume the StartupResourceLoadedCommand is registered before your mediators are registered; this means that a notification will trigger the command before the mediators.
Note that processing is single-threaded, so when a notification is handled by the first interested party, that handling runs to completion before the next interested party gets to handle the original notification.
1. Proxy sends notification "data loaded" now all interested parties are actioned in sequence
2. First the SM command StartupResourceLoadedCommand is triggered which causes SM to send "loading complete" notification and this is picked up and reported by your mediator(s)
3. Next your interested mediators are triggered and report the "data loaded" notification.
This is normal with PureMVC. Since we don't typically worry much about the strict sequence in which we register commands and mediators, we can't make assumptions about the sequence in which notification handlers will be executed. You could choose to have 2 notifications, A and B; proxy sends A and this is picked up by mediators, proxy sends B and this triggers the StartupResourceLoaded Command.
----Philip
|
|
|
70
|
Announcements and General Discussion / Getting Started / Re: StartupManager utility defaultRetryPolicy
|
on: February 23, 2009, 10:02:32
|
I'm just stuck on how to implement the defaultRetryPolicy? What exactly is it looking for?
An example of the setting of the defaultRetryPolicy, taken from the initial setting within the StartupMonitorProxy class, is as follows _defaultRetryPolicy = new RetryPolicy( new RetryParameters(0, 0, 300) );
This is the default policy that will apply, unless you make your own assignment, say as follows monitor.defaultRetryPolicy = new RetryPolicy(...);
where monitor is the reference to your StartupMonitorProxy object. The 3 parameters to the RetryParameters constructor are explained in the api docs for the RetryParameters class. They are maxRetries, retryInterval, timeout. If you need further explanation, please post again. Have you looked at the StartupAsOrdered demo? Is there a way to piggyback on the startup utility to determine when everything is loaded?
When everything is loaded, the SM utility sends a LOADING_COMPLETE notification. You can write your app so that this triggers a Command or some action in a Mediator. But note there is also the possibility of a LOADING_FINISHED_INCOMPLETE notification. See the api docs for the StartupMonitorProxy class, where the various notifications are listed. Again, if you need further explanation, please post again. ----Philip
|
|
|
71
|
PureMVC Manifold / Demos and Utils / Re: StartupManager - A PureMVC AS3 Utility
|
on: February 11, 2009, 03:44:10
|
You are right it seems to me. For a proxy to be viable in multicore, at least as regards using the facade var, the proxy must be registered. A comparison of Notifier.as in standard and multicore shows this.
This means that the method addResourceViaStartupProxy(), of StartupMonitorProxy, is not valid in multicore. Instead the addResource() method should be used, and the client app should register the StartupResourceProxy before passing it to addResource.
The addResourceViaStartupProxy method was introduced in version 1.4, as an alternatve to addResource(). In the assetloader feature, the LoadAssetGroupCommand uses this method and hence that command is also not valid for multicore.
I am sorry this problem was not identified by me pre-release. I will deal with it in the next release. In the meantime, for users of the LoadAssetGroupCommand, workaround options include - extend StartupMonitorProxy and override the addResourceViaStartupProxy method - or extend LoadAssetGroupCommand and override the prepAssetGroupForLoad method.
----Philip
|
|
|
72
|
PureMVC Manifold / Demos and Utils / Re: StartupManager - A PureMVC AS3 Utility
|
on: January 16, 2009, 04:47:10
|
There is a new version of StartupManager in the code repository; in trunk, not tagged.
The enhancements are minor. Here is extract from version.txt.
1.6 This release is backward compatible. Within asset loader feature, in AssetFactory class: support for .css urls as asset type Text, plus defaulting to type Text, hence reduced likelihood of 'unexpected url type' as an Error condition. Within StartupMonitorProxy class: new cleanup method, to remove StartupResourceProxy objects from proxy map; also, the reset method now includes this cleanup of SRP objects.
So, note that monitor.reset() now does a facade.removeProxy for SRP objects. If this is a problem for anybody, please let me know. ----Philip
|
|
|
|
|