import fl.controls.ColorPicker;
import fl.events.ColorPickerEvent;
var myColorPicker:ColorPicker = new ColorPicker();
myColorPicker.addEventListener(ColorPickerEvent.CHANGE, changeHandler);
myColorPicker.move(10, 10);
addChild(myColorPicker);
function changeHandler(event:ColorPickerEvent) {
trace("color changed:", event.color, "(#" + event.target.hexValue + ")");
trace(myColorPicker.hexValue);
}
我需要event.target.hexValue
以外的值的函數。我正在使用Flash CS5中的操作。ColorPicker in AS3
使用[selectedColor(http://www.adobe.com/livedocs/flash/9.0/ActionScriptLangRefV3/fl/controls/ColorPicker.html#selectedColor)財產 – Amarghosh 2010-09-27 14:07:40
你爲什麼不存儲所需全局變量中的值可以在changeHandler函數之外訪問嗎? – midhunhk 2011-06-21 13:50:39