This content has been marked as final. Show 6 replies
var num:Number = 285.43;
var arr:Array = num.toString().split(".").join("").split("");
BTW, 285.43 is a floating-point value (Number type in actionscript) --not an
yeah parse the integer and run whatever you need to on the split result and then piece it back to a single string before converting it back to integer.
Thanks for the quick reply SymTsb,
I just read that Flash doesnt particularly have an Integer data type, that is, if its a number - its regarded as an integer (unless specified as a String).
I've managed to split up my number using the charAt method - but I'm now having problems handling these seperate values. If I trace them, they come out fine - I can even do ++ on them and they increment. But when I try to send my animations to particular frames using these numbers - it just ends up on the final frame of the movieclip, rather than the number that is stored in the variable.
Any ideas? Hope that makes some sense!
Thanks for the replies everyone,
I've managed to fix this now, it's working properly now :D
Many thanks, Rich