Pet Theory header image 2

flexbuilder update gotcha: package/var name collision

January 8th, 2007 by pet-theory

After updating my trial of FlexBuilder to 2.0.1 (OS X), a slew of errors appeared in my AS3 projects.

I had gotten in the habit of using the same name for 1) a package, 2) the most important class in that package, and 3) a reference to that class in another class.

So for instance:

import alertBox.AlertBox;

protected var alertBox:AlertBox

I had a queasy feeling about possible collisions, but I found the symmetry clear and effortless, and there were no problems–until the update.

Then, the compiler started disregarding the variable declaration, and treating “alertBox” as the package, instead, so I got a bunch of errors to the effect that “x” (for instance) is not a method defined for alertBox. (”x” is a property of an alertBox instance, but not a class in the alertBox package).

When I renamed the variables (”aBox”), the errors went away.

Just a heads up.

Tags: code1 Comment

Leave A Comment

1 response so far ↓

  • 1 aw Apr 26, 2007 at 8:58 am

    Your new blog seems getting some URL collision too….