Copy link to clipboard
Copied
Hi everyone,
I recently used Adobe Animate to make a moving image for the home page of my website. I run Adobe Animate Version 18.0 (Build 107) on a Windows 8.1 Laptop. Unfortunately, I've run into a few problems after exporting to SWF:
The links for "comics", "illustration", and "design" are not working. Whenever I test the movie in Adobe Animate, the links work just fine. But on my site, the buttons hover and click correctly, but do not carry to the links.
It's important to mention that after completing the swf, I placed it inside of an Adobe Muse document and converted it to wordpress through an FTP client (version 2018.0.0.685, CL 806425). Though, I don't think the error was necessarily caused by Muse -- see below.
Each of these buttons has a version of this code in the Action panel on Frame 1 under Scene 1:
Button code |
---|
var _this = this; /* Clicking on the specified symbol instance executes a function. */ _this.button_3.on('click', function(){ /* Loads the URL in a new browser window. */ window.open('http://www.nutmegnautilus.com/design', '_blank'); }); |
I am unable to open just the SWF to see if it's an issue when exporting, but I know I get these errors when I publish as a movie. I tried to look up the error codes online, but couldn't find much:
I'm thinking I've put the code in the wrong spot, but I can't be sure as this is my first foray into Adobe Animate. All the links are within my current site, and there's a nav bar above, but it'd be nice to get these flash links working too.
Thank you in advance.
navigateToURL(new URLRequest(('http://www.nutmegnautilus.com/design'), '_blank');
should be:
navigateToURL(new URLRequest('http://www.nutmegnautilus.com/design'), '_blank');
Copy link to clipboard
Copied
that's not actionscript. it's javascript/easeljs. you would publish an html5/canvas project with that code.
so either the code is wrong or you discussion of a swf is unrelated to the problem and you just need to upload the graphics etc folders published by your html5/canvas project.
from the error messages, it looks like you are publishing an as3 project (that may include a swf) and you're failing to use as3 code. as3 would look like:
button_3.addEventListener(MouseEvent.CLICK,openF);
function openF(e:MouseEvent):void{
navigateToURL(new URLRequest(('http://www.nutmegnautilus.com/design'), '_blank');
}
Copy link to clipboard
Copied
Oh, ok, thank you. I don't know much about all the code stuff that goes into Adobe Animate documents.
I went ahead and put in the code, but when I try to export now, it gives me this error instead. I tried adding a right parenthesis in a few places but it didn't seem to work.
Copy link to clipboard
Copied
navigateToURL(new URLRequest(('http://www.nutmegnautilus.com/design'), '_blank');
should be:
navigateToURL(new URLRequest('http://www.nutmegnautilus.com/design'), '_blank');
Copy link to clipboard
Copied
Thank you. Fixed the code and put into site, unfortunately getting these errors, and links still aren't going.
Copy link to clipboard
Copied
you have two (or more functions) with the same name. fix that.
Copy link to clipboard
Copied
Oh, I see!! All my functions were named with the letter F. I fixed it. Links working well. Thank you so much.
The only thing I can think is, is there another form of the code that opens them in the same tab, rather than opening a new tab? But it works well as it is, so I don't mind.
Thank you again.
Copy link to clipboard
Copied
yes. use: navigateToURL(new URLRequest('http://www.nutmegnautilus.com/design'), '_self');
Find more inspiration, events, and resources on the new Adobe Community
Explore Now