1 Reply Latest reply on Jul 30, 2010 12:42 AM by aditi_bk

    Moviecliploader onloadInit only showing 100

    aditi_bk

      Hi,

       

      I am using a moviecliploader object to load a clip into the timeline. I have a loader movieclip for the graphic placed on the stage. The idea is to gotoAndplay a certain frame as per the percent loaded so far. But the percent value is always 100. Is this because I am testing it on my local machine? But even so, shouldn't every trace fire, as percent value will fall in these categories sometime. The code within onloadInit is:

       

      ldrlistener.onLoadProgress = function(_mc:MovieClip, loaded:Number, total:Number) {
          var prcnt:Number = (loaded/total)*100;

          if(prcnt == 10) {ldgraphic.gotoAndPlay("ten");
                          trace("loading:10");}
          if(prcnt == 15) {ldgraphic.gotoAndPlay("fifteen");
                          trace("loading:15");}
          if(prcnt == 20) {ldgraphic.gotoAndPlay("twenty");
                          trace("loading:20");}
          if(prcnt == 25) {ldgraphic.gotoAndPlay("twentyfive");
                          trace("loading:25");}
          if(prcnt == 30) {ldgraphic.gotoAndPlay("thirty");
                              trace("loading:30");}
          if(prcnt == 40) {ldgraphic.gotoAndPlay("forty");
                          trace("loading:40");}
          if(prcnt == 50) {ldgraphic.gotoAndPlay("fifty");
                          trace("loading:50");}
          if(prcnt == 55) {ldgraphic.gotoAndPlay("fiftyfive");
                          trace("loading:55");}
          if(prcnt == 60) {ldgraphic.gotoAndPlay("sixty");
                          trace("loading:60");}
          if(prcnt == 70) {ldgraphic.gotoAndPlay("seventy");
                          trace("loading:70");}
          if(prcnt == 80) {ldgraphic.gotoAndPlay("eighty");
                          trace("loading:80");}
          if(prcnt == 100) {ldgraphic.gotoAndPlay("hundred");
                          trace("loading:100");}
      };

      ldrlistener.onLoadInit = function(_mc:MovieClip) {
          ldrgraphic._alpha = 0;
          trace("load completed");
      };

       

      Also, ldrgraphic._alpha is not happening. What am I doing wrong? The output only shows loading:100.

        • 1. Re: Moviecliploader onloadInit only showing 100
          aditi_bk Level 1

          Ok fixed two things. I had misspelt ldgraphic as ldrgraphic, hence it was not accessing it in onLoadInit, also I am sorry but the problem is within onloadProgress not onloadInit.

           

          I also tested it on the server but still no luck, it does not show the loader. Is there an error in the onloadProgress code??? Am I missing something?? Any help will be greatly appreciated.