AS3 Dynamic TextField not updating
This is nuts
I have a dynamic textfield on my stage with the instance name trackText
.
I have declared public var trackText:TextField;
.
When I trace trackText.text
it gives me exactly what I expect but the actual text on the stage does not update.
anyone have any ideas as to why?
public var trackText:TextField;
trackText.text = audioPl开发者_如何学Cayer.currentSong.title;
trace("trackText = " + trackText.text);
// gives me what i expect "track 1" etc..
but the text on the stage still says "loading..."
any help would be great ta
If you have one on the stage, then creating a new one with
public var trackText:TextField;
doesn't link it to the one on the stage but still allows it to have its own text as your trace statement shows. You would first need to say something like:
trackText = textFieldOnStageInstanceName;
In order to hook them up. Then you can change the text as you have done!
Note: You don't even need to declare a variable and instead just reference the instance name in the code through something like:
theDoc.textFieldOnStageInstanceName.text = "Yay!";
Hope this helped!!
Embed the chars you are using: properties panel -> embed
I think that you haven't assigned correctly to the textField.
Try increasing the width of the textField, and set its maxChars property.
精彩评论