我不确定我是否正确使用了此转换。我试图在单击按钮一次时锁定按钮上的颜色调整。我尝试开始调整 alpha=0,效果很好。我不太擅长as3,所以一点帮助会非常好。
我收到此错误:“ReferenceError:错误 #1056:无法在 flash.display.SimpleButton 上创建属性 colorTransform。 在 movie_fla::MainTimeline/onMouseClickEvent()"
谢谢特里
stop();
this.wheelsMain.inner4.Inner1btn.addEventListener(MouseEvent.CLICK, onMouseClickEvent);
function onMouseClickEvent(event:Event) {
Object(this).wheelsMain.inner4.Inner1btn.colorTransform = new ColorTransform(1, 1, 1, 1, 20, 0, 0,0);
}
最佳答案
您需要使用“transform”属性...
像这样:
stop();
this.wheelsMain.inner4.Inner1btn.addEventListener(MouseEvent.CLICK, onMouseClickEvent);
function onMouseClickEvent(event:Event) {
event.target.transform.colorTransform = new ColorTransform(1, 1, 1, 1, 20, 0, 0,0);
}
this link底部的示例是什么?
- 您可以使用直接指向按钮的“event.target”来缩短代码!
祝你好运!!
编辑: * 如果我对您有帮助 - 请标记为已回答!
关于actionscript-3 - 尝试在单击 flash as3 时转换按钮颜色,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19481080/