# JavaScript, swf, and xhtml anchors

**URL:** <https://forum.kirupa.com/t/javascript-swf-and-xhtml-anchors/314842>\
**Category:** flash\
**Created:** [October 10, 2010, 5:40pm UTC](https://forum.kirupa.com/t/javascript-swf-and-xhtml-anchors/314842 "2010-10-10T17:40:37Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![alexyackel](https://avatars.discourse-cdn.com/v4/letter/a/6de8d8/32.png) [@alexyackel](https://forum.kirupa.com/u/alexyackel)\
**Post date:** [October 10, 2010, 5:40pm UTC](https://forum.kirupa.com/t/javascript-swf-and-xhtml-anchors/314842/1 "2010-10-10T17:40:37Z")

</div>

Hello!

So, here’s my problem:

I have a swf embedded in an xhtml page for my navigation bar. My whole site is contained in one xhtml page, using anchors to zoom to different sections. For example, there is a contact section, an about section, and a travel section. All of these are linked via getURL on the swf file, and set up as anchors on the xhtml page.

I have a java script that scrolls to anchors when a regular \<a href="#anchor"\>anchor\</a\> is clicked, but it does not search the swf for getURL("#anchor"); so, when users click links in the swf, it does not scroll the xhtml page, it simply “jumps” there.

Any solution on how to link my java with my swf?? THANKS!! ![](http://forum.kirupa.com/uploads/kirupa/525/d5236136df0858f4.gif)
