1 Reply Latest reply on Apr 18, 2007 4:01 PM by kglad

    Dynamic mc names

    Neto Bomfim
      Hi there,

      Im having a litlle issue. ill try to explain:

      I have a function that creates dynamic movieclips after making a query by flash remoting. It calls this function for each record.

      Here it is:

      function createPictures(b) {
      this.createEmptyMovieClip("l"+b, this.getNextHighestDepth());
      this["l"+b].attachMovie("picture", "lod", this["l"+b].getNextHighestDepth());
      meuLod.loadClip(path for picture,this["l"+b].lod);
      this["l"+b]._x = 2000;

      the "b" its a dynamic value that begins with 0 and goes increasing. When the person visit this sesson of the website she will see a picture that can be draged through the screen. When one of these pictures reach the screen corner she goes away and the next picture shows on the screen.

      So, in the action script i must tell the next movieclip to move. that is how im doing:

      this["l"+b].onRelease = this["l"+b].onReleaseOutside = function(){
      //the movieclip goes away here
      this.tween("_x",this._xmouse - inicioX,2);
      this.tween("_y",this._ymouse - inicioY,2);

      //and the next should come here

      My problem its to tell flash the name of the next movieclip. As the function its called many times, even if i say this["l"+(b+1)] it would not work because the next movieclip still doesnt exist |o|

      I already tried to separete like one function to create the movieclips and another to tell their actions, but it didnt worked.

      Im sorry one more time if my english its not so nice. Just tell me if its confusing.

      Thanks, and good day.