易帜的clickTag code至AS3? [英] Change Banner ClickTag Code to AS3?

查看:133
本文介绍了易帜的clickTag code至AS3?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经交到了许多的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');
}

这篇关于易帜的clickTag code至AS3?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆