When you build a great web site, you need to plan your asset loading so that users don’t get frustrated and leave your website. When you build Windows 8 apps, loading assets is something you have to consider carefully because to publish an app to the Windows 8 store, your app must launch in 5 seconds or less on a low-power computer according to certification requirement 3.8. Asynchronous code is always a good strategy, so is displaying your own splash screen and showing a progress bar as your assets load so the user understands that the program is running and your app is loading assets.
The PreLoadJS library includes (this list is not exhaustive)
- reload – initiates the loading procedure and defines the array from which you pull URLs for loading
- loadAll – which iterates through the array and loads the assets one after the other
- loadFile – to load a single file
- BrowserDetect - to determine the current browser, version, operating system, and other environmental variables
- installPlugin – to register a plug in
- setPaused – to pause or resume the current load
There’s a couple of nice demos, such as the preload queue which shows a progress bar that you can check out as well. Download PreLoadJS and find this and other helpful libraries at the CreateJS site. Don’t forget when you publish a Windows 8 app in Canada you can get rewards with Developer Movement, and if you are a student you could enter it in Imagine Cup!