Forums → Programming Forum → Text in Flash
Hi, I'm having trouble with text at the moment. What I'd like to do is enter a text box into a movieclip symbol so that I can have the text perform various animations (move, fade out by lowering alpha value, etc.) however I want the contents of the text box to be based on a variable and able to be changed multiple times during runtime. How do I accomplish this? I can enter a text box into a symbol and manipulate static text easily enough, but I mainly don't know how to change the contents with code during runtime.
- 2 Replies
Make it dynamic from properties. Have in mind that you must embed the fonts used in that textfield though.
//var properties or whatever var you want
var txtNum:Number = 1;
//leave blank at first
var text = "";
// add listener "variable_txt" is a dynamic text box
variable_txt.addEventListener (Event.ENTER_FRAME, varShow);
function varShow (event:Event)
variable_txt.text = String ("TEXT:"+txtNum+text);
you can change the number value or text value to whatever you want and the listener will update to show
You must be logged in to post a reply!