Skip navigation
Currently Being Moderated

What's the easiest way to add a "loading" symbol to CreateJS project?

Nov 13, 2013 12:17 AM

What's the easiest way to add a "loading" symbol to CreateJS project that has been published from Flash? I don't want to get too involved with the javascript, so is there an easy way to add a loading bar or spinner that shows while the assets are loading?

 
Replies
  • kglad
    72,212 posts
    Jul 21, 2002
    Currently Being Moderated
    Nov 13, 2013 6:26 AM   in reply to dv8kiwi

    yes, that can be added on stage.  but you'll need to use js to detect when loading is complete and the preloader symbol should be removed.

     
    |
    Mark as:
  • kglad
    72,212 posts
    Jul 21, 2002
    Currently Being Moderated
    Nov 13, 2013 11:27 AM   in reply to dv8kiwi

    what are you trying to preload?

     
    |
    Mark as:
  • kglad
    72,212 posts
    Jul 21, 2002
    Currently Being Moderated
    Nov 17, 2013 6:37 AM   in reply to dv8kiwi

    yes.

     

    you can use any flash timeline animation, too.  timeline animations convert well using createJS.

     

    and, i think, you answered my question. you're preloading your flash animation.  your flash is not loading anything, correct?

     

    if so, when the last object is initialized, you can remove your preloader.

     
    |
    Mark as:
  • kglad
    72,212 posts
    Jul 21, 2002
    Currently Being Moderated
    Nov 18, 2013 8:01 AM   in reply to dv8kiwi

    first, do you need a preloader?  have you tested your html5 project and does it take more than 1 or 2 seconds to start?

     
    |
    Mark as:
  • kglad
    72,212 posts
    Jul 21, 2002
    Currently Being Moderated
    Nov 18, 2013 11:49 AM   in reply to dv8kiwi

    check the js file that's created by createJS.  there are some init functions that initialize your assets.  when all your assets initialize, your display should start.  at that point you can make your preloader no longer visible:

     

    preloaderReference.style.visibility=false;

     
    |
    Mark as:
  • kglad
    72,212 posts
    Jul 21, 2002
    Currently Being Moderated
    Nov 18, 2013 9:24 PM   in reply to dv8kiwi

    absolutely true:  you will need to edit the js file and to do that you will need to know some js.

     

    your gif's file name is irrelevant.  it won't be referenced in js using that.  if you place your gif in a div, you can use the div's id to obtain a js reference:

     

    <div id="preloaderID"><img src="preloader.gif" /> </div>

     

    you can now reference your preloader using:

     

    document.getElementById("preloaderID")

     

    and make it not visible using:

     

    document.getElementById("preloaderID").style.visibility=false;

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points