独自のカスタム イメージでクラシック スパーク ボタンのイメージを変更しようとしました。このために、ボタンの skinsClass プロパティを使用しました。私の問題は、ボタンを短時間クリックすると、画像が表示されて消え、ボタンのアクションが実行されることです。静止画像のクリックのようなものを実現したい。
ボタンのコードは次のとおりです。
var button:Button = new Button();
button.setStyle('skinClass', skins.ImageButtonSkin);
これはスキン クラスのコードです。
<?xml version="1.0" encoding="utf-8"?>
<s:Skin xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
minWidth="48" minHeight="48"
alpha.up="1"
alpha.down="0">
<!-- host component -->
<fx:Metadata>
[HostComponent("spark.components.Button")]
</fx:Metadata>
<!-- states -->
<s:states>
<s:State name="disabled" />
<s:State name="down" />
<s:State name="over" />
<s:State name="up" />
</s:states>
<s:BitmapImage source="../assets/gift-icon.png" includeIn="down"/>
<s:BitmapImage source="../assets/gift-icon.png" includeIn="up"/>
<s:BitmapImage source="../assets/gift-icon.png" includeIn="over"/>
<s:BitmapImage source="../assets/gift-icon.png" includeIn="disabled"/>
<!-- SkinParts
name=iconDisplay, type=spark.primitives.BitmapImage, required=false
name=labelDisplay, type=spark.core.IDisplayText, required=false
-->
</s:Skin>