4 Replies Latest reply on Dec 21, 2009 8:27 PM by cyrus999a

    Progress animation for loading SWF question

    cyrus999a

      Hello everyone,

       

      I've created a progress bar animation to load an external SWF file as described in this document:

      http://livedocs.adobe.com/flash/9.0/main/wwhelp/wwhimpl/common/html/wwhelp.htm?context=Liv eDocs_Parts&file=00001043.html

       

       

      The problem is, the SWF file i want to load is a magazine exported from Indesign, so I want it to display one page (frame) at a time (you can go to the next page using the navigation buttons provided).

      When I use the method mentioned above the clip loads, but then it plays... so how can i make it stop at the first frame?

       

       

      Thank you in advance

      Cyrus

        • 1. Re: Progress animation for loading SWF question
          Ned Murphy Adobe Community Professional & MVP

          If you have design control over the file being loaded, then add a stop() command in frame 1 of its main timeline and be sure to disable any form of autoplay code it might have.

           

          If you don't have design control of the loaded file, once the file is loaded try targeting it and commanding it to gotoAndStop(1);  If it doesn't stick, then there is likely some autoplay code cycling within it.

          1 person found this helpful
          • 2. Re: Progress animation for loading SWF question
            cyrus999a Level 1

            Thanks for your reply,

             

            no, unfortunately I dont have design control over the SWF being loaded so I cannot add the stop() on the first frame.

            I don't even think it has some form of autoplay in it because, being that it is an Indesign exported document it's not supposed to be a movie in the first place.

             

            Could you tell me how to implement the gotoAndStop(1) part to the code? I'm kind of an Actionscript newbie.

            Thanks a lot

             

            Cyrus

            • 3. Re: Progress animation for loading SWF question
              Ned Murphy Adobe Community Professional & MVP

              Based on the code you say you based your loading on, I would say that whatever you did with the onLoadInit function might be a good place to try to tell the movie to goto and stop at frame 1.  To mt understanding, the onLoadInit event is triggered after the loading is complete and the movie starts to play, so catching it at this point is probably best.  I realize this may not be the code.names you use, but hopefully you'll get the idea...

               

              mclListener.onLoadInit = function(target_mc:MovieClip) {

                   target_mc.gotoAndStop(1);
                 target_mc._height = 500;
                 target_mc._width = 700;
              };

              • 4. Re: Progress animation for loading SWF question
                cyrus999a Level 1

                I thought I had to do something with the onLoadInit function, but I thought I had to put something at the end of the code, after the LoadClip function...

                 

                anyway, your code works!!

                Thanks a lot!!

                 

                Cyrus