Thanks! That did help, but it doesn't seem to work for a uint. Here's
my test code:
var testUint:uint = 1;
var testInt:int = -1;
var testNumber:Number = 1.1;
var testString:String = "test";
var testDate:Date = new Date();
var testArray:Array = new Array();
var test:Array = [testUint, testInt, testNumber, testString, testDate,
testArray];
for (var i:uint = 0; i < test.length; i++) {
var typeInfo:String = describeType(test[i])[EMAIL PROTECTED]();
trace(typeInfo);
}
And here's the output:
int
int
Number
String
Date
Array
I'm guessing there's no way to identify a uint -- is that correct?
--- In [email protected], "Alex Harui" <[EMAIL PROTECTED]> wrote:
>
> There is code that might help in
> DataGrid.as:itemEditorItemEditEndHandler
>
> ________________________________
>
> From: [email protected] [mailto:[EMAIL PROTECTED] On
> Behalf Of Paul Whitelock
> Sent: Thursday, May 15, 2008 12:31 PM
> To: [email protected]
> Subject: [flexcoders] How to tell if variable is an int, uint, or a
> Number?
>
>
>
> I have a situation where an untyped variable is passed in a method
> call and I need to determine the data type for the variable. My first
> thought was to use typeof, but typeof returns "number" for an int,
> uint, or a Number. The operator "is" will not work on primitives.
>
> Is there any way to determine the data type of an untyped primitive
> object?
>