6 Replies Latest reply on May 25, 2006 9:31 PM by couvegalega

    preloader bar problem

    couvegalega
      Hello.

      I've made a movie, and the scene1 timeline has only one frame. There I have 4 different movieclips into different layers, each one with is own timeline.

      Now, how do I insert a preloader bar in my movie?

      When I tried with tutorials, it doesn't work, and even if the movie loads like before I entered the preloader, it seems to become looping in the first frames.

      Thanks for your help!
        • 1. Re: preloader bar problem
          Level 7
          1., move all the 1.st frame into the 2.nd frame
          2., make sure frame1 is empty
          3., place preloader bar movie clip in 1.st frame
          4., to 1.st frame, write this code:



          stop();
          myPreloader.onEnterFrame = function():Void {
          var loaded:Number = _root.getBytesLoaded();
          var total:Number = _root.getBytesTotal();
          var percentage = 100 * loaded / total;
          trace(percentage);
          if(percentage => 100) {
          _root.nextFrame();
          }
          }



          I bet it will work







          couvegalega wrote:
          > Hello.
          >
          > I've made a movie, and the scene1 timeline has only one frame. There I have 4
          > different movieclips into different layers, each one with is own timeline.
          >
          > Now, how do I insert a preloader bar in my movie?
          >
          > When I tried with tutorials, it doesn't work, and even if the movie loads like
          > before I entered the preloader, it seems to become looping in the first frames.
          >
          > Thanks for your help!
          >
          • 2. Re: preloader bar problem
            couvegalega Level 1
            Hi and thank for your help!

            I tried it but it shows an error message:




            Scene=Scene 1, Layer=Layer 11, Frame=1: Line 2: '{' expected
            myPreloader.onEnterFrame = function():Void{

            Scene=Scene 1, Layer=Layer 11, Frame=1: Line 7: Operator '=' must be followed by an operand
            if(percentage => 100) {

            Scene=Scene 1, Layer=Layer 11, Frame=1: Line 10: Unexpected '}' encountered
            }



            Was I supposed to change any values or something?
            I'm sorry, I'm really a newbie!
            • 3. Re: preloader bar problem
              Level 7
              I'm sorry, I wrote this just to mail, I didn't check it in flash ... I
              messed one line, it should be

              if(percentage >= 100)

              instead of

              if(percentage => 100)

              now, I've tested it and it works just fine. hope it helps.



              couvegalega wrote:
              > Hi and thank for your help!
              >
              > I tried it but it shows an error message:
              >
              >
              >
              >
              > Scene=Scene 1, Layer=Layer 11, Frame=1: Line 2: '{' expected
              > myPreloader.onEnterFrame = function():Void{
              >
              > Scene=Scene 1, Layer=Layer 11, Frame=1: Line 7: Operator '=' must be followed
              > by an operand
              > if(percentage => 100) {
              >
              > Scene=Scene 1, Layer=Layer 11, Frame=1: Line 10: Unexpected '}' encountered
              > }
              >
              >
              >
              > Was I supposed to change any values or something?
              > I'm sorry, I'm really a newbie!
              >
              >
              • 4. Re: preloader bar problem
                couvegalega Level 1
                Thank you once again!

                Now it just shows these errors:

                Scene=Scene 1, Layer=load, Frame=1: Line 3: '{' expected
                myPreloader.onEnterFrame = function():Void {

                Scene=Scene 1, Layer=load, Frame=1: Line 11: Unexpected '}' encountered
                }

                The movie plays the same like it has no preloader.
                • 5. Re: preloader bar problem
                  Level 7
                  cant believe that. you've surely missed something
                  to be sure, I made an example file, you can find it at:
                  http://pepa.aeternal.net/labs/macromedia_flash/


                  couvegalega wrote:
                  > Thank you once again!
                  >
                  > Now it just shows these errors:
                  >
                  > Scene=Scene 1, Layer=load, Frame=1: Line 3: '{' expected
                  > myPreloader.onEnterFrame = function():Void {
                  >
                  > Scene=Scene 1, Layer=load, Frame=1: Line 11: Unexpected '}' encountered
                  > }
                  >
                  > The movie plays the same like it has no preloader.
                  >
                  • 6. Re: preloader bar problem
                    couvegalega Level 1
                    Hi again!

                    I solved the problem moving the tag "void" to after the "{" !
                    Now it works!!
                    Thank you for all your help! =)