Thats why you always tell flash what kind of a variable it is when you instantiate it.
var kuf:Number=0;
var stats:Object={}
var array:Array=[]
and so on and so forth.
In classes instead of instantiating a bunch of variables, I just use one:
var stats:Object={}
then when I need to use a ton of variable in my functions I reference the stats Object and create a variable right then and there: stats.x=67; stats.y=5; and when you want a number to be a string you either put it in quotations, or use stats.x.tostring();