# Javascript/flash Issue

**URL:** <https://forum.kirupa.com/t/javascript-flash-issue/20433>\
**Category:** programming\
**Created:** [May 8, 2003, 4:23pm UTC](https://forum.kirupa.com/t/javascript-flash-issue/20433 "2003-05-08T16:23:20Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![tobydog](https://avatars.discourse-cdn.com/v4/letter/t/f14d63/32.png) [@tobydog](https://forum.kirupa.com/u/tobydog)\
**Post date:** [May 8, 2003, 4:23pm UTC](https://forum.kirupa.com/t/javascript-flash-issue/20433/1 "2003-05-08T16:23:20Z")

</div>

I posted this in the MX forum, but did not get a solid answer.

I will try here.

I have a flash menu on an html page. The page is long - verrrry long. I would like to have the buttons on my menu reference anchor points down the page. In order to do this, I believe that I need to call a javascript with the button. This is where the problem begins. I do not write javascript. I have researched the web, and can find no code relating to my problem.

ANY HELP IS GREATLY APPRECIATED…

TD

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [May 8, 2003, 4:33pm UTC](https://forum.kirupa.com/t/javascript-flash-issue/20433/2 "2003-05-08T16:33:37Z")

</div>

if you already have the anchor points in the HTML page - for the Flash menu just try

on(press)  
getURL(“ADDRESSTHEANCHOR”, “\_SELF”)  
}

exactly like you would if you were using regular HTML…

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [May 8, 2003, 4:38pm UTC](https://forum.kirupa.com/t/javascript-flash-issue/20433/3 "2003-05-08T16:38:53Z")

</div>

There is a bug in Flash with named anchors where it doesn’t work if you just reference the anchor.

Try something like this…

[AS]on (release){  
getURL(“java\*\*script:window.location.href=‘file.html#anchorName’”, “\_self”);  
}[/AS]

If you use the common javascript function for changing the window location it should work… not sure though.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [May 8, 2003, 5:04pm UTC](https://forum.kirupa.com/t/javascript-flash-issue/20433/4 "2003-05-08T17:04:04Z")

</div>

Not working…

It must be the function Im using. I will try to find “the common one”.

I’ll let you know if it works

Thanks guys.

TD

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [May 8, 2003, 7:38pm UTC](https://forum.kirupa.com/t/javascript-flash-issue/20433/5 "2003-05-08T19:38:33Z")

</div>

I just found this article on [macromedia.com](http://macromedia.com), maybe it will help…

[http://www.macromedia.com/support/flash/ts/documents/jrtest1.htm](http://www.macromedia.com/support/flash/ts/documents/jrtest1.htm)

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [May 8, 2003, 9:09pm UTC](https://forum.kirupa.com/t/javascript-flash-issue/20433/6 "2003-05-08T21:09:07Z")

</div>

Here is what I ended up with…

This is what I placed on my html page

```auto

function myfunc(place)
{
window.location.hash = place;
}

```

This is what I ended up with on the button

```auto

on (release){
        getURL("javascript:myfunc('#anchorname)");
}

```

After many attempts and failures, this finally works.

Thanks for all of your help.

TD

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [May 8, 2003, 9:40pm UTC](https://forum.kirupa.com/t/javascript-flash-issue/20433/7 "2003-05-08T21:40:42Z")

</div>

Here’s another zip I found somewhere.
