A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: buttons

  1. #1
    Junior Member
    Join Date
    Dec 2005
    Posts
    4

    buttons

    I want to dynamically change the size of the buttons depending on the lenght of the text contained in it. the text is getting dynamically loaded from an XML file and the length of the text may vary from button to button.

    If the text in one button is very long the buttons start overlapping..

    can somebody help me out with this.

    Thanks

  2. #2
    _global.chosenson="flash"; chosenson's Avatar
    Join Date
    Jul 2002
    Location
    BIG APPLE
    Posts
    716
    An idea just off the top of my head: Given that same font would be used you could acquire a base measurement of how much space is necessary for each letter. I would gain this by checking how much space the widest letter would need. Now if the button in question can hold 5 letters you would need to create a script which would compare the amount of letters imported and adjust the width of the button accordingly.
    If you have a question, need some help, email me:chosenson

    It's always the simplest things that escape the complex mind!

    always be just

  3. #3
    Senior Member corky§urprise's Avatar
    Join Date
    Jun 2005
    Posts
    346
    That, is no good to the poor guy

    Have something like on your button:
    onClipEvent(load) {
    _width=_root.variableName.length*100
    }

    ?

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