# Controlling a swf with javascript (?)

**URL:** <https://forum.kirupa.com/t/controlling-a-swf-with-javascript/149641>\
**Category:** Uncategorized\
**Created:** [May 31, 2005, 9:40am UTC](https://forum.kirupa.com/t/controlling-a-swf-with-javascript/149641 "2005-05-31T09:40:12Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Foxtrot](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/foxtrot/32/1227_2.png) [@Foxtrot](https://forum.kirupa.com/u/Foxtrot)\
**Post date:** [May 31, 2005, 9:40am UTC](https://forum.kirupa.com/t/controlling-a-swf-with-javascript/149641/1 "2005-05-31T09:40:12Z")

</div>

I am trying to control a swf (goto a specific frame) outside Flash - I found this javascript method working perfecty in IE but am looking for a way that also works in Mozilla and Netscape.

[color=Silver]in head of my html:[/color]

\<script language=“javascript”\>  
function goTo(){  
var movie = window.document.testnav;  
movie.TGotoFrame(’/’,20);  
}  
\</script\>

[color=Silver]the body tag:[/color]

\<body onLoad=“goTo()”\>  
+  
testnav.swf embedded in the html

This makes my testnav.swf jump to frame 20. But how to get it working  
crossbrowser?? Suggestions or links to examples welcome.
