添加一个接受整个精灵的 ActionScript 事件监听器
我在 ActionScript 中有一个非常简单的构造函数,如下所示:
public function ButtonTest() {
this.addEventListener(MouseEvent.CLICK, browseFiles);
}
我的问题是,当我打开 SWF 文件本身时,窗口不是全尺寸的,整个区域都会响应鼠标单击。如果我将窗口放大到全尺寸,左侧 200 像素左右的边距将无法单击。我希望我说得有道理。
问题是我的 HTML 代码中的 a 中有 .SWF 文件,当我将其缩小时,似乎只有 SWF 文件的中心是可单击的。
我希望有人能帮助我。
谢谢你, 鲁迪
I have a very simple constructor in ActionScript as the following:
public function ButtonTest() {
this.addEventListener(MouseEvent.CLICK, browseFiles);
}
My problem is that when I open the SWF file itself, the window is not full size and the whole area responds to the mouse click. If I expand the window to full size, a margin of like 200 pixels on the left is not clickable. I hope I make some sense.
The issue is that I had the .SWF file in a in my HTML code, and when I make it small, it seems that only the center of the SWF file is clickable.
I hope someone can please help me.
Thank you,
Rudy
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
将
stage.scaleMode
设置为StageScaleMode.NO_SCALE
,这样您就可以读取影片的实际大小,以便将按钮拉伸到整个区域。Set
stage.scaleMode
toStageScaleMode.NO_SCALE
, that will allow you to read the actual size of the movie so you can stretch the button over that entire area.