ForumsProgramming Forum

Text in Flash

Posted Apr 24, '13 at 3:22am



4 posts

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.


Posted Apr 24, '13 at 4:06am



25 posts

Make it dynamic from properties. Have in mind that you must embed the fonts used in that textfield though.


Posted Apr 24, '13 at 11:11am



1,292 posts


//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

Reply to Text in Flash

You must be logged in to post a reply!