homepage Welcome to WebmasterWorld Guest from 54.205.98.35
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member

Home / Forums Index / Code, Content, and Presentation / Flash and Shockwave
Forum Library, Charter, Moderator: open

Flash and Shockwave Forum

    
Combinding variables.
How would I make var B and var A into one variable?
MartinWeb




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

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?

Bob=1
Joe=2
New variable= B3

Thanks!
:)

 

corgan1003




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

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

corgan1003




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

for the last line, i meant:

new_var = "B" + new_var;

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / Flash and Shockwave
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved