2 Replies Latest reply on Oct 1, 2007 8:36 PM by iconoclasta11

    Preloader trouble

    iconoclasta11
      Hi,

      I'm involved with my first Flash Project using Action Script. Im having some problems with my preloader. I have the following script to prevent the page playing before it has been completely loaded. The problem is that if someone clicks out of the page while it was still loading, 'myInterval' won't be cleared and will mess things up. I'm assuming I need an 'else' command. Just not sure how, Any help?

      stop();
      myInterval = setInterval (preloader, 50);
      function preloader() {
      if (getBytesLoaded()>=getBytesTotal() ) {
      play()
      clearInterval (myInterval)
      }
      }
        • 1. Re: Preloader trouble
          kglad Adobe Community Professional & MVP
          what do you mean by, "if someone clicks out of the page"?
          • 2. Re: Preloader trouble
            iconoclasta11 Level 1
            Let me rephrase: I have a movie clip loader and a preloader in a master page. I load to this master page different swf files using the mcl. Some of them take more time to load so I've added an "interval function" to tell flash not to start playing the page until its fully loaded. Now, the problem occurs if someone, while loading a page with the interval script, doesn't wait until the page is fully loaded and clicks on another link (any link) and starts loading another swf clip. The site freezes and wont work until it gets reloaded.
            I am aware that I do have to cancel that condition somehow... Sorry for being such a mess explaining this. I'm just learning action script and its hard to explain when you don't have the proper lingo.

            Jose Luis