我正在使用 astra 库,它正在使用 fl 库。
我遇到的问题是我遇到了错误,有些是可重现的,有些看起来是随机的。
我依赖于计时器驱动的大量数据,但是人们会同时与所有这些 UIComponent 进行交互。
问题 1:
我有一个视图,其中有一个文本区域,上面有一堆选项卡。如果我在视图跳转到另一个帧时滚动文本区域,则会在 fl.controls::ScrollBar/thumbReleaseHandler()
问题 2 处收到 #1009 null 对象错误:
第二个似乎是间歇性的,我无法始终如一地重现它,但我确信它喜欢计时器在用户与其交互时重绘当前选项卡视图。
TypeError: Error #2007: Parameter child must be non-null.
at flash.display::DisplayObjectContainer/addChildAt()
at fl.controls::BaseButton/drawBackground()
at fl.controls::LabelButton/draw()
at fl.controls::Button/draw()
at fl.core::UIComponent/callLaterDispatcher()
有没有办法在这些事件导致对象抛出这些错误之前捕获它们?
I'm using the astra library which is using the fl library.
The problem I have is that I get errors, some reproduce-able, some seemingly random.
I'm relying on a lot of the data being driven by timers, but there are all these UIComponents that one would interact with at the same time.
Problem 1 :
I have a view that has a text area in it, and a a bunch of tabs above. If I'm scrolling the text area while the view jumps to another frame I get the #1009 null object error at fl.controls::ScrollBar/thumbReleaseHandler()
Problem 2 :
the second one seems intermittent and I cannot consistently reproduce it, but I'm sure it's liked to the timer redrawing the current tab-view while the user is interacting with it.
TypeError: Error #2007: Parameter child must be non-null.
at flash.display::DisplayObjectContainer/addChildAt()
at fl.controls::BaseButton/drawBackground()
at fl.controls::LabelButton/draw()
at fl.controls::Button/draw()
at fl.core::UIComponent/callLaterDispatcher()
Is there a way to catch these events before they cause the objects to throw these errors?
发布评论
评论(1)
如果您需要 Flash Player 10.1,则可以尝试使用新的全局异常处理 API:http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/events/UncaughtErrorEvents.html
它仍然没有捕获全部 > 未捕获的错误(最明显的是加载到 AS3 SWF 后抛出的 AS2 错误),但它可以处理您的错误。
除此之外,您可以扫描代码并调试这些实例。如果您正在运行 SWF 的调试版本,则应该获取行号来指出有问题的代码。解决方案通常是只进行空检查,如果没有对该对象的引用,则忽略该操作。
If you can require Flash Player 10.1, you can try to use the new global exception handling API: http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/events/UncaughtErrorEvents.html
It still doesn't catch all uncaught errors (most notably AS2 errors thrown after being loaded into an AS3 SWF), but it may handle yours.
Other than that, you could sweep through your code and debug these instances. If you're running the debug version of your SWF, you should get line numbers to point you to the offending code. The solution is often to just do a null check, and ignore the action if you don't have a reference to the object.