Mr_Splash
asked on
AS3 Concatenate integers
Hello,
I'm trying to concatenate three different integers to make a string with the code below. However I'm getting the following error.
1067: Implicit coercion of a value of type Number to an unrelated type String.
Can anyone tell me how to do this?
Also I have very little knowledge of AS are the functions correct to produce; Random Number between 0-99 - Seconds since 01/01/1970 - Random Number between 0-99? for example...
If part 1 came back as 45, part two came back as 1234567890 and part 3 came back as 12 I would want the uniqueKey var to be 45123456789012 NOT 1234567947
I'm trying to concatenate three different integers to make a string with the code below. However I'm getting the following error.
1067: Implicit coercion of a value of type Number to an unrelated type String.
Can anyone tell me how to do this?
Also I have very little knowledge of AS are the functions correct to produce; Random Number between 0-99 - Seconds since 01/01/1970 - Random Number between 0-99? for example...
If part 1 came back as 45, part two came back as 1234567890 and part 3 came back as 12 I would want the uniqueKey var to be 45123456789012 NOT 1234567947
var now:Date = new Date();
var uniqueKey:String = (Math.random()*99) + now.getTime() + (Math.random()*99);
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
This is all that was needed in the end.
var uniqueKey:String = (Math.round(Math.random()*
Please let me know if there is something incorrect with that.