Groups | Blog | Home
all groups > flash actionscript > march 2006 >

flash actionscript : The Text fields Variable!!


ebad293
3/23/2006 10:58:10 PM
I have a button ; the textField on that is dynamic and has a variable.
I want to fill in the variable from _root but it doesnt!!!
EX:
(My textField is in a moiveClip).
I used this action:
_root.buttonName.movieName(contains-TextField).VariableName = "String";
whats the problem with that??? :(
TimSymons
3/24/2006 12:33:48 AM
You can't do that with a button. If you want to make the label dynamic then the
"button" has to actually be a movieclip. To get the movieclip to act kind of
like the button object does you will need to label the first for frames as:

_up
_over
_down
_hit

then put a stop(); action on the first frame. You can then program it like you
normally would a button. This is not the only way but it will work.

Tim
ebad293
3/24/2006 10:51:19 PM
Hey thanks i clould make a button with a movieclip but i wana know whats the problem?
am i right?;
TimSymons
3/25/2006 9:29:47 PM
You can't use button instances like you can a movieclip instance. Basically you
are just seeing one of the limitations,from a programming view point,with
buttons.

Once you turn the button into a movieclip, what you had written will work.

Tim
AddThis Social Bookmark Button