2

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>
zero323
  • 322,348
  • 103
  • 959
  • 935
Tamir
  • 53
  • 5

2 Answers2

1

I work mostly in Flash CS5 but I have had a very similar issue to this. From your code it looks like you're only setting skins for up, down, over and disabled. When you tab through elements it actually selects them but you don't have any of the selected skins set so it errors out. Try setting "selectedUpSkin", "selectedDownSkin", "selectedOverSkin" and "selectedDisabledSkin". I think that should fix your problem.

Haronious
  • 121
  • 10
0

This is a TLF problem in CS 5.5 and CS6. Just change to Classic Text in the text and it'll work fine.