Switch type of object

Hi

I want to find out which type an object has.
Therefore I thought of the ‘switch’ statement, but how would you do that?
The following code does not work, but you will get the point of what I want to do.

switch (object)
{
	case is String:
	trace("string");
	case is Array:
	trace("array");
	default:
	trace("something else");
}

A way to solve this would of course be, the use of the ‘if’ statement.


if (object is String)
{
	trace("string");
}
else if (object is Array)
{
	trace("array");
}
else
{
	trace("something else");
}

Thanks in advance