本文介绍了如何保持ColorPicker的样本全部打开与Flash AS3的时间呢?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我要的颜色拾取弹出样本始终保持开放。
I want the ColorPicker popup swatch to always stay open.
var cp:ColorPicker = new ColorPicker();
cp.open();
工作正常,但丢失焦点时窗口关闭。有什么建议么?谢谢
works fine but when focus is lost the window closes.Any suggestions?Thanks
闪光灯默认颜色选择器
推荐答案
取决于您所使用的颜色拾取。 (我的意思是谁写的)。
Depends on which ColorPicker you are using. ( i mean who wrote it ).
但这个工程,你需要: HTTP://www.bit-101 .COM /博客/ P = 2347
But this one works as you need: http://www.bit-101.com/blog/?p=2347
更新
然后,你需要创建自己的ColorPicker类,将延续原来颜色拾取:
Then you need to create you own ColorPicker class which will extend the original ColorPicker:
package
{
import fl.controls.ColorPicker;
import flash.events.MouseEvent;
/**
* ...
* @author Jevgenij Dmitrijev ( http://www.ifmi.lt )
*
* @created {2012.05.10 16:08}
*
*/
public class CustomColorPicker extends ColorPicker
{
var _allowHide:Boolean = false;
public function CustomColorPicker()
{
}
override protected function onStageClick(event:MouseEvent):void
{
//Simple example .
if(_allowHide)
super.onStageClick(event);
}
override protected function onSwatchClick(event:MouseEvent):void
{
// since on click it is closing, ovveride the function
// and super the over function, since it is the one
// which changes the color.
super.onSwatchOver(event)
}
override protected function onSwatchOver(event:MouseEvent):void
{
// just ovveride it, so it would do nothing.
}
}
}
然后在你的项目中使用:
And then in you project use:
var colorPickerMC:CustomColorPicker = new CustomColorPicker ();
addChild(colorPickerMC);
这篇关于如何保持ColorPicker的样本全部打开与Flash AS3的时间呢?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!