0

ボタンを含むFlashファイルがあり、フラッシュが読み込まれるとこれらのボタンの色が動的に変化し、カラーコードはXMLファイルから取得され、ボタンの色が次のように変更されます

color.setRGB(color_code_from_xml);

そして、ここではすべて正常に動作します。問題は、これらのボタンのホバーカラーにあります。常に白である必要がありますが、setRGB()色をロードした後、ボタンのすべての状態 (オーバー、ダウン、ヒット) が同じ色になります。

ボタンのホバーカラーを白く保つにはどうすればよいですか?

これが理解できることを願っています。私は Flash をまったく初めて使用します。どうもありがとうございました。

4

1 に答える 1

1
var color_code_from_xml:Number = 0xFF0000; // here you will pass your value from XML

var my_color:Color = new Color(my_button); 
my_color.setRGB(color_code_from_xml); // my_button turns to color (red) from XML

my_button.onRollOver = function() { // on mouse roll over
    my_color.setRGB(0xFFFFFF); // my_button turns white
}

my_button.onRollOut = function() { // on mouse roll out
    my_color.setRGB(color_code_from_xml);  // my_button restores to color (red) from XML
}

my_button.onPress = function() { // on mouse press
    my_color.setRGB(0x0066FF); // my_button turns blue
}
于 2012-10-01T10:04:49.637 に答える