要显示可用颜色的完整列表,必须单击ColorPicker控件的颜色框。
如何将组件修改为始终强制显示颜色列表,而不需要用户进行任何交互?
发布于 2010-02-23 02:57:05
您可以调用open方法(它调用mx_internal方法displayDropdown):
<?xml version="1.0" encoding="utf-8"?>
<mx:Application
xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute">
<mx:Script>
import mx.events.DropdownEvent;
protected function initializeInterruption():void
{
color.addEventListener(DropdownEvent.CLOSE, interrupt);
}
protected function interrupt(event:Event):void
{
color.open();
}
</mx:Script>
<mx:ColorPicker id="color" closeDuration="0" openDuration="0"
initialize="initializeInterruption()"
creationComplete="color.open()"/>
</mx:Application> 您还可以选择扩展ColorPicker类并覆盖这些方法的一部分/全部:
keyDownHandlerdownArrowButton_buttonDownHandleropenclose如果有用的话告诉我,兰斯
https://stackoverflow.com/questions/2313290
复制相似问题