# Need Help with Changing functions in script from gotoAndStop to findCuePoint

**URL:** https://forum.kirupa.com/t/need-help-with-changing-functions-in-script-from-gotoandstop-to-findcuepoint/276298
**Category:** flash
**Created:** [November 25, 2008, 4:33pm UTC](https://forum.kirupa.com/t/need-help-with-changing-functions-in-script-from-gotoandstop-to-findcuepoint/276298 "2008-11-25T16:33:49Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![aztecgreen](https://avatars.discourse-cdn.com/v4/letter/a/e36b37/32.png) [@aztecgreen](https://forum.kirupa.com/u/aztecgreen)
#### Post date: [November 25, 2008, 4:33pm UTC](https://forum.kirupa.com/t/need-help-with-changing-functions-in-script-from-gotoandstop-to-findcuepoint/276298/1 "2008-11-25T16:33:49Z")

</div>

I am attempting to access cue points in a FLV via html links/javascript using the external api.

**The following html and javascript code sends an external api to the flash movie to go to a frame number:**

\<script\>  
function goToFrame(num) {  
getMovieName(“ExternalAPI”).findCuePoint(num);  
}  
function getMovieName(movieName) {  
if (navigator.appName.indexOf(“Microsoft”) != -1) {  
return window[movieName]  
}  
else {  
return document[movieName]  
}  
}  
\</script\>  
\</head\>  
\<body bgcolor="#ffffff"\>

\<div id=“menu”\>

\<ul\>  
\<li\>\<a href="#" onClick=“goToFrame(1)”\>one\</a\>\</li\>  
\<li\>\<a href="#" onClick=“goToFrame(2)”\>two\</a\>\</li\>  
\<li\>\<a href="#" onClick=“goToFrame(3)”\>three\</a\>\</li\>  
\<li\>\<a href="#" onClick=“goToFrame(4)”\>four\</a\>\</li\>  
\<li\>\<a href="#" onClick=“goToFrame(5)”\>five\</a\>\</li\>

\</ul\>  
\</div\>

\<div id=“flash”\>  
\<script type=“text/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’, ‘800’,  
‘height’, ‘300’,  
‘src’, ‘ExternalAPI’,  
‘quality’, ‘high’,  
‘pluginspage’, ‘[http://www.macromedia.com/go/getflashplayer](http://www.macromedia.com/go/getflashplayer)’,  
‘align’, ‘left’,  
‘play’, ‘true’,  
‘loop’, ‘true’,  
‘scale’, ‘noscale’,  
‘wmode’, ‘transparent’,  
‘devicefont’, ‘false’,  
‘id’, ‘ExternalAPI’,  
‘bgcolor’, ‘#EEEEEE’,  
‘name’, ‘ExternalAPI’,  
‘menu’, ‘true’,  
‘allowFullScreen’, ‘false’,  
‘allowScriptAccess’,‘always’,  
‘movie’, ‘ExternalAPI’,  
‘salign’, ‘lt’  
); //end AC code  
}  
\</script\>  
\<object classid=“clsid ![](http://forum.kirupa.com/uploads/kirupa/1495/f1fea26928e562b8.gif)27CDB6E-AE6D-11cf-96B8-444553540000” codebase=“[http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0](http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0)” width=“550” height=“400”\>  
\<param name=“movie” value=“test.swf” /\>  
\<param name=“quality” value=“high” /\>  
\<embed src=“test.swf” quality=“high” pluginspage=“[http://www.macromedia.com/go/getflashplayer](http://www.macromedia.com/go/getflashplayer)” type=“application/x-shockwave-flash” width=“550” height=“400”\>\</embed\>  
\</object\>  
\</div\>  
\<noscript\>\<p\>Please install Flash and/or enable JavaScript to view this example.\</p\>\</noscript\>

**This is the actionscript code in the flash movie:**  
import flash.external.\*;  
#include “mc\_tween2.as”  
stop();

// The name of the Flash trigger variable to be called in JavaScript  
var jsTrigger:String = “goTo”;

// Callback function executed by the name of variable  
ExternalInterface.addCallback(jsTrigger, null, goTo);  
function goTo(frame:Number):Void {  
image.alphaTo(0, .25, “easeOutQuad”);  
image.onTweenComplete = function() {  
gotoAndStop(frame);  
image.\_alpha = 0;  
image.alphaTo(100, .5, “easeOutQuad”);  
}  
}

\*\*Question: \*\*How do I change the scripts from the flash gotoAndStop function to the findCuePoint (with a name variable)?
