hi John,
the trick is to make invisible buttons stacked ontop of another layer
where you have dynamic text fields.
the invisible button is set to be the same height/width as the text
field [with code you can make it match the text's width/height if its
dynamic], and then with code you can assign the dynamic text field the
text you want at run time.
you shouldn't place the text and the button in the same button object.
what you have it is a movie clip that inside of it has a text layer, and
a button layer. you can then duplicate this item from the library at run
time. alternatively you can create them at runtime with code too, then
you would only need to have the invisible button in the library, it all
depends on your total architecture[/coding] style.
if you are not seeing text, it could also be an embed fonts issue, as
flash is really a pain when it comes to that, it wants very particular
settings and then it will work just fine. to isolate if its an embed
issue or not, you can always set the field's embed value to "false'
which will make it show [unformatted] text, but at least then you know
its actually receiving the *.text value you are passing it.
hope this helps!
John Trentini wrote:
Hi folks,
Can 'button's be created with a label (textField) that can be updated
dynamically?
I have tried but the dynamic text, not only i could not get it to change
but it does not recognise the mouse, in spite of having the 'selected'
property set to false. Can this be done?
I want to build a menu made up of just lables (the names of the various
sections to navigate to) with the info (the text) to be dynamically
uploaded from an external file. I thought I could just use the
array._length to attach as many buttons as there are entries and then
use the array elements to populate their labels. Any tips?
Ideally I would have preferred to be able to create the button entirely
with actionScript but may be I am asking the impossible?
Cheers
JohnT
_______________________________________________
[email protected]
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com
_______________________________________________
[email protected]
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com