1 Reply Latest reply on Dec 23, 2006 10:06 AM by kglad

    I have a problem placing dynamic text and button together

    ac1982
      Hi
      I have a problem placing dynamic text and button together inside a (dynamic) text field.
      quote:


      var mClip:MovieClip;
      var nDepth:Number;
      var nY:Number = 20;
      var myText:Array = new Array("1","2","3");

      for(var i:Number = 0; i < 3; i++)
      {
      nDepth = this.getNextHighestDepth();
      tContent.text += "Test" + i;
      mClip = this.attachMovie("Circle", "mClip" + nDepth, nDepth,{_x: 50, _y: nY});
      // Set nX so the next circle is to the right of the current
      // circle.
      nY += mClip._width + 5;

      mClip.onPress = function():Void
      {
      trace(this._name);
      };
      }
        • 1. Re: I have a problem placing dynamic text and button together
          kglad Adobe Community Professional & MVP
          i have no idea what your thread title and statement have to do with your code.

          your code instantiates 3 movieclips with onPress handlers and if you have a textfield with instance name tContent its text property will be changed (and look pretty screwy) by the for-loop.

          i infer that those things (mClip's and tContent) are you dynamic text and button that you're talking about, but i have no idea what you mean by placing them, "...together inside a (dynamic) text field."