#1
  1. No Profile Picture
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2002
    Location
    Newcastle, UK
    Posts
    19
    Rep Power
    0

    Flash MX - Dynamic Text Field Positioning...


    Hi,

    I have 2 dynamic text fields, drawing their content from a text file containing 2 variables (text). Both text fields are set to autosize, so they change in width according to the amount of characters in the variable.

    I also have the following code to position text field 2 to the right of text field 1:

    textField2._x = textField1._x + textField1._width + 5;
    textField2._y = textField1._y;

    When the textfield is static, it works fine. However, using dynamic text seems to be a problem and the right field just displays 5 pixels from the left x position of text field 1.... I think the problem is the way i've set up the script - it doesn't appear to recognise the width of textfield 1 as set by the autosize command.

    If anyone can help I'd be very much obliged.
    Cheers
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2003
    Location
    Provo
    Posts
    36
    Rep Power
    12
    You'll probably want to look into the 'onChanged' event handler for the Text Field Object in Flash MX.

    I'd set it to handle the repositioning of the second text field.

IMN logo majestic logo threadwatch logo seochat tools logo