Forums → Programming Forum → Text in Flash
- 2 Replies
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.
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!
We strive to deliver the best gaming experiences on the internet and on your mobile phone. Play thousands of free online games, get access to free mmorpg games, online rpg games, fun online flash games, and more.
We offer free flash games in many different genres: online shooting games, online puzzle games, online war games, free online car games, free online hidden object games and dozens more.
This is the best place on the web to play online games for free! No matter what game style you prefer, we've got it here.
Want to advertise on Armor Games? Send us a note!
Gaming websites, passionate bloggers, and quirky streamers are welcome to share or review our games. If you need game keys, art, trailers, screenshots or more check out our press kit website.
Game developer? Visit developers.armorgames.com to request AG developer status, find documentation on our APIs, and get access to our development environment. Let's make sweet, sweet games together.
Looking for a publishing partner that can help your app rocket to success? Contact the mobile team to learn more about how we can help!