PureMVC
Home
About
Code
Docs
FAQ
Forums
News
Showcase
Contact
Jobs
Welcome,
Guest
. Please
login
or
register
.
May 25, 2013, 01:01:35 PM
News:
ATTENTION: Spambots must die! Humans must visit
http://contact.futurescale.com
to request forum access.
PureMVC Architects Lounge
PureMVC Manifold
Port to AS3
Standard Version
Demos and Utils
Startup for Assets - A PureMVC AS3 / Flex / StartupManager Demo
Pages: [
1
]
2
« previous
next »
Author
Topic: Startup for Assets - A PureMVC AS3 / Flex / StartupManager Demo (Read 11296 times)
puremvc
Global Moderator
Hero Member
Posts: 2790
Startup for Assets - A PureMVC AS3 / Flex / StartupManager Demo
«
on:
September 29, 2008, 06:50:29 PM »
This demo illustrates the use of the PureMVC framework, the Startup Manager Utility, and its new Asset management classes to load display assets at startup.
The demo is located at
http://trac.puremvc.org/Demo_AS3_Flex_StartupForAssets
The author is Philip Sexton.
NOTE: This project is now known as LoadupForAssets, and was renamed when StartupManager was renamed Loadup, to dispel the notion that the utility it was only usable at startup time.
The new thread is here:
http://forums.puremvc.org/index.php?topic=1395.0
«
Last Edit: August 16, 2009, 07:17:33 PM by puremvc
»
Logged
philipSe
Sr. Member
Posts: 136
Re: Startup for Assets - A PureMVC AS3 / Flex / StartupManager Demo
«
Reply #1 on:
September 30, 2008, 05:17:54 AM »
Note that this demo requires the latest version of the StartupManager utility, that is, version 1.5, which has just been tagged as the current version.
----Philip
Logged
lulumOriss
Jr. Member
Posts: 14
Re: Startup for Assets - A PureMVC AS3 / Flex / StartupManager Demo
«
Reply #2 on:
October 18, 2008, 02:40:47 AM »
Hi,
I try to set up this demo for my development.
My files are well loaded but I can't understand how I have to store assets data in an appropriate proxy.
I think I have to register a proxy for each assets url but...
Here's my StartupCommand :
Code:
public class StartupCommand extends SimpleCommand implements ICommand
{
override public function execute( note:INotification ) : void
{
this.facade.registerProxy( new SettingsProxy( ) ); // this is the proxy where I want to store data from "assets/settings.xml"
var l_fileList:Array = [
"assets/settings.xml"
];
this.facade.registerProxy( new Proxy( ApplicationFacade.URL_GROUP_PROXY, l_fileList ) );
this.facade.registerMediator( new ApplicationMediator( note.getBody( ) ) );
}
}
Can anyone help ? lulu.
Subsidiary question : when I try to load a .css file, my application crashes (in a previous demo, it worked). Do you know why ?
Logged
philipSe
Sr. Member
Posts: 136
Re: Startup for Assets - A PureMVC AS3 / Flex / StartupManager Demo
«
Reply #3 on:
October 20, 2008, 04:57:04 AM »
Is your ApplicationMediator the same as the one in the demo?
The ApplicationMediator has a var 'groupOfUrls'; it expects to be assigned an array of urls. Your code indicates that you provide an array containing the single url, that for the xml file. And I think you say that it loads.
If I understand you correctly, your settings proxy has to process the xml file content and get from it the set of urls for the assets that you wish to load. And you then have to process this set as another group of urls to be loaded. So it's a two-step process. Is this the requirement?
Also, the StartupManager Utility asset Loader feature does not currently recognise files of type .css. I should add this as a text asset type, presumably. In the meantime, one workaround is for you to extend the AssetFactory class and override the urlToType function.
The currently supported set of types in the AssetFactory urlToType method are
- image type: .jpg, .gif, .png
- text type: .txt, .xml
- swf type: .swf
Apart from .css, what other types should I include?
----Philip
Logged
lulumOriss
Jr. Member
Posts: 14
Re: Startup for Assets - A PureMVC AS3 / Flex / StartupManager Demo
«
Reply #4 on:
October 20, 2008, 08:04:08 AM »
Hi,
thank you for your reply.
Actually, I just want to set my data from each url (just one in my sample code but the same for more) in a specific proxy.
I use the same ApplicationMediator as the one on the demo and in the NEW_ASSET_AVAILABLE handler, I compare the url to set the appropriate proxy (see below).
I guess there's an automatic process to do this. Isn't it ?
Code:
private function setProxyData( p_asset:IAsset ):void
{
var l_proxyName:String;
var l_data:*;
switch( p_asset.url )
{
case DefaultAssetsURL.SETTINGS_URL:
l_proxyName = SettingsProxy.NAME;
l_data = new XML( p_asset.data );
break;
}
var l_proxy:IProxy = this.facade.retrieveProxy( l_proxyName );
l_proxy.setData( l_data );
}
//[...]
case StartupManager.NEW_ASSET_AVAILABLE:
this.setProxyData( note.getBody( ) as IAsset );
break;
//[...]
Thanks for the .css.
No other type wish for the moment.
lulu.
Logged
philipSe
Sr. Member
Posts: 136
Re: Startup for Assets - A PureMVC AS3 / Flex / StartupManager Demo
«
Reply #5 on:
October 20, 2008, 08:47:24 AM »
Still not sure what your question is...
By using the StartupManager assetLoader, there is an AssetProxy created for each url. Each asset proxy has the url string as its name and has the IAsset object as its data. Hence, facade.retrieveProxy(url) can be used to get a reference to the asset proxy.
Does this help?
Also, let me just repeat the following question, to make sure it is addressed to all interested developers.
Quote
The currently supported set of types in the AssetFactory urlToType method are
- image type: .jpg, .gif, .png
- text type: .txt, .xml
- swf type: .swf
Apart from .css, what other types should I include?
----Philip
Logged
lulumOriss
Jr. Member
Posts: 14
Re: Startup for Assets - A PureMVC AS3 / Flex / StartupManager Demo
«
Reply #6 on:
October 20, 2008, 08:58:59 AM »
ok.
You solve my problem.
Thanks.
Logged
lulumOriss
Jr. Member
Posts: 14
Re: Startup for Assets - A PureMVC AS3 / Flex / StartupManager Demo
«
Reply #7 on:
October 21, 2008, 08:04:17 AM »
I'm back javascript:void(0);
I have understood where the data are stored after loading but, actually, I want to use a personal proxy with specific methods.
What is the best way to do this ?
Thanks. lulu.
(I try to be clear but...)
Logged
philipSe
Sr. Member
Posts: 136
Re: Startup for Assets - A PureMVC AS3 / Flex / StartupManager Demo
«
Reply #8 on:
October 21, 2008, 09:07:18 AM »
First, note that after the load, in addition to the AssetProxy objects, there is an AssetGroupProxy object that is a single proxy for the group of assets.
As regards the personal proxy, I suppose you design it to have the behaviour you require and you populate it from the data that has been stored in the AssetProxy objects.
----Philip
Logged
lulumOriss
Jr. Member
Posts: 14
Re: Startup for Assets - A PureMVC AS3 / Flex / StartupManager Demo
«
Reply #9 on:
October 21, 2008, 10:19:37 AM »
Yes, that's the idea.
Should I transfer data from the default proxy to my personal one in the NEW_ASSET_AVAILABLE handler (like I did in my sample code above) ?
Logged
philipSe
Sr. Member
Posts: 136
Re: Startup for Assets - A PureMVC AS3 / Flex / StartupManager Demo
«
Reply #10 on:
October 22, 2008, 08:23:22 AM »
Yes, that's ok.
----Philip
Logged
crypt
Jr. Member
Posts: 16
Re: Startup for Assets - A PureMVC AS3 / Flex / StartupManager Demo
«
Reply #11 on:
May 18, 2009, 08:18:54 AM »
Hi Folks!
I am making a photo viewer app in pure flash environment with puremvc,
I have a problem loading multiple thumbnail jpegs using assetloader: Type was not found or was not a compile-time constant: UIComponent... this utility in only for flex?
thanks
C
Logged
philipSe
Sr. Member
Posts: 136
Re: Startup for Assets - A PureMVC AS3 / Flex / StartupManager Demo
«
Reply #12 on:
May 19, 2009, 03:03:32 AM »
@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
Logged
crypt
Jr. Member
Posts: 16
Re: Startup for Assets - A PureMVC AS3 / Flex / StartupManager Demo
«
Reply #13 on:
May 19, 2009, 03:16:38 AM »
Thanks! It's help a lot! Meanwhile i hacked the files you mentioned, but the sollution you prefer is much more elegant! I would go that way. Thanks for fast reply!
Logged
crypt
Jr. Member
Posts: 16
Re: Startup for Assets - A PureMVC AS3 / Flex / StartupManager Demo
«
Reply #14 on:
May 20, 2009, 07:30:23 AM »
just one more question :-)
i am loading small thumbnails LoadAssetGroupInstructions, In groupOfUrls:Array i defined thumnails url's, but the loading sequence is different from groupOfUrls. Is there any sollution for this? To sequence the loading?
I use this command when new asset is available:
case StartupManager.NEW_ASSET_AVAILABLE:
popupThumbnails.addItem( ((note.getBody() as IAsset).data) as DisplayObject );
That's ok, but I need more information about thumbnails not just pure bitmap data. How can i send and receive other paramaters about assets? Like id, name, url, comment... ?
thanks!!
crypt
Logged
Pages: [
1
]
2
« previous
next »
Jump to:
Please select a destination:
-----------------------------
Announcements and General Discussion
-----------------------------
=> General Discussion
=> Getting Started
=> Architecture
=> Public Demos, Tools and Applications
===> Fabrication
-----------------------------
PureMVC Manifold
-----------------------------
=> Port Authority
===> Contributor Central
===> Client Side
===> Server Side
=> Port to AS2
===> Standard Version
=====> Bug Report
=====> Demos and Utils
=> Port to AS3
===> Standard Version
=====> Bug Report
=====> Demos and Utils
===> MultiCore Version
=====> Bug Report
=====> Demos and Utils
=> Port to ColdFusion
===> Standard Version
=====> Bug Report
=====> Demos and Utils
=> Port to C++
===> MultiCore Version
=====> Demos and Utils
=====> Bug Report
=> Port to CSharp
===> Standard Version
=====> Bug Report
=====> Demos and Utils
=> Port to Dart
===> MultiCore Version
=====> Bug Report
=====> Demos and Utils
=> Port to Haxe
===> Standard Version
=====> Bug Report
=====> Demos and Utils
===> MultiCore Version
=====> Bug Report
=====> Demos and Utils
=> Port to Java
===> Standard Version
=====> Bug Report
=====> Demos and Utils
===> MultiCore Version
=====> Bug Report
=====> Demos and Utils
=> Port to JavaScript
===> Demos and Utils
===> Native JS Branch
=====> Bug Report
===> PrototypeJS Branch
=====> Bug Report
===> Objs Branch
=====> Bug Report
===> MooTools Branch
=====> Bug Report
===> ExtJS Branch
=====> Bug Report
=> Port to Objective C
===> Standard Version
=====> Bug Report
=====> Demos and Utils
=> Port to Perl
===> Standard Version
=====> Bug Report
=====> Demos and Utils
===> MultiCore Version
=====> Bug Report
=====> Demos and Utils
=> Port to PHP
===> Standard Version
=====> Bug Report
=====> Demos and Utils
===> MultiCore Version
=====> Bug Report
=====> Demos and Utils
=> Port to Python
===> Standard Version
=====> Bug Report
=====> Demos and Utils
===> MultiCore Version
=====> Bug Report
=====> Demos and Utils
=> Port to Ruby
===> Standard Version
=====> Bug Report
=====> Demos and Utils
=> Port to TypeScript
===> Standard Version
=====> Bug Report
=====> Demos and Utilities
===> MultiCore Version
=====> Bug Report
=====> Demos and Utilities
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
Powered by SMF 1.1.11
|
SMF © 2006-2007, Simple Machines LLC
Loading...
Copyright © 2006-2008 Futurescale, Inc.