Copy link to clipboard
Copied
Hello,
I am relatively new to Adobe Animate CC. We have traditionally published our web banners in flash format and would like to publish them now using HTML5.
I recreated the web banner in HMTL5 Canvas and have the buttons created with an action script for the first button. However, when I go to test it, the hyperlink does not work. I created the action script using the code snippet library. Below is the action script I have along with a screenshot of my workspace. Any thoughts?
this.button_3.addEventListener("click", fl_ClickToGoToWebPage_6);
function fl_ClickToGoToWebPage_6() {
window.open("http://www.adobe.com", "_blank");
}
Copy link to clipboard
Copied
Hi.
It works here.
Call the browser's console and see if it logs some error.
Copy link to clipboard
Copied
Same for me, I copied and pasted your script, and made a button with an instance name of "button_3", and it worked.
Copy link to clipboard
Copied
I think it may have to do with some setting I have testing. I know when I tested even our flash version the links wouldn't work in my test file but they worked on the live file.
What publish settings would I use to publish the file. I was able to get it to publish an HTML and JS file, and the HTML file does load. But the second I move the HTML file it breaks the file.
Copy link to clipboard
Copied
I tested with Ctrl + Enter, running the exported .html offline, running the file online with Firefox, Chrome, IE, Edge, Chrome for Android, Chrome and Safari for iOS, using the default settings and they all worked.
Please check if your browser is not allowing a new window/tab to be opened or something like that.
Copy link to clipboard
Copied
This is not an AS3 question. It is JS. Since this is an HTML5 ad, there is no need to use a frame script. Most banner creators are just adding this right before > in the canvas element, and have created publish templates that do it automatically. Just having a button gives you a cursor.
onclick="javascript:window.open(window.clickTag)"
And <script type="text/javascript">var clickTag = "https://www.google.com";</script> in the head of your HTML document.
But since it appears you wish to have multiple click throughs and this is for serving as a banner ad, you need to use this as a frame script, otherwise you would have to define areas that correspond to where your three buttons are placed. Notice the first clickTag has no number.
this.first_mc.on("click", function(evt){
window.open(clickTag, "_blank");
});
this.second_mc.on("click", function(evt){
window.open(clickTag1, "_blank");
});
this.third_mc.on("click", function(evt){
window.open(clickTag2, "_blank");
});
And since you don't want to have to deal with AdOps saying something is wrong, you can validate here.
"the second I move the HTML file it breaks the file."
That js file is where the magic is. You will be providing a zipped file that is the images folder if there is one, and the html and js file with your JPG or GIF backup as a separate file. AdWords has some new rules, so knowing where your ads are going would be helpful.