简体   繁体   English

闪光灯按钮/符号

[英]Flash button/symbol

I've created a button (symbol), and added a OVER state, which covers a bigger boundary than the UP state. 我创建了一个按钮(符号),并添加了一个OVER状态,该状态覆盖的边界大于UP状态。

However when I add the symbol/button to my stage, the roll over activates on any area covered by the over state, where I only really need it covering the UP state boundary. 但是,当我在舞台上添加符号/按钮时,翻转会在覆盖状态所覆盖的任何区域上激活,我只需要覆盖覆盖状态边界的任何区域即可。

Does anyone know of clipping the region covered, so mouse over is only trigged by the boundaries of the UP state. 有谁知道剪裁覆盖的区域,所以鼠标悬停只会被UP状态的边界所触发。

Is there a way or work around to this problem? 有没有办法解决这个问题?

If you make button in stage ("convert to button" option) inside it you got 4 frames for it states. 如果在其内部制作按钮(“转换为按钮”选项),则状态为4帧。 One of them is HIT - there draw your over-hit shape. HIT就是其中之一-画出您的过度击球形状。

If you use AS create a new Sprite with shape taht will be your hit region. 如果使用AS创建具有taht形状的新Sprite,则将成为您的命中区域。 This shape sholud have alpha=0. 该形状将具有α= 0。 Then add events listeners to it or other code you use for button actions. 然后向其添加事件侦听器或用于按钮操作的其他代码。

If you have problems, just read the documentation on flash. 如果有问题,请阅读Flash文档。 Everything is there. 一切都在那里。

Online docs: here 在线文档: 此处

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

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