# Call JS with Flash... W/O A BUTTON

**URL:** <https://forum.kirupa.com/t/call-js-with-flash-w-o-a-button/198409>\
**Category:** flash\
**Created:** [August 24, 2006, 7:39pm UTC](https://forum.kirupa.com/t/call-js-with-flash-w-o-a-button/198409 "2006-08-24T19:39:11Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![ThatRonGuy](https://avatars.discourse-cdn.com/v4/letter/t/a183cd/32.png) [@ThatRonGuy](https://forum.kirupa.com/u/ThatRonGuy)\
**Post date:** [August 24, 2006, 7:39pm UTC](https://forum.kirupa.com/t/call-js-with-flash-w-o-a-button/198409/1 "2006-08-24T19:39:11Z")

</div>

I need to call a bit of JS on the html page that contains my object, but i need it to be done automatically once a specific frame in the timeline is reached.  
Here is the code I have in the body as an onLOAD, but it has issues when you refresh the page:

```auto
SwitchMenu('subX')

```

If i put it as a button the isses go away… but as i mentioned I need it to be activated in a frame from within the object to solve a smaill issue.  
This is the HTML button code:

```auto
<a href="javascript:;" onclick="SwitchMenu('subX')">LINK TEXT</a>

```

I could really use some help on this one!  
-Ron
