I have spark skin a button with up, down, over, and disable states in a button component to create a modular. Is there a way when the user press and hold a key, the button will remain in 'down' state?
The button component include skinclass:
<?xml version="1.0" encoding="utf-8"?>
<s:Button xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx"
skinClass="wfm.keyBtn">
</s:Button>
Spark skin:
<?xml version="1.0" encoding="utf-8"?>
<s:SparkSkin xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx"
<fx:Metadata>
[HostComponent("spark.components.Button")]
</fx:Metadata>
<s:states>
<s:State name="up"/>
<s:State name="over"/>
<s:State name="down"/>
<s:State name="disabled"/>
</s:states>
<s:Rect width="18" height="80" height.down="83" radiusX="1">
<s:stroke>
<s:SolidColorStroke color="0xaaaaaa" weight="1"/>
</s:stroke>
<s:filters>
<s:BevelFilter
distance="0"
angle="5" angle.down="5"
highlightColor="0xbbbbbb" highlightColor.down="0xaaaaaa"
highlightAlpha="1" highlightAlpha.down="1"
shadowColor="0xaaaaaa" shadowColor.down="0xffffff"
shadowAlpha="1" shadowAlpha.down="1"
blurX="5" blurX.down="6"
blurY="5" blurY.down="6"
strength="2" strength.down="2"
type="inner"
/>
</s:filters>
<s:fill>
<s:LinearGradient rotation="90">
<s:GradientEntry color="0xf3f3f3" color.down="0xfff963" />
</s:LinearGradient>
</s:fill>
</s:Rect>
</s:SparkSkin>