How to convert the calculating result to int in actionscript 3?
count = "400"/3 - 1;
How to convert the above count
t开发者_JS百科o int
?
var countInt:int = int(count);
Integers are easy if you use math!
Specifically, Math.floor(count) will give you the classic integer version of this by throwing away the non-integer part, while Math.round(count) will round to the nearest integer. I'd suggest going with Math.floor though as it's probably closer to what you mean.
精彩评论