3 Replies Latest reply on Jan 8, 2007 1:43 AM by CaioToOn!

    hellp with preloader

    huminuh83
      I recently tried Lee's preloader tutorial and it worked great. . . I changed the design a little bit instead of a bar and when i preview the site in the flash viewer it works fine and goes to the third frame to play the movie when it is done loading. Except, when i put it on the internet it stays in frame two. I was wondering if anyone could help me figure this out. I'm sure it's something simple that im overlooking but i can't find it Sad

      here is a link to the fla file
      www.tsutsumidaphoto.com/john/index.fla

      and here it is on the net

      www.tsutsumidaphoto.com/john

      Thank you so much!
      huminuh83
        • 1. Re: hellp with preloader
          CaioToOn! Level 3
          Hi, Huminuh83.

          Why don't you use onEnterFrame.

          At the first frame you put

          stop();
          this.onEnterFrame = function()
          {
          var percent:Number = Math.floor(this.getBytesLoaded() * 100 / this.getBytesTotal());
          if (percent == 100 && this.getBytesLoaded()>0)
          {
          delete this.onEnterFrame;
          this.play();
          }
          this.loader._yscale = percent;
          loadText.text = percent + "%"
          }

          And you remove that second frame, making the third become the second.


          Any doubts, just post it.
          CT.
          • 2. Re: hellp with preloader
            huminuh83 Level 1
            thanks so much, that worked!! I don't know why the other one would work in the play but not online.

            My only question is, what does "Math.floor" mean?


            Thanks so much for your time!
            huminuh
            • 3. Re: hellp with preloader
              CaioToOn! Level 3
              Hi, there.

              Math.floor is a method of the Math class that round number to down. For exemple, if you have the number 8.7 and use the Math.round(), the return would be 9, because is the closest integer, but using the Math.floor(), the return always is equal to the integer parse of the number, and would be 8.

              You have also the Math.ceil(), that round to up. In that case, would be 9.

              bye,
              CaioToOn!