Get the Class type of an object

Say I created an object like this:

var p = new BasketBall();

I want to access a certain property of p, such that it would return “BasketBall” or anytihng to indicate for me the class type. Is that possible?

Thanks

This is a total hack, but you could use this.

var p:MovieClip = new MovieClip();
var pType:String = p.toString().substr(p.toString().indexOf(" ")+1);
pType = pType.substr(0,pType.length-1);
trace("hmm. "+ pType);

http://livedocs.adobe.com/flex/3/langref/flash/utils/package.html#getQualifiedClassName()

Im sure there’s somethign much easier than that …

is this hack cuz there’s nothing else available?! Or just cuz it’s quick & dirty? There should be a way to access the type. I mean, when you trace the object, it tells you P: [object BasketBall] , so there must be a way to get “BasketBall”

Any ideas?

Thanks Sephiroth!