1

我已将 Adob​​e Animate 中的一些用户界面组件导出到一个.swc文件中,以便在运行时使用:

public class Main extends Sprite {
    public function Main() {
        var checkbox:CheckBox = new CheckBox(); // fl.controls.CheckBox
        checkbox.label = "Row";
        addChild(checkbox);
    }
}

它与 Adob​​e Flash Builder 配合得很好;但是使用我确实需要使用的IntelliJ IDEA ,有时只会表现得很奇怪,并且会以意想不到的方式争论:

TypeError: Error #1009: Cannot access a property or method of a null object reference.
    at fl.controls::CheckBox/drawLayout()
    at fl.controls::LabelButton/draw()
    at fl.core::UIComponent/callLaterDispatcher()

或者有时,与以下消息争论(fl.controls.NumericStepper在以下示例中使用 a ):

TypeError: Error #2007: Parameter child must be non-null.
    at flash.display::DisplayObjectContainer/addChildAt()
    at fl.controls::BaseButton/drawBackground()
    at fl.controls::BaseButton/draw()
    at fl.core::UIComponent/drawNow()
    at fl.controls::NumericStepper/drawLayout()
    at fl.controls::NumericStepper/draw()
    at fl.core::UIComponent/callLaterDispatcher()

因为真的没有理性的原因!!我一直在寻找解决方案(甚至原因!)好几个小时,并尝试了我能想到的!(例如:我将例程放在一个Event.ADDED_TO_STAGE处理程序中;我为导出的文件测试了多个组件组合,并且我确实使用了最新版本的应用程序和 SDK。)

请对此有所了解,因为它随机出现与相同的代码只是为了烦恼的乐趣!我很感激任何反馈,因为我完全没有想法!

先感谢您 :)

4

0 回答 0