0 Replies Latest reply on Jun 8, 2006 2:39 AM by oilspilltraining

    MovieClipLoader.loadClip with Object.registerClass

    oilspilltraining
      Basically is it possible to use MovieClipLoader.loadClip and then Object.registerClass together.

      I can make the following work where mc_blank is a movieClip in the library
      Object.registerClass("mc_blank", myClass) ;
      var mcPage:MovieClip = attachMovie ("mc_blank", "mcPage_" + i, i);

      But now the movieclip is not in the library, it is something that has been designed externally but I need it to work as a class. So can I load in a swf then attach a class to it? Such as the following

      mclLoader = new MovieClipLoader ();
      objListener_mcl = new Object ();
      objListener_mcl.target = this;
      objListener_mcl.onLoadInit = function (target_mc:MovieClip) {
      Object.registerClass(target_mc._name, myClass) ;
      };
      var mcPage:MovieClip = this.createEmptyMovieClip("mcPage_" + nextDepth, nextDepth);
      mclLoader.loadClip ("register.swf", mcPage);