Wednesday, July 1, 2009

Problem from Hell (part III - back to hell with you)

My partner took a look at this and somehow came up with this "solution".

In the project, there's a MXML file called something like TestHohoCanvasHelper.mxml, containing this declaration:

<containers:HohoCanvas
id="foo"
width="100%"
height="100%">

Elsewhere there's an AS file called something like TestHohoCanvas.as which creates a TestHohoCanvasHelper dynamically like this:

private var
testHohoCanvasHelper:TestHohoCanvasHelper;
private var testHohoCanvas:HohoCanvas;

override public function setUp():void
{
testHohoCanvasHelper = new TestHohoCanvasHelper();
Application(Application.application).addChild(testHohoCanvasHelper );
testHohoCanvas = testHohoCanvasHelper.foo;
}


This used to work fine, but I think the Flex compiler detected I was working long hours, figured I was on deadline, and decided to crap out with compilation errors galore - even when building applications that didn't even reference this file.

The solution was to remove "id=" from TestHohoCanvasHelper.mxml and reference the HohoCanvas a different way.

As a friend of mine put it, "ah, life with open sores".

Hope this was useful to someone.

No comments:

Post a Comment