A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: onRoll >> bubble info ...

  1. #1
    Member
    Join Date
    Feb 2003
    Posts
    30

    onRoll >> bubble info ...

    Hi!

    I've got a set of 15 cubes representing each one a different color.
    Each cube is a button so, when i rollOn one of these, i want to show a bubble message (link with the mouse position) that tell the name of the color (it's only a background with a text beside).

    But the problem is that i want the background adjust with the text.
    EX. If the word is ORANGE, i want the background width set with that word so the background width will be different for ORANGE that BLUE.

    if the field width containing the word ORANGE is 100px, the background will be 100px .... for the field with the word BLUE (width = 50px) the back will be 60px .... understand ????

    How i can do that !!

    Steve

  2. #2
    Senior Member
    Join Date
    Apr 2000
    Location
    Northern Ireland
    Posts
    2,146
    You need to dynamically create a new textField, using createTextField(). I made an example ages ago ... you can pick it apart to see if it makes things any clearer.
    ----------
    "Build a man a fire, and he'll be warm for a day. Set a man on fire, and he'll be warm for the rest of his life." TERRY PRATCHETT

  3. #3
    Senior Member the_protectot's Avatar
    Join Date
    Jul 2003
    Posts
    401
    The key property is Textfield.autosize.

    When you dynamically create your text field, make sure this property is set to true.

    this.createTextField(label, level, x position, y position, width, height);

    this.label.autosize = true;

    And once you set autosize to true, the width and height of the textfield are overwritten.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center