Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
当我尝试使用 getDefinitionByName() 获取 flex 类(任何 UIComponent)时,它告诉我该类未定义(并且我使用完整路径),但如果我尝试使用完整路径引用自定义类,然后它工作。顺便说一句,我的项目正在引用另一个项目。
把它放在你的代码中的某个地方:
var dummy:Array=[mx.containers.TabNavigator];
然后再试一次。Flash 编译器存在一个已知问题,即如果不在任何地方使用,它就不会使用类的类定义。这将强制编译器mx.containers.TabNavigator在 SWF 中包含定义,以便可以通过getDefinitionByName().
mx.containers.TabNavigator
getDefinitionByName()