Using CreateJs: PreloadJS, SoundJS, and TweenJS

PreloadJs, SoundJs, and TweenJs

In the first part of this series about using CreateJs, we had a look at EaselJs. In this second and last part, we will look at PreloadJs, SoundJs, and TweenJs. PreloadJS is a library that lets you manage and co-ordinate the loading of assets. PreloadJS makes it easy to preload your assets, like images, sounds, JS, data, and others. It uses XHR2 to provide real progress information when available or fall back to tag-loading and eased progress when it is not. It allows multiple queues, multiple connections, pausing queues, and a lot more.

 

In PreloadJS, the LoadQueue class is the main API for preloading content. LoadQueue is a load manager, which can preload either a single file or a queue of files. var queue = new createjs.LoadQueue(true);, passing false would force tag-loading where possible. LoadQueue has several events you can subscribe to:

  • complete: fired when a queue completes loading all files
  • error: fired when the queue encounters an error with any file.
  • progress: the progress for when the entire queue has changed.
  • fileload: for when a single file has completed loading.
  • fileprogress: the progress for when a single file has changes. Please note that only files loaded with XHR (or possibly by plugins) will fire progress events, other than zero or 100%.


Lubov Cholakova

Lubov CholakovaLubov has been with DMXzone for 8 years now, contributing to the Content and Sales departments. She is bringing high quality content in the form of daily blog updates, reviews, tutorials, news, newsletters,update emails and extensions' manuals. If you have a product that needs publicity or any other questions about the entire DMXzone community, she is the one you can contact.

See All Postings From Lubov Cholakova >>

Comments

Be the first to write a comment

You must me logged in to write a comment.