Welcome to WebmasterWorld Guest from 184.108.40.206
Forum Moderators: open
I'm primarliy an ASPX developer, but I'm trying to learn a little flash. I've struck a problem, and was wondering if anyone could help!?
I have created a flash movie, and a button symbol. There is a text area in my button which I want to be able to change to say something different for each instance of the button.
I tried to do this by changing the text field in the button symbol to Dynamic Text and assigning it an instance name.
Then, from the action for a frame in the main timeline, I tried something like this...
this.ButtonInstance1.TextInstance.text = "This is a test";
... but this does nothing.
This seems like a really simple thing to want to do - anyone got any pointers on how to change the text for each instance of my button symbol?
That's the easiest way I can think to do it, short of having to create a different button symbol for each button.
But you should at least be able to change the text on the buttons?! How far would user interface designers get if every dialog box could have buttons, but they all had to say the same thing!
"Would you like to delete this file? Click YES or YES to continue."
... anyway - this has turned into a rant! Any other ideas?!
I define the text in my button dynamic text and give it the variable lvlmenu0text
I put an action in the frame (still in the button_)that says
lvlmenu0text = lglmenu0text;
then.. in the instances of the button in my main movie .. I set the variable that's to be displayed.. as an action in the keyframe as:
lilmenu01.lglmenu0text = "some button text here";
lilmenu02.lglmenu0text = "more darn text";
where lilmenu01, lilmenu02 etc.. is the name of the instance of the button.
there are probably easier ways of doing it - but this seems to work for me.. oh.. and I think my button is actually defined as a movie clip - but I'm not sure if this matters..
hope this has helped
The button AS would be:
//whatever action you want to happen