3 Replies Latest reply on Feb 6, 2009 3:35 PM by clbeech

    Variable movieclip in loadClip()

    sthorpe22
      Is there a way to user a variable in loadClip() for the movieclip? I need to loop through a series of nodes in an XML file, create movieclips for each and load them. The code i tried is below:

      for(i=0;i<_global.sceneObjects[_global.sceneCounter].length;i++){
      myname = "my_mc" + i
      this.createEmptyMovieClip(myname, 0);
      eval("my_mc" + i).createEmptyMovieClip("container_mc",99);
      var objListener:Object = new Object();
      objListener.onLoadInit = function(target_mc:MovieClip){
      target_mc._x = _global.sceneObjectsX[_global.sceneCounter] ;
      target_mc._y = _global.sceneObjectsY[_global.sceneCounter]
      ;
      };
      var obj_mc:MovieClipLoader = new MovieClipLoader();
      obj_mc.addListener(objListener);
      trace("objects/" + _global.sceneObjects[_global.sceneCounter] );
      obj_mc.loadClip("objects/" + _global.sceneObjects[_global.sceneCounter]
      ,eval("my_mc" + i).container_mc);
      }

      Any suggestions?

      Thanks in advance!