Application loading and reuse with AssetLoader
Home › Forums › AssetLoader › General Discussion › Application loading and reuse with AssetLoader
This topic has 2 voices, contains 6 replies, and was last updated by nodinosaur 269 days ago.
| Author | Posts |
|---|---|
| Author | Posts |
| August 18, 2011 at 8:30 pm #736 Quote | |
|
nodinosaur |
<p>Hi, </p>
<p>I recently worked with a digital creative studio, they load configuration and asset files using a boot SWF which loads a font SWF, a CSS document, content XML, some images and then finally the App SWF. Once everything had been loaded the app was initialized. The content was also available throughout the application as the loader used is a singleton.</p> <p>I was wondering if it would be possible to write something similar utilizing AssetLoader and avoiding the boot SWF in preference for the frame meta data tag ([Frame(factoryClass="my.domain.AppLoader")]) – thus creating a single SWF (*ref: http://www.bit-101.com/blog/?p=946).<br /> As I am a RobotLegs user, I would like to be able to access the same AssetLoader content throughout the application.</p> <p>I can see issues using the above single SWF approach, for instance, I am a little unsure how I might go about monitoring the loading of the SWF itself using AssetLoader, then the assets (fonts, css, xml) and then injecting the same AssetLoader into the application framework once it has been initialized.</p> <p>I don’t want to drop the idea quite yet as there might be a good solution to this approach that I hadn’t considered, so I thought I’d ask what might be the best approach to achieve the above?</p> <p>G </p> |
| August 18, 2011 at 9:51 pm #844 | |
|
Matan Uberstein |
Hey Bud, I’ll get to your question tomorrow, calling it a day…. a loooong day. Sort-of got a solution in my mind, but I’ll properly think about it tomorrow before saying anything. Laterz, |
| August 23, 2011 at 7:42 am #814 | |
|
nodinosaur |
Anybody have any suggestions on how I can get AssetLoader to monitor the load progress of the SWF it resides in? (instead of writing 1 in an 1 loop) |
| August 23, 2011 at 7:54 am #845 | |
|
Matan Uberstein |
I assume the SWF is already loaded and it’s loading other assets, right? If so, simple make the assetloader a public property of the SWF and path to it. E.g. 1 |
| August 23, 2011 at 8:38 am #846 | |
|
nodinosaur |
Er, not quite… Essentially, I wonder if it is possible to start to use AssetLoader at the first possible instant (monitor loading of the SWF itself), and then inject the same AssetLoader into RobotLegs once the application has been initialized. Otherwise, I will have to use an old fashioned EnterFrame, Bytesloaded/BytesTotal algorithm, then start the application, and inject AssetLoader. |
| August 23, 2011 at 8:52 am #847 | |
|
Matan Uberstein |
Hmm, ok, so this is for a “preloader”? – You want monitor the loading of the preloader itself? Sorry, trying to figure out how your setup works. My approach to preloading is simple: Have a really small swf that can be instantly embedded (usually about 40k-100k depending on loading artwork), then the preloader simply loads the “Main” file. It won’t be possible monitoring the loading progress of the preloader itself, because it’s being loaded by the browser, unless you use a 2 frame approach. The swf will be embedded as soon as the first frame is loaded and that included the first frame scripting. So, if you have a public property of the assetloader on the first frame and you “loading artwork” on the second. The swf will practically be embedded instantly. If you’d like to carry over the same assetloader used in the preloader, map the value of the public property into your injector: 1 All this said, you still won’t be able to use assetloader for monitoring the progress of the preloader itself, you’ll need to the enter frame trick, no way around it. |
| August 23, 2011 at 3:35 pm #848 | |
|
nodinosaur |
Yes, your approach is a common one & one I too have practiced for years, however, more recently I have been using the 2 frame approach. The reason why I asked if it possible to use the AssetLoader act as ‘preloader’ for the SWF as well as the initial config files/css/fonts is so that I could possibly display a single loading bar. (I hope my explanation is a little clearer now) |
You must be logged in to reply to this topic.







