VerifyError: Error #1107: The ABC data is corrupt, attempt to read out of bounds
VerifyError: Error #1107: ABC 数据已损坏,尝试的读取操作超出范围。

今天遇到了 Adobe Flex VerifyError: Error #1107 的錯誤,囧了一天。
在網上搜了很多,貌似都沒有幾個合理的解釋,因此總結一下網上搜索的結果和自己的實際經驗來給大家分享下解決方案。

————————————————-
Class is too large, or contains too much large arrays

http://forums.ilog.com/elixir/index.php?topic=858.0

Marc Said:
It seems that the compiled actionscript class is too large, or contains too much large arrays, which confuses the Flash Player. To get a smaller class, I did use the simplification threshold to generate the class. A value of 50000 meters did work for me. Note that you will also need some patience  because the simplification process in Custom Map Converter is quite time consuming.

metman Said:
Reducing the number of points did work – thanks. Is there anyway of telling what this is? Or if that array size will be increased in a future release to prevent this happening? BTW the simplification process is very fast and is not a problem.

說明 Reduce the number of points 有效,class文件太大或者內容里面還有太多的 Array,導致編譯器發生錯誤。
我沒有唉。:-(

————————————————-
Update to Flex3.2

我的錯誤發生的編譯環境是 Flex2.0.1 Hotfix3 ,而如果使用 Flex3.2 的SDK,并不會發生 VerifyError: Error #1107 的錯誤
因此升級為 Flex3.2 的版本,不會有這樣的錯誤發生。
但是目前工程情況不允許。 🙁

————————————————-
Common Flex 2 compiler errors and known issues

175465: The following runtime error is produced because the compiler fails to report an error when there is a protected set method in base class with the same name as a protected member variable in a derived class: VerifyError: Error #1107: The ABC data is corrupt, attempt to read out of bounds.

大概的意思是 a protected set method 命名重復了。
自己找了一下,protected set method 沒有重復。Orz… 🙁

————————————————-
奇異的命名重復

最好發現原來在2個 Class 里面對同一個 Instance 進行了 MouseDown 的監聽,而且直接在后面跟上 function ,名字都是 handleMouseDown 。
XXX.getInstance().addEventListener(MouseEvent.MOUSE_DOWN, function handleMouseDown(event:Event):void{...})
那么會出現 VerifyError: Error #1107 的錯誤。

如果1個 Class 里面命名為 a ,一個命名為 b,還是會發生錯誤。 囧

目前情況是 把handleMouseDown單獨提出來寫,不管是否命名重復,那么錯誤不會發生。因此這應該是 Adobe 的BUG。 😉

VerifyError: Error #1107 Solution: 因此避免錯誤的總結是 按照編碼規約,監聽事件的處理程式要單獨提出來寫。