2 Replies Latest reply on Apr 9, 2007 11:21 AM by Dr._Goomba

    dynamically position elements

      i have two elements that are on one line, both elements can have different lengths. i am having trouble dynamically positioning these items

      this.text1.text = "some dynamic text";
      this.text2.text="some more";
      this.text2.x = this.text1.textWidth + this.text1.x + 10;

      When a user selects an item from the grid, the showView method runs, and displays the appropriate text. This method does not seem to want to consistently put 10px between both elements. Some words it will work, but you it takes two clicks in order to position correctly. But this seems to only work when the width of the text1 element is longer then the next selected item. Otherwise if the current item's length is shorter than the next, it will never position correctly but just overlay.

      How can i get these to position as expected? Thanks!