I've simplified my mxml to just 2 elements, a Button and a CheckBox. The button has a very simple custom skin on it, there are 3 states that are just directly loaded from a swc (BackButtonUp, BackButtonMouseover, and BackButtonClick). Everything shows up fine and works if you are using the mouse. If you TAB through everything, that's when it crashes.
I have compiled against the flex sdk 4.5 and 4.5.1. Both give the same results. There are no warnings/errors in either design mode or for the actionscript itself. I have no idea what's wrong because the stack trace gives me none of my own code.
If I change my skin to be just <s:Rect>
objects, then everything works fine. It's only when I'm using the loaded swc symbols does it crash.
It crashes with the following exception (after hitting TAB 6 times):
TypeError: Error #1009: Cannot access a property or method of a null object reference.
at fl.text::TLFRuntimeTabManager$/onKeyFocusChange()[F:\stage\Flash11.5_Main_325_Stage\main\authortool\Stage\tlfRuntime\fl\text\TLFRuntimeTabManager.as:73]
This is my application mxml:
<?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx"
width="400" height="400">
<s:layout>
<s:BasicLayout/>
</s:layout>
<s:Button x="10" y="10" skinClass="skins.BackButton" />
<s:CheckBox x="10" y="100" />
</s:Application>
This is my custom skin mxml are names of symbols in a .swc file):
<?xml version="1.0" encoding="utf-8"?>
<s:SparkButtonSkin
xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:fb="http://ns.adobe.com/flashbuilder/2009"
minWidth="21" minHeight="21"
alpha.disabled="0.5"
xmlns:local="*" >
<fx:Metadata>
<![CDATA[ [HostComponent("spark.components.Button")] ]]>
</fx:Metadata>
<!-- states -->
<s:states>
<s:State name="up" />
<s:State name="over" />
<s:State name="down" />
<s:State name="disabled" />
</s:states>
<local:BackButtonUp id="buttonUp" includeIn="up, disabled"/>
<local:BackButtonMouseover id="buttonOver" includeIn="over"/>
<local:BackButtonClick id="buttonDown" includeIn="down"/>
</s:SparkButtonSkin>