SPG*_*SPG 1 flash actionscript-3
这是我的代码.
dropColor.addEventListener(ColorPickerEvent.CHANGE, updateValue);
function updateValue(e:ColorPickerEvent){
trace(dropColor.hexValue);
}
Run Code Online (Sandbox Code Playgroud)
它不起作用.
1046: Type was not found or was not a compile-time constant: ColorPickerEvent.
Run Code Online (Sandbox Code Playgroud)
有人能告诉我为什么吗?
您需要为ColorPickEvent添加导入.
import fl.events.ColorPickerEvent;
Run Code Online (Sandbox Code Playgroud)
此外,根据您使用的编译器,您很可能需要fl.swc:
http://evolve.reintroducing.com/2007/10/30/tips-n-tricks/fl-package-swc/
您需要将其添加到项目中,按照该页面上的说明进行操作.