15 Replies Latest reply on Dec 17, 2010 9:25 PM by kglad

    My preloader doesn't want to work

    Kumidan Level 1

      I'm creating a website using Flash CS5 and AS3.

      For this website I've put a preloader on the 1st frame and the site on the 2nd.

      I've tested the site after having created a small animation which makes appear the main menu, a logo and an image.

      Everything did work good, so I went on building the site.

      Now that I have created some pages I've tested again the whole site and the preloader doesn't work anymore.

       

      Testing the site on the "ctrl+enter" window and simulating the download I have a white background (both the preloader and website background are yellow) then I see the preloader for a fraction of second and suddenly the site appears.

       

      Publishing the site on my web space the background is correctly yellow, but the preloader doesn't appear, the browser's loading bar stops at half then the preloader appears again for a fraction of seconds and suddenly the site appears (tested on Firefox, IE, Opera, Chrome and Safari, same behaviour with all of them).

       

      It looks that the preloader is become part of the site and that there is an invisibile preloader.

       

      The setting in: Publish settings -> Flash -> Script Settings -> Library Path -> Default Linkage

      is set to "Merged into code"

      the same happen if I set "Runtime Shared Library" and "Custom Preloader Loop".

       

      Instead if I set the default preloader (ActionScript 3.0/rsls/loader_animation.swf) it appears correctly.

       

      My preloader should be good since it did work and I haven't modified it.

      What could cause this problem?

        • 1. Re: My preloader doesn't want to work
          kglad Adobe Community Professional & MVP

          if most of your assets are exported for actionscript, that will cause the problem you describe.  and any number of errors on your part can cause a preloader to fail.

           

          so, first thing is to check is your have a lot of  assets exported in frame 1 for actionscript.

          • 2. Re: My preloader doesn't want to work
            Kumidan Level 1

            On 1st frame I have nothing exported for actionscript, but I have 3 movie clips exported as classes for actionscript, they are 3 pages of my site and they are imported into a movieclip container, one of them as the site loads, others when menu buttons are clicked. When I click a button the shown page is removed and the new one is added.

             

            If this is the problem, how can I solve it?

            Why the default preloader works?

            Do I have to create an external preloader moviclip (a 2nd sw file) and import it as I do with the default one? Isn't there another solution?

            • 3. Re: My preloader doesn't want to work
              kglad Adobe Community Professional & MVP

              those 3 classes are exported in frame 1 unless you take steps to prevent that.  but 3 classes wouldn't typically cause a preloader problem.

               

              what's the flash profiler show is loading in frame 1 vs other frames?

              1 person found this helpful
              • 4. Re: My preloader doesn't want to work
                Kumidan Level 1

                This is my 1st experience with a Flash website, before of this I only made some simple animations for banners and few other things, I'm not used to use Flash so I'm not sure to understand you mean with "profiler".

                I've checked around on internet and everything related to profiler takes me to Flash Builder, I'm not using it, I'm doing everything in Flash CS5.

                 

                What should I check to answer your question about the profiler in use?

                • 5. Re: My preloader doesn't want to work
                  Kumidan Level 1

                  Oh, I've understood... here's what I have.

                   

                  Untitled-1.jpg

                  • 6. Re: My preloader doesn't want to work
                    Kumidan Level 1

                    Do all the library stuff's belongs to 1st frame?

                    If not I can't understand why 1st frame weight grows if I don't add anything to it.

                    On the contrary, if library counts for the 1st frame, what should I do to solve the situation?

                    • 7. Re: My preloader doesn't want to work
                      kglad Adobe Community Professional & MVP

                      so, you are exporting about 1mb of assets in your first frame.  that all will load first, then your preloader will display the loading of the last 0.1% of your site.

                       

                      so, what you're seeing is exactly as explained as the most common scenario causing that problem.

                       

                      to remedy, either:

                       

                      1.  create a new swf that contains only your preloader assets and loads your current/main swf and displays its load-progress or

                       

                      2.  change all your assets to load in frame 2.

                      • 8. Re: My preloader doesn't want to work
                        Kumidan Level 1

                        Thanks for your reply.

                        Earlier today I've tried to do what you say in point 1.

                        I created a preloader on a swf file, then the whole site on another one and on publish settings (the setting told in my 1st post) of the site I've pointed to my preloader swf.

                        The result has ben that the 1st frame was less than 32KB and the 2nd around 1MB, so a good situation.

                        The problem is that my preloader doesn't know the wheight of the 2nd frame, so it last only for the 32KB of the 1st frame, then I have a pause before to see the site due to the download of the 2nd frame.

                        How can I make my preloader know the wheight of the 2nd frame in order to have the correct behaviour?

                         

                        Another try I did has been to put the preloader on 1st frame, on the 2nd I only put a movieclip in which I loaded an external swf containing the whole site, again I had the problem that the preloader finished its work before to load the site's swf as said above.

                         

                        If your 2nd suggestion is easier to implement, what should I do to do it?

                        • 9. Re: My preloader doesn't want to work
                          kglad Adobe Community Professional & MVP

                          the publish settings preloader is for runtime shared libraries only.  are you using tlf textfields in your main swf?

                           

                          if not, that setting is, almost certainly, irrelevant for you.

                           

                          your preloader swf would contain code to create a loader like:

                           

                          var ldr:Loader=new Loader()

                          etc

                           

                          does it?

                          • 10. Re: My preloader doesn't want to work
                            Kumidan Level 1

                            I have few TLF text fields on one of my exported elements for AS, but I've already tried also changing them into classic textfields.

                             

                            This is the 1st time that I'm facing a prelaoder, so I've done everything as seen on a tutorial found on developphp.com website (this is the link to that tutorial http://www.developphp.com/Flash_tutorials/show_tutorial.php?tid=291) and it didn't use a Loader() variable, probably because their preloader is not on a different swf then the site.

                             

                            Can you give me some hint or link me any tutorial which explains how to create a stand alone preloader to add to another swf? I haven't found any.

                            • 11. Re: My preloader doesn't want to work
                              kglad Adobe Community Professional & MVP

                              in your new fla that will load your main swf, you can start with:

                               

                              var tf:TextField=new TextField();

                              addChild(tf):

                              tf.multiline=false;

                              tf.text="0% Loaded";

                              tf.autoSize="left";

                              tf.x=(stage.stageWidth-tf.width)/2;

                              tf.y=(stage.stageHeight-tf.height)/2;

                               

                              var ldr:Loader=new Loader();

                              ldr.contentLoaderInfo.addEventListener(Event.COMPLETE,completeF);

                              ldr.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS,progressF);

                              ldr.load(new URLRequest("main.swf"));  // assuming main.swf is the correct file name

                               

                              function complete(e:Event):void{

                              ldr.contentLoaderInfo.removeEventListener(Event.COMPLETE,completeF);

                              ldr.contentLoaderInfo.removeEventListener(ProgressEvent.PROGRESS,progressF);

                              removeChild(tf);

                              addChild(ldr);

                              }

                               

                              function progressF(e:ProgressEvent):void{

                              tf.text=Math.round(100*e.bytesLoaded/e.bytesTotal).toString()+"% Loaded";

                              }

                              • 12. Re: My preloader doesn't want to work
                                Kumidan Level 1

                                Ok, it almost works, I've adapted the code to my loader, now it correctly loads as I expected, I only have a problem with a "null element" which doesn't make appear my site as it does if started alone (it is not automatically resized)... but I think this is another problem, the preloader one is solved.

                                 

                                Thank you

                                • 13. Re: My preloader doesn't want to work
                                  kglad Adobe Community Professional & MVP

                                  you're welcome.

                                  • 14. Re: My preloader doesn't want to work
                                    Anthony Huff

                                    I think I'm having a similar problem on huffcommunications.com. When my logo is clicked, a drop down menu is supposed to happen but it takes about 15 seconds before the animation actually happens. Could you be so kind as to explain what you mean when you say 'export all assets to first frame' and how to do it.

                                     

                                    I guess I'm looking to preload my entire site, and I think that is what you began to answer here. Thanks a lot.

                                    • 15. Re: My preloader doesn't want to work
                                      kglad Adobe Community Professional & MVP

                                      that's default behavior and won't help a preloading problem.  exporting for frame 2 or beyond will help a first frame preloader.