Skip to content

Instantly share code, notes, and snippets.

@nowri
Created March 19, 2012 12:54
Show Gist options
  • Save nowri/2111029 to your computer and use it in GitHub Desktop.
Save nowri/2111029 to your computer and use it in GitHub Desktop.
表示オブジェクトからgetQualifiedClassName使って、クラス名取得
// @see http://un-q.net/2010/02/new_class_as3_getqualifiedclassname.html
var a = getChildAt(0); // 参照があればなんでもおk
//どっちでもおk
//var className:String = describeType(a).@name;
var className:String = getQualifiedClassName(a);
var c:Class = Class(getDefinitionByName(className)); // これはクラスそのものなので、、これをaddChildしてもだめ。
addChild(new c());
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment