static text | variable | static text


i'm thinking need simple actionscript i'm not sure. have dynamic text field loading variable named count. place static text on either side of value of variable. since variable integer increase, it's horizontal width increase well. can't place 2 strings of static text on either side of variable grow in width on time. make sense?

essentially, want have dynamic text box display string of text, value of variable (that change in length), string of text, seamless, looking if typed whole sentence in word processor. time!

let have dynamic text field instance name my_txt
when want increase value, run my_txt.text++;
when want decrease value, run my_txt.text--;

now, convert dynamic text field movieclip symbol,
set instance name my_mc

now, set value of text, should use
my_mc.my_txt.text++;

but not going set value in way.
now, go my_mc movieclip, select 1st frame, attach script:


var actualvalue:number = number(this.my_txt.text);
var displayvalue:string = "";
function setvalue(d) {
actualvalue += d;
displayvalue = "something"+actualvalue+"something";
my_txt.text = displayvalue;
}
setvalue(0);


go maim timeline. , now,
when want increase value, use my_mc.setvalue(1);
when want increase value, use my_mc.setvalue(-1);



More discussions in ActionScript 1 and 2


adobe

Comments

Popular posts from this blog

CAN'T INSTALL MAMBELFISH 1.5 FROM DIRECTORY - Joomla! Forum - community, help and support

error: expected initializer before 'void'

CPU load monitoring using GPIO and leds - Raspberry Pi Forums