AS3 - 单击按钮后,使其保持在“结束”状态模式
我该怎么做?
我有树按钮。一次只能“选择”一个。他们播放不同的动画。
我需要的是将按钮(根据其结束、向上和向下状态具有不同的背景颜色)设置为向下状态。
简单地说;我需要在单击按钮时将按钮冻结在按下状态。 当我单击其他按钮之一时,它应该返回到正常状态,并且新按钮将被冻结在按下状态。
我正在使用 Flash、AS3..
谢谢! =)
How would I do this?
I've got tree buttons. Only one is supposed to be "selected" at a time. They play different animations.
What I need, is to set the button (which has different bg color depending on its over, up and down state) to it's down state.
Simply put; I need to freeze the button in it's down-state when it's clicked.
And when I click one of the other buttons, it's supposed to return back to its normal state, and the new button is to be frozen in it's down state.
I'm using Flash, AS3..
Thanks! =)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
简单地说:
当你设置 upState = downState 来显示某个项目被选中时,你就失去了返回到原始 upState 的能力。因此,将 upState 存储为变量是一件非常简单的事情,这样您就可以随时返回它。
完成,用最少的代码。
Simply stated:
When you set the upState = downState to show that an item was selected, you have lost the ability to go back to the original upState. So it's a very simple matter to store the upState as a variable so that you can ALWAYS go back to it.
Done, with minimal code.
尝试一下我根据您链接到的解决方案改编的代码。
Try this code that I adapted from the solution you linked to.