[英]Flash Actionscript 3 Link not open in SWF File
Software: Flash CC软件:Flash CC
I need to add a link to my swf "movie"-banner.我需要添加一个链接到我的 swf“电影”横幅。 I have watched now over 10 Tutorials but it still not work.
我现在已经看了 10 多个教程,但它仍然不起作用。 I can click on the banner but nothing is happening.
我可以点击横幅,但什么也没有发生。
This is my code:这是我的代码:
var my_url:URLRequest = new URLRequest ("link");
import flash.events.MouseEvent;
import flash.net.URLRequest;
link.addEventListener(MouseEvent.CLICK, visit);
function visit(event:MouseEvent):void {
navigateToURL(new URLRequest ,"_blank");
}
I have checked the public settings too with security...我也用安全检查了公共设置...
Please help me :8请帮帮我:8
The URLRequest constructor takes a String as a parameter - the url to which you intend to navigate - so add that into the navigateToURL(new URLRequest('url string here'), "_blank");
URLRequest 构造函数接受一个 String 作为参数 - 您打算导航到的 url - 所以将它添加到
navigateToURL(new URLRequest('url string here'), "_blank");
line and you should be fine.线,你应该没问题。
If you're intending to pass in the pre-instantiated 'my_url' URLRequest, then:如果您打算传入预先实例化的“my_url” URLRequest,则:
navigateToURL(my_url, "_blank");
But then you would have to create that URLRequest with a more meaningful URL than the String 'link'.但是,您必须使用比字符串“链接”更有意义的 URL 创建该 URLRequest。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.