9 Replies Latest reply on Jun 25, 2009 12:56 PM by kglad

    Progress Loader Text won't show up?

    cmoadobe

      I have a SWF file that is the first frame of the movie and it's only purpose is to load in another SWF and show text corresponding to the progress of download completion.  When I test the movie (Simulate Download) it just simulates without showing my text with percentage complete.  The only way I can get it to show, is if I add a button to click to make it show.  How can I get it, so that when someone opens the movie, it will start the download process, show the percentage, and then upon completion, start the UILoader movie?

       

      Here is my AS3 code: notice the button I had to put in at the top...which is not what I want....

       

      btn1_btn.addEventListener(MouseEvent.CLICK, loadFile);

       

      function loadFile(e:Event):void {

      CMOLoader.load(new URLRequest("CMO.swf"));

      CMOLoader.addEventListener(ProgressEvent.PROGRESS, progressHandler);

      CMOLoader.addEventListener(Event.COMPLETE, completeHandler);

      }

       

      function progressHandler(e:ProgressEvent):void {

      prog_txt.visible=true;

      var percent:int=CMOLoader.percentLoaded;

      prog_txt.text=percent+"%";

      }

       

      function completeHandler(event:Event):void {

      prog_txt.visible=false;

      CMOLoader.removeEventListener(ProgressEvent.PROGRESS, progressHandler);

      CMOLoader.removeEventListener(Event.COMPLETE, completeHandler);

      }

       

       

       

      Also in Simulate Download, once it completes load, shouldn't the movie play with out freezing?  Because when I do it, I wait for the download process and then the SWF loads, but it's choppy....it "downloaded" the whole file, it should run seamless right?

       

      Long post but I appreciate any help....

        • 1. Re: Progress Loader Text won't show up?
          kglad Adobe Community Professional & MVP

          use:


          loadFile();

           

          function loadFile():void{

          CMOLoader.load(new URLRequest("CMO.swf"));

          CMOLoader.addEventListener(ProgressEvent.PROGRESS, progressHandler);

          CMOLoader.addEventListener(Event.COMPLETE, completeHandler);

          }

           

          function progressHandler(e:ProgressEvent):void {

          prog_txt.visible=true;

          var percent:int=CMOLoader.percentLoaded;

          prog_txt.text=percent+"%";

          }

           

          function completeHandler(event:Event):void {

          prog_txt.visible=false;

          CMOLoader.removeEventListener(ProgressEvent.PROGRESS, progressHandler);

          CMOLoader.removeEventListener(Event.COMPLETE, completeHandler);

          }

           

           

           

          Also in Simulate Download, once it completes load, shouldn't the movie play with out freezing?  Because when I do it, I wait for the download process and then the SWF loads, but it's choppy....it "downloaded" the whole file, it should run seamless right?

           

          not necessarily.  if there are things in your swf that tax your computer, then you may see a "choppy" presentation despite preloading.  in fact, the most common problem(s) causing a choppy presentation are not related to downloading.

          • 2. Re: Progress Loader Text won't show up?
            cmoadobe Level 1

            Thanks for the quick response...so the text did show up, but the embedded SWF starts playing at around 60% completion of the "download."

             

            What does that mean?

            • 3. Re: Progress Loader Text won't show up?
              kglad Adobe Community Professional & MVP

              it means you're exporting assets/classes in frame 1 and/or you're embedding fonts.

              1 person found this helpful
              • 4. Re: Progress Loader Text won't show up?
                cmoadobe Level 1

                To be honest I'm pretty new at this...not sure what classes even mean haha.  How would I go about fixing the problem?  Thanks for your previous answer though!

                • 5. Re: Progress Loader Text won't show up?
                  kglad Adobe Community Professional & MVP

                  open your library panel.  do you see anything with a linkage?

                   

                  all objects that have a linkage defined will be loaded before your preloader appears.

                   

                  do have any textfields (static or non-static with embedded fonts)?

                   

                  all those fonts will be loaded before your preloader appears.

                   

                  can you determine the main problem?

                  • 6. Re: Progress Loader Text won't show up?
                    cmoadobe Level 1

                    The only thing I see with a Linkage in either file (the loader file or the original file being loaded) is the UILoader in my Library.  Under Linkages it says "Export: fl.containers.UILoader."  But that's the main video that's addressed in my AS, shouldn't it wait till the loader is done?

                     

                    And that's it...in my original file there are no linkages.  There are text boxes, but they aren't even present until halfway through the video.  Some other forum I saw someone with a similar issue, and the response had something to do with addChild().  I don't know if that's right for my file though.  Should I upload the file?

                     

                    Thanks...

                    • 7. Re: Progress Loader Text won't show up?
                      kglad Adobe Community Professional & MVP

                      components are problematic.  but if you're using one for your preloader, you're stuck with it loading before your preloader displays.

                       

                      watch for embedded fonts in those textfields, too.

                      • 8. Re: Progress Loader Text won't show up?
                        cmoadobe Level 1

                        I appreciate your help!  I assume there is some AS that can load my file instead of a component.  I will look into finding that so my file will run properly.  Thanks again!

                        • 9. Re: Progress Loader Text won't show up?
                          kglad Adobe Community Professional & MVP

                          yes, check the loader class.  it has everything you need.