我已经交到了许多的Flash(AS3)横幅添加clickTAG的codeS给他们,并为这些文件已设置为AS3不允许code添加到项目!
I have been handed a number of Flash (AS3) banners to add ClickTag codes to them and as the documents have been setup as AS3 it does not allow code added to items!
我需要帮助改变以下code到AS3尽快如果有人能帮助?
I need help changing the following code to AS3 asap if anyone can help?
on (release) {
getURL (_level0.clickTag, "_blank");
}
我不能更改文件回AS2,因为他们已经通过InDesign中被创建,如果我改回来过滤器不工作!
I cannot change the document back to AS2 as they have been created through InDesign and the filters don't work if I change them back!
谢谢
托马斯。
推荐答案
在AS3,所述上(事件)的工作流已被替换事件系统;和的getURL()作为被重新命名navigateToURL()魔女更明确的功能做什么。
In AS3, the on(event) workflow has been replaced with the event system; and getURL() as been renamed navigateToURL() witch is more clear about what the function does.
// 'import' the necessary resources : If you don't do this, you'll have error while compiling.
import flash.events.MouseEvent;
import flash.net.URLRequest;
import flash.net.navigateToURL;
// theBanner is the name of your clickable MovieClip. If you add the code in the MovieClip, use 'this' instead
// this line indicate to call "onClick" if MOUSE_UP occurs on theBanner (ie : the user release the mouse hover the MovieClip
theBanner.addEventListener(MouseEvent.MOUSE_UP, onClick);
// The onClick function, how open the new clickTag URL when called
function onClick(e:MouseEvent):void {
// get the clickTag URL (root.loaderInfo.parameters.clickTag), and send it to navigateToURL.
navigateToURL(new URLRequest(root.loaderInfo.parameters.clickTag), '_blank');
}
相关推荐
最新文章