Flash 横幅链接不起作用 - AS 2.0
这篇文章提供了一些易于遵循的说明,使 Flash 横幅可点击,但这对我来说不太有用。 http://www.austintreeexperts.com/maps/oakwilt.cfm 是我的位置闪光横幅是。在谷歌地球下面有一个小Flash广告。当我将鼠标悬停在上面时,光标会变成指针,就像它知道它是一个链接一样,但单击不会执行任何操作。我已经为此愚弄了几个小时,我快要疯了。我的动作脚本是这样的: on(press){getURL("http://realgreenlawn.com","_blank");}
This post had some easy to follow instructions to make a flash banner clickable, but it's not quite working for me.
http://www.austintreeexperts.com/maps/oakwilt.cfm is where my flash banner is. Under the google earth thing is a small flash ad. When I mouse over, the cursor turns to pointer like it knows it's a link, but clicking does nothing. I've been fooling with this for hours and I'm about to go crazy. My actionscript is this:
on(press){getURL("http://realgreenlawn.com","_blank");}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
首先要考虑的是:
您是否使用按钮符号?如果是这样,无论 onPress() 代码是否正确,您都会得到一个手形光标。您应该使用movieclip符号,并将over、up和down状态作为帧标签名称“_up”、“_over”和“_down”。只要您按照如下所述为其分配了 onRelease() 或 onPress() 方法,这些帧名称就会使影片剪辑充当按钮实例。此外,要获得手形光标,您需要将 useHandCursor 设置为 true。
第二件事要考虑:
您的 onPress() 代码看起来像是直接放在影片剪辑上的代码。如果是这样,不要这样做!给它一个实例名称,例如myButton,并在按钮所在的同一帧上使用下面的代码:
或者不最佳实践,但如果您不太熟练使用 as2,则更容易将上述代码放在按钮动画剪辑内的第一帧上,但如果您这样做,请将其更改为:
First thing to consider:
Are you using a button symbol? If so you will get a hand cursor whether or not the onPress() code is correct. You should use a movieclip symbol instead, with your over, up, and down states as frame label names "_up", "_over" and "_down". Those frame names will make a movieclip act like a button instance as long as you have an onRelease() or onPress() method assigned to it as outlined below. Also, to get a hand cursor you will need to set useHandCursor to true.
Second thing to consider:
Your onPress() code looks like its the kind of code placed right on a movieclip. If so, do not do that! Give it an instance name, like myButton and use the code below on the same frame the button resides:
or alternatively and not best practice, but easier if your aren't that skilled with as2 is to put the above code on the first frame inside your button movieclip, but if you do that change it to: