Copy link to clipboard
Copied
I made an interactive wayfinding map for a hotel, but they want me to create a link from one page, like the restaurant page, to the page that has the Adobe Animate file with the map, but open on the frame that has the path drawn to the restaurant. Currently it opens on the first frame. is there a way to add an "anchor" to the link so it opens the animation, and takes you to the named frame? I saw that in frame labels you have TYPES, which are "Name", "Comment" and "Anchor". i was hoping that maybe i aim to the page that has the animation in html 5 inserted and by some miracle the "href="https://www.domain.com/map.html#anchorname"would take me there, but it didn't. I haved searched all over, but my google hits have nothing to do with what I need.
Copy link to clipboard
Copied
No, there is nothing that will do this automatically. Use JavaScript in your Animate file to extract the anchor from the current URL and then do whatever you need to do with that.
https://itsybitsybytes.com/how-to-get-the-url-anchor-with-javascript/
Copy link to clipboard
Copied
Thanks for your response. I am a designer, not a coder, but I will pass this to a developer friend of mine and he can probably make it work.
Copy link to clipboard
Copied
use your anchor link with the #anchorname and in animate parse it in frame 1:
if(document.location.href.indexOf('#')>-1){
this.gotoAndStop(document.location.href.split('#')[1]);
}
Copy link to clipboard
Copied
I tried adding this line of code to the first frame in actionscript, and the animation wouldnt load anything after that, so I am sure I am not doing it right. My excuse is I dont know programming. I can only do basic stuff in Adobe Animate, and nothing in Actionscript unless I use the wizard or code snippets. But I do have developer friend, so i will bug them into looking at this and the other responses. Thank you!
Copy link to clipboard
Copied
oops, another typo. use:
if(document.location.href.indexOf('#')>-1){
this.gotoAndStop(document.location.href.split('#')[1]);
}
Copy link to clipboard
Copied
That worked perfectly right off the bat!!!
Thank you so much!
Copy link to clipboard
Copied
you're welcome.
Copy link to clipboard
Copied
kglad, would you happen to know if i can do the same with an swf file? would you know the actionscript I could use that might detect the anchor from a link and go to the right frame inside an swf?
Copy link to clipboard
Copied
Come on, at least try to figure things out on your own before asking other people to solve your problems for you.
https://stackoverflow.com/questions/2127962/get-current-browser-url-actionscript-3
Copy link to clipboard
Copied
I dont mean to come across as lazy. I dont know scripting AT ALL. My background is all graphics side. I can copy paste stuff, but if it doesnt work, I would have zero idea how to fix. I build dumb blondes. I can make them look good but they cant do anything.
Copy link to clipboard
Copied
Be sure to check out your code snippets.
Copy link to clipboard
Copied
That code snippet is not helpful.
Copy link to clipboard
Copied
I saw that, but the point is I need to load an animation I made, and it needs to load the page with the adobe animate html5, and go straigth to 160 (which I would name "restaurant1" in frame labels and/or frame anchors) if I click on one button, and fo to frame 225 if I click on another button, and so forth. This code snippet loads external html.