# Cannot get gotoframe to work .. code posted

**URL:** <https://forum.kirupa.com/t/cannot-get-gotoframe-to-work-code-posted/269313>\
**Category:** Uncategorized\
**Created:** [August 26, 2008, 5:19am UTC](https://forum.kirupa.com/t/cannot-get-gotoframe-to-work-code-posted/269313 "2008-08-26T05:19:03Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![designguru1](https://avatars.discourse-cdn.com/v4/letter/d/a88e57/32.png) [@designguru1](https://forum.kirupa.com/u/designguru1)\
**Post date:** [August 26, 2008, 5:19am UTC](https://forum.kirupa.com/t/cannot-get-gotoframe-to-work-code-posted/269313/1 "2008-08-26T05:19:03Z")

</div>

Hi there, below is code that loads a .swf movie that has play, pause and stop buttons inside the .swf file. I need to add some buttons in the html file that goto and play a certain frame when clicked. it’s not working, driving me crazy, read so much myeyes are sore!..any help gratefully received.  
\<html\>  
\<head\>  
\<meta http-equiv=“Content-Type” content=“text/html; charset=iso-8859-1” /\>  
\<title\>newagelnobuttons\</title\>  
\<script language=“javascript”\>  
\<!–  
AC\_FL\_RunContent = 0;  
function MM\_findObj(n, d) { [//v4.01](https://v4.01)  
var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))\>0&&parent.frames.length) {  
d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}  
if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i\<d.forms.length;i++) x=d.forms\*[n];  
for(i=0;!x&&d.layers&&i\<d.layers.length;i++) x=MM\_findObj(n,d.layers\*.document);  
if(!x && d.getElementById) x=d.getElementById(n); return x;  
}  
function MM\_controlShockwave(objStr,x,cmdName,frameNum) { [//v3.0](https://v3.0)  
var obj=MM\_findObj(objStr);  
if (obj) eval(‘obj.’+cmdName+’(’+((cmdName==‘GotoFrame’)?frameNum:’’)+’)’);  
}  
//–\>  
\</script\>  
\<script src=“AC\_RunActiveContent.js” language=“javascript”\>\</script\>  
\</head\>  
\<body bgcolor="#66a71b"\>  
\<table width=“48%” border=“0” align=“center” cellpadding=“3” cellspacing=“3”\>  
\<tr\>  
\<td\>  
\<!–url’s used in the movie–\>  
\<!–text used in the movie–\>  
\<!-- saved from url=(0013)about:internet --\>  
\<script language=“javascript”\>  
if (AC\_FL\_RunContent == 0) {  
alert(“This page requires AC\_RunActiveContent.js.”);  
} else {  
AC\_FL\_RunContent(  
‘codebase’, ‘[http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0](http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0)’,  
‘width’, ‘445’,  
‘height’, ‘310’,  
‘src’, ‘newagelnobuttons’,  
‘quality’, ‘high’,  
‘pluginspage’, ‘[http://www.macromedia.com/go/getflashplayer](http://www.macromedia.com/go/getflashplayer)’,  
‘align’, ‘middle’,  
‘play’, ‘true’,  
‘loop’, ‘true’,  
‘scale’, ‘showall’,  
‘wmode’, ‘window’,  
‘devicefont’, ‘false’,  
‘id’, ‘newagelnobuttons’,  
‘bgcolor’, ‘#66a71b’,  
‘name’, ‘newagelnobuttons’,  
‘menu’, ‘true’,  
‘allowFullScreen’, ‘false’,  
‘allowScriptAccess’,‘sameDomain’,  
‘movie’, ‘newagelnobuttons’,  
‘salign’, ‘’  
); //end AC code  
}  
\</script\>  
\<noscript\>  
\<object classid=“clsid:d27cdb6e-ae6d-11cf-96b8-444553540000” codebase=“[http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0](http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0)” name=“lastmovie” width=“445”  
height=“310” align=“middle” id=“lastmovie”\>  
\<param name=“allowScriptAccess” value=“true” /\>  
\<param name=“allowFullScreen” value=“false” /\>  
\<param name=“movie” value=“newagelnobuttons.swf” /\>  
\<param name=“quality” value=“high” /\>  
\<param name=“bgcolor” value="#66a71b" /\>  
\<param name=“PLAY” value=“false”\>  
\<param name=“LOOP” value=“false”\>  
\<embed src=“newagelnobuttons.swf” width=“445” height=“310” loop=“false” align=“middle” quality=“high” bgcolor="#66a71b" name=“lastmovie” type=“application/x-shockwave-flash”  
pluginspage=“[http://www.macromedia.com/go/getflashplayer](http://www.macromedia.com/go/getflashplayer)” play=“false” data=“newagelnobuttons.swf” swliveconnect=“true” /\>  
\</object\>  
\</noscript\>\</td\>  
\</tr\>  
\<tr\>  
\<td\>\<img src=“agelbutt.gif” width=“180” height=“26” onbeforeunload=“MM\_controlShockwave(‘lastmovie’,’’,‘GotoFrame’,‘499’)”\>  
\</tr\>  
\</table\>  
\</body\>  
\</html\>
