有没有办法在动作脚本中做类似的事情import <BLAH> as
?我有一些类,我不想每次使用它们时都输入完整的类名。这就是为什么我试图找到一个导入为,或var C = ImportedClassThatIDontWantToTypeEveryTime
。我尝试了几种不同的方法,例如:
package com.mysite.blah {
// doesn't work
import com.mysite.ImportedClassThatIDontWantToTypeEveryTime as C;
// also doesn't work
import com.mysite.ImportedClassThatIDontWantToTypeEveryTime;
var C:Class = ImportedClassThatIDontWantToTypeEveryTime;
// ????
public class SomeOtherClass {
public function blah():void {
C.doSomething();
}
}
}
我知道有办法做到这一点——几年前我就做过了。但是,我不记得该怎么做。帮助?