1-bit Color

by Jim May 25, 2007 7:41 AM

I love the docking station I've got for my Dell work machine, but sometimes the dock/undock process doesn't go as smoothly as it should. I don't think I've seen anything like this since... oh, the early 90's. Vista is suprisingly unusable in one-bit color. It took two restarts to fix this little problem. Sometimes the wireless doesn't want to work, or the spare monitor rearranges itself, or all of my icons get rearranged.

Tags:

Flash Compiler Bug?

by Jim May 10, 2007 8:52 AM

I got the following error when running my flash program:

VerifyError: Error #1030: Stack depth is unbalanced. 2 != 0

The adobe documentation implies that the SWF file is corrupt; presumably this is due to a bug in the compiler, or a bug related to interpreting the compiled code.

I panicked for a second there - how do you work around a bug in the compiler? Wait for the next version? But I started playing with the code and found the source of the problem. Here's my function:

private function clickHandler(event:MouseEvent):void
{
    // Is the click on the region of the main "button"?
    if (SymbolMenuButton(getChildAt(0)).hitTestPoint(event.stageX, event.stageY))
    {
        showSubs(getChildAt(1).visible != true);
    }
    else if (mSymbols.visible && mSymbols.hitTestPoint(event.stageX, event.stageY))
    {
        // ToDo: Determine which symbol was clicked
        dispatchEvent(new TextEvent(SYMBOL_CLICK, true, false, 
            mGlyphs[mSymbolsIndex, 1, 1]));
    }
    event.stopPropagation();
}

 The exception was thrown in the first if block, not on the offending line, which is the dispatchEvent; specifically, the array access is causing the problem. If I change this to mGlyphs[mSymbolsIndex][1][1], then everything is fine.

It would appear that the compiler allows the incorrect array access, then the flash player gets confused by the compiled code and throws an error.

Tags: