简体   繁体   English

flex 4按钮按下状态

[英]flex 4 button down state

I have skin a button with up, down, over, and disable states. 我有一个带有向上,向下,结束和禁用状态的按钮。 I hope to know if there a code enable a button to keep press (down state) when the user press and hold a specific key link to that button. 我希望知道是否存在代码,当用户按下并按住指向该按钮的特定键链接时,该按钮可以保持按下状态(按下状态)。 Something like down_button state. 类似于down_button状态。

我建议您从Button继承并重写KeyUp处理程序,以在按下Ctrl按钮时保持“向下”状态。

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute">
<mx:Script>
    <![CDATA[
        private function rotate():void
        {
            can.rotation +=5; 
        }
    ]]>
</mx:Script>
    <mx:Button autoRepeat="true" buttonDown="rotate()" label="Rotate"/>
    <mx:Canvas id="can" backgroundColor="#CA3859" width="200" height="200" horizontalCenter="0" verticalCenter="0"/>    
</mx:Application>

set autoRepeat=true and use buttonDown event, insated of mouseDown. 设置autoRepeat = true并使用由mouseDown代替的buttonDown事件。 u'll get it 你会明白的

i hope this was ur need, k, use this example and i have flex3 ryt now, so it's in flex3 我希望这是您的需要,k,使用此示例,现在我有了flex3 ryt,所以它在flex3中

hav a gr8 time tc 拥有gr8时间tc

Ankur sharma 安库尔·夏尔马

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM