Skip to main content
Participant
December 8, 2010
Question

Dynamic text not updating

  • December 8, 2010
  • 1 reply
  • 355 views

This seems like a simple problem, but I can't find any explanations as to why this is happening.

I want a menu with buttons, that when you rollover a button, text at  the bottom of the menu shows a little explanation of the button. In each  of my buttons I have something like this:

on (rollOver) {_global.tool="Speed"; trace(_global.tool);}
on (rollOut) {_global.tool=""; trace(_global.tool);}

I traced to see that the variable really is being updated when it's  supposed to, and it is. Problem is, the text at the bottom of the frame  isn't. It's dynamic text with the variable set as "_global.tool" At the  beginning of the flash I set _global.tool="none"; and it shows up as  "none" even when _global.tool has changed.  If I leave the menu and come back, then it has updated, but I need it to update while I'm on the menu.

Hope I explained well and that someone can help. Thanks in advance.

This topic has been closed for replies.

1 reply

Ned Murphy
Legend
December 8, 2010

I believe you cannot assign a compound variable name to a textfield.  I recommend you don't use the variable aspect of the textfield at all--they are fidgety and I avoid them.  Just assign an instance name to the textfield and assign the text to its text property...

on (rollOver) { toolTextField.text="Speed"; }
on (rollOut) { toolTextField.text=""; }

Kajio2Author
Participant
December 8, 2010

Thanks for the help and I'll probably do that in the future, but I ended up just having the menu flip between two frames so that it updates properly.  It works well, but it's a little sloppy for my tastes, so I'll definitely have to try your solution on future projects.

Ned Murphy
Legend
December 9, 2010

You're welcome