0 Replies Latest reply on Feb 8, 2007 2:14 AM by MikeLB

    targeting dynamic instance

    MikeLB Level 1
      Hello, just a quick levels issue (maybe) or me being out of me depth as usual - quick summary, Im creating several movieclips on the fly and adding external images to them. These mcs then become moveable and I want the user to drag them into a preference dropbox "Good","Not Sure" etc.. which are other movieclips - because the user can drag several mcs into any one dropbox I'll need a routine to scale and position the selected mcs - because of this my approach thus far has been to remove the mcs from the main timeline and add them to the dropbox with the same name and image etc. and give that dropbox a function to scale and postion (have'nt thought of that one yet...) I am adding and removing the mc with this function
      function isindropbox(mc:MovieClip){ //mc is the name of the mc to add
      for(var z in dropboxArry) {
      if ((eval(dropboxArry[z])).hitTest(_xmouse, _ymouse, false)) { //checks if mouse is released in dropbox
      var pic_mcchosen:MovieClipLoader = new MovieClipLoader();
      pic_mcchosen.loadClip("images/"+mc._name+".jpg", (eval(dropboxArry[z])).createEmptyMovieClip(mc._name+"A", this.getNextHighestDepth()));
      deleteThis = eval(mc._name);
      removeMovieClip(_root.deleteThis);

      all this works fine and I can see the mc in this scenario "MarsA" being generated in the selected dropbox, but I can't within the same function reference it i.e.
      trace(this.holder_ins1["MarsA"]._width); // or
      trace(_root.holder_ins1["MarsA"]._width);// returns 0

      yet if I have a button on the stage elsewhere calling this:
      tempbutt_mc.onPress = function () {
      trace(_root.holder_ins1["MarsA"]._width);
      } // returns the correct width

      does a dynamically created instance not get registered with a player until the function that made it finishes??

      Thanks in advance