Welcome to WebmasterWorld Guest from

Forum Moderators: open

Message Too Old, No Replies

Combinding variables.

How would I make var B and var A into one variable?



12:58 am on Sep 6, 2008 (gmt 0)

5+ Year Member

Lets say I wanted to make variable Bob and variable Joe into one variable, so if Bob=1, and Joe=2, the variable would be 3. Then, with that new variable that holds 3, how could I add B in front of it so it looked like B3?

New variable= B3



3:29 pm on Sep 9, 2008 (gmt 0)

5+ Year Member

Something like:

var temp:Number = Bob + Joe;
String new_var = temp as String;
new_var = "B" + temp;

...haven't tested it but this should work or show you the right direction


3:30 pm on Sep 9, 2008 (gmt 0)

5+ Year Member

for the last line, i meant:

new_var = "B" + new_var;


Featured Threads

Hot Threads This Week

Hot Threads This Month