views:

34

answers:

1

I have a tab button in a movieclip with 3 different states keyframed - popup, hover and up. I use the textfield on each state to show tab title - the problem is I cannot use the same position for the textfield on each keyframe, so I keyframed the textfield's position. And in both keyframes for the textfield it has an instance name tabText. And when I assign text to it - it changes on one keyframe only. How should I resolve this situation without adding the textfield programmatically?

+1  A: 

the only way to do this would be to add a variable that is containing the text and update the textfield with that every time you change keyframe. ideally you would avoid all of this and either use a static text for each frame or alternatively adjust the position programatically.

//initialising the variable, in frame one etc.
var content:String = "text in here";

// In every Keyframe
tabText.text = content;
shortstick
Thanks I added button title parameter in the constructor of TabButton and in each keyframe I call this.tabText.text = this.title
vian