Flex Bug

E-mail

I just wanted to post this in case it helps anyone diagnose this problem. I was getting this helpful error message in Flex:

"An internal build error has occurred. Right-click for more information."

Googling did not help. I found a bunch of things that could cause the problem: empty switch statements, missing semicolons, double imports, etc. However, none of those seemed to apply to me. The most common suggestion I found was to look in the log file. I checked the logged file and found this exception:

java.lang.NullPointerException
at macromedia.asc.semantics.InterfaceWalker.(InterfaceWalker.java:35)

Still not helpful. I finally started commenting code and eventually narrowed it down to this statement:

var aCursor:IViewCursor = anArray_.createCursor();

The variable "anArray" is type ArrayCollection. The IViewCursor that I was trying to create is kind of like a Java iterator. The "I" in... n the type name is Adobe's convention for interfaces. So the problem with this code is apparently that I'm declaring a variable whose type is an interface rather than a concrete class. Indeed, I still get the internal error if I change the code to:

var aCursor:IViewCursor;

The odd thing is that this line is actually used in the example code that shows up on the ArrayCollection class itself. In any case, this error seems to explain the null pointer in "InterfaceWalker" above. For now, I'm changing the code to:

var aCursor:Object = anArray_.createCursor();

which, though not as convenient, seems to avoid the compiler crash.

---

Incidentally, I figured out that this declaration only causes a problem in very specific circumstances. I just created a bug in Adobe's Jira for Flex with a very simple example. The bug number is FB-17353.

Last Updated on Sunday, 28 February 2010 20:45  

Add comment


Security code
Refresh