CreationCompleteイベントでいくつかのボタンにドロップシャドウ効果を追加しようとしています。
インポートflash.filters.DropShadowFilter;
// #1 Does work but removes other filters
protected function onButtonCreate(e:Event):void
{
(e.target as Button).filters = [new DropShadowFilter(1,45,0x000000,0.4,4,4,2,1,false,true,false)];
}
// #2 Does not work
protected function onButtonCreate(e:Event):void
{
(e.target as Button).filters.push(new DropShadowFilter(1,45,0x000000,0.4,4,4,2,1,false,true,false));
}
// #3 Does not work
protected function onButtonCreate(e:Event):void
{
(e.target as Button).filters[(e.target as Button).filters.length] = new DropShadowFilter(1,45,0x000000,0.4,4,4,2,1,false,true,false);
}
私は何が間違っているのですか?それを行う正しい方法は何ですか?
編集:私はフレックススパークテーマを使用しています。ボタンのfilters配列には要素がありませんが、filterプロパティを変更すると、Sparkテーマに適用されているすべてのスタイルが削除されますか?