9 Replies Latest reply on Apr 19, 2007 12:44 PM by kglad

    preloader animation

    jl2000 Level 1
      Hi - On the main blank stage I'm loading the "master.swf" which contains all the navigation GUI. As a preloader visual I have a movie clip ("loaderani_mc" ) which is a simple timeline tween. I'd like this animation to move in coordination with the numbers being displayed in loading_txt , so that when the numbers reach 100% the animation will be completed. Simple right?

      When I test the movie I see the numbers progress nicely but I can't get the loaderani to play along.
      Would someone please help me to make this thing work?

      TIA your assistance.
      JL
        • 1. Re: preloader animation
          kglad Adobe Community Professional & MVP
          where's percentage defined???
          • 2. Re: preloader animation
            jl2000 Level 1
            kglad - Based on your tip I altered the code.

            I added "var percentage:Number" near the top and

            "percentage = Math.floor(bytesLoaded / bytesTotal * 100);" near the middle.

            I get the same result. What next?

            Thanks for your help.
            jl
            • 3. Re: preloader animation
              kglad Adobe Community Professional & MVP
              the "this" in this.loaderani_mc refers to listener which isn't correct. you need to fix that reference.

              i'm unable to suggest a fix because i don't know the timeline that contains loaderani_mc.
              • 4. Re: preloader animation
                jl2000 Level 1
                That makes sense. Here's the setup.

                The timeline that contains loaderani is 3 layers by 1 frame.
                Layer 1 is for actions and has only the code we've been working on.
                Layer 2 is the text box "loading_txt".
                Layer 3 only has loaderani._mc on it.

                Within loaderani_mc is 4 layers (3 of them static) by 100 frames. (I made it 100 because I thought it would help....100 frames, 100 percent...never mind.)
                Layer one is for actions and only has a stop(); on fr100.
                Layer 2 is an outline of a bird.
                Layer 3 is the only layer that motion tweens . It has a Graphic symbol (loader_mask)- a solid rectangle layer mask that gradually moves vertically revealing the fill of the bird.
                Layer 4 is the fill of the bird.

                I hope this is what you were asking for.
                JL
                • 5. Re: preloader animation
                  kglad Adobe Community Professional & MVP
                  no, that wasn't helpful.

                  is loaderani_mc on the same timeline as your code? is so just remove this.

                  if it's not on the same timeline what's the path from your code to loaderani_mc? if you're not sure of the path use:

                  trace("loader "+this); // on timeline that contains your code

                  // and

                  trace("mc "+this); // on the timeline that contains loaderani_mc
                  • 6. Re: preloader animation
                    jl2000 Level 1
                    Thanks again for the quick reply.
                    By following your instructions I was able to discover that I had the instance name spelled wrong. There was a dash instead of underscore. I hate when that happens because it means I've wasted hours of my and your time pouring over something I already know how to do.

                    However - it was not a total loss. I did learn something.
                    I had never understood about using trace statements in the way you suggested. Why would the statement **trace("loader "+this);** work if the thing I'm looking for is never named or referred to as "loader" ?
                    The trace came back **loader _level0**. How did the actionscript find "loader" ?
                    • 7. Re: preloader animation
                      Level 7
                      >>The trace came back **loader _level0**. How did the actionscript find
                      "loader" ?

                      It didn't. You said trace("loader "+this);
                      "loader" is just a string... and 'this' is _level0.

                      --
                      Dave -
                      Head Developer
                      http://www.blurredistinction.com
                      Adobe Community Expert
                      http://www.adobe.com/communities/experts/


                      • 8. Re: preloader animation
                        jl2000 Level 1
                        Thanks Dave. I was looking for something technical when the answer was simple.
                        JL
                        • 9. Re: preloader animation
                          kglad Adobe Community Professional & MVP
                          if you learn to use trace(this), you'll find it useful.