Class reference vs. class name

var ClassReference:Class = flash.utils.getDefinitionByName("flash.display.Sprite") as Class;


var className:String = flash.utils.getQualifiedClassName(thisObj);

It seems that flash.utils.getQualifiedClassName would only take a reference to an instantiated object (as opposed to a class). For example, the following code would return null:


Which means there is no way of accessing a class name in a static member. For example, you cannot use these utility methods to get class name for your default CSS declaration since this requires we do this in a static method.

private static function classConstruct():Boolean


Here and here.


One Response to “Class reference vs. class name”

  1. Sergey Says:


    Please help me brother. I wish to know how to get package name by class name in actionscript 3. For instance `

    var className:String = ‘Sprite’;
    var package:String = getPackage(className);

    Is there such a technic?
    Thanks in advance

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: