11 Replies Latest reply on Jan 19, 2010 11:09 AM by kglad

    My preoader does't work.

    ObsidianArch

      I've been working on this preloader for over a week now, and I've just about had it.

      My script has no errors, but when I test the movie, the movie I want to play is all messed up.

      The music in my movie is double playing (like over-lapped), and the preloader doesn't even show up. I had to remove the music and make alot of changes, just so the file is small enough to attach.

      Please, if anyone can look at my .FLA file and figure out what I'm doing wrong, it would help me a great deal.

      Thank you so much.

        • 1. Re: My preoader does't work.
          kglad Adobe Community Professional & MVP

          you're publishing for as2 and you're using as3 code.  that won't work.

          1 person found this helpful
          • 2. Re: My preoader does't work.
            ObsidianArch Level 1

            Thank you kglad, I don't think I ever would have figured that out. Now I'm presented with another problem.

            I switched the AS to 3 instead of 2, now when I test the movie, it shows the preloader, but not the movie I want preloaded.

            The preloader just keeps flashing like its looping. I have a stop(); action on the first frame, I'm not sure why it's doing this

            Do you suppose you could aid me a little further, to help me fix my preloader.

            • 3. Re: My preoader does't work.
              kglad Adobe Community Professional & MVP

              do you have code to load that swf?  if yes, copy and paste that code.

              1 person found this helpful
              • 4. Re: My preoader does't work.
                ObsidianArch Level 1

                I'm not sure if I do or not, I have this on the first frame.   stop();  loaderF(); function loaderF(){     var toLoad:Number = loaderInfo.bytesTotal;     var loaded:Number = loaderInfo.bytesLoaded;     var total:Number = loaded/toLoad;     if(loaded == toLoad){         //removeEventListener(Event.ENTER_FRAME, loaderF);         gotoAndStop(2);     } else {         preloader_mc.preloaderFill_mc.scaleX = total;         preloader_mc.percent_txt.text = Math.floor(total*100) + "%";         preloader_mc.ofBytes_txt.text = loaded + "bytes";         preloader_mc.totalBytes.text = toLoad + "bytes";     } }   I want whatever is in frame 2 to play, I have a mc clalled mc_bond_intro that I want to play.But only the preloader shows up. Is there extra code I'm misssing? I took a few tutorials and none of them said anything about code for the mc that you want to preload.

                • 5. Re: My preoader does't work.
                  ObsidianArch Level 1

                  well that didn't display the way it was supposed to, sorry for that.

                  If you gimme a sec I'll try to make it more clear.

                  • 6. Re: My preoader does't work.
                    ObsidianArch Level 1

                    stop();

                     

                    loaderF();

                         var toLoad:Number = loaderInfo.bytesTotal;

                         var loaded:Number = loaderInfo.bytesLoaded;

                         var total:Number = loaded/toLoad;

                    if (loaded == toLoad) {

                         //removeEventListener (Event.ENTER_FRAME, loaderF);

                    } else {

                         preloader_mc.preloaderFill_mc.scaleX = total;

                         preloader_mc.percent_txt.text = Math.floor(total*100) + "%";

                         preloader_mc.ofBytes_txt.text = loaded + "bytes";

                         preloader_mc.totalBytes.text = toLoad + "bytes";

                         }

                    }

                     

                    this is the code I have on the first frame, is this not enough to preload and play an mc in frame 2?

                    • 7. Re: My preoader does't work.
                      kglad Adobe Community Professional & MVP

                      if you want to preload the swf that contains that code, use:

                       

                      ObsidianArch wrote:

                       

                      stop();

                      this.addEventListener(Event.ENTER_FRAME,loaderF);

                       

                      function loaderF(e:Event);

                           var toLoad:Number = loaderInfo.bytesTotal;

                           var loaded:Number = loaderInfo.bytesLoaded;

                           var total:Number = loaded/toLoad;

                      if (loaded == toLoad) {

                           this.removeEventListener (Event.ENTER_FRAME, loaderF);

                      removeChild(preloader_mc);

                      play();

                      } else {

                           preloader_mc.preloaderFill_mc.scaleX = total;

                           preloader_mc.percent_txt.text = Math.floor(total*100) + "%";

                           preloader_mc.ofBytes_txt.text = loaded + "bytes";

                           preloader_mc.totalBytes.text = toLoad + "bytes";

                           }

                      }

                       

                       

                      • 8. Re: My preoader does't work.
                        ObsidianArch Level 1

                        Thank you for assisting me in this matter. I can't believe how difficult a time I'm having with this issue.

                        I tried the code you gave me and it still is preloading the same way as before, the preloader shows up and starts flashing, and the swf I want to play after the preload, never show at all, also now my button dosn't work now with AS3, how do I make a button load a URL now that I've changed action script, I really don't understand why it would be different. I've attatched the file if you want a look. I have no idea why this is happening. please continue to help me, thank you.

                        • 9. Re: My preoader does't work.
                          kglad Adobe Community Professional & MVP

                          you now have a mixture of as2 and as3 and again, your preloader code is preloading the swf that contains your code.

                           

                          you have so many problems that you should either start over or hire someone to redo this for you.

                           

                          to start:  you can't attach any code to objects in as3 and you can't preload anything using getURL() or its equivalent in as3, navigateToURL().  use the as3 loader class.

                          • 10. Re: My preoader does't work.
                            ObsidianArch Level 1

                            well this will be like the 12th attempt, I thought a preloader would be easy, at least every tutorial I've taken said they are, I wish someone would direct me to a good preloader tutorial that won't give me so much trouble, I don't care what AS that is used, as long as it works. thank you kglad, you've been very helpful. I'm sure after I made another attempt or two, I'll most likely be back here looking for help again, maybe you'll consider helping me again.

                            • 11. Re: My preoader does't work.
                              kglad Adobe Community Professional & MVP

                              attached is a file that shows how to use as3 to load and display the load progress of an external swf.