3 Replies Latest reply on Jul 20, 2010 1:51 PM by kglad

    MovieClipLoader error

    aditi_bk Level 1

      I looked up MovieClipLoader tutorials and finally came up with the code:

       

      var myMCL:MovieClipLoader = new MovieClipLoader();

       

      var loadListener:Object = new Object();

       

      myMCL.addListener(loadListener);

       

      loadListener.onLoadProgress = function(target_mc:MovieClip, bytesLoaded:Number, bytesTotal:Number):Void
      {
          var perc:Number = (bytesLoaded / bytesTotal) * 100;
          prcnt.text = perc + " %";
      }

       

      loadListener.onLoadInit = function(target_mc:MovieClip)
      {
          trace( target_mc + " finished loading so display on screen now. " );
             
          prcnt.text = "init";
         
      };

       

      loadListener.onLoadError = function(target_mc:MovieClip, errorCode:String, httpStatus:Number)
      {
          trace( "error loading image : errorCode : " + errorCode );
      }

       

       

      loadListener.onLoadStart = function(target_mc:MovieClip)
      {
          trace( target_mc + " start loading. maybe you want to do something here? " );
          prcnt.text = "onstart";
      };

       

      myMCL.loadClip("filename.swf", mcholder);  //mcholder is the movie clip holder placed on stage manually

       

      The problem here is that the file does not move beyond printing this:

       

      _level0.mcholder start loading. maybe you want to do something here?
      _level0.mcholder start loading. maybe you want to do something here?
      _level0.mcholder start loading. maybe you want to do something here?
      _level0.mcholder start loading. maybe you want to do something here?
      _level0.mcholder start loading. maybe you want to do something here?
      _level0.mcholder start loading. maybe you want to do something here?
      _level0.mcholder start loading. maybe you want to do something here?

       

      Why is this happening? The code is directly from the tutorial. I have included all event functions, in case they are something like abstract functions, I don't know if this is required or not. I know I must be being a pain, but no one seems to be answering my question. I can't figure out what is wrong with the code, seems simple enough to me. I am sure I am missing some basic point. Any help will be greatly appreciated...