PDA

View Full Version : java script method


govinda
02-28-2001, 05:12 PM
does anyone know a java script that will send the playhead of a flash movie to a specific frame, that will work with internet explorer AND netscape

thank you

edeveloper
03-01-2001, 03:35 AM
<script language="javascript">
function goTo(){

var movie = window.document.YourMovieNameGoesHere;
//TGotoFrame is a command that sends the variable
// the "/" tells the script that the var is going to the top level of the movie
// this can be replaced with the instance name of a movieclip
movie.TGotoFrame('/', putTheFrameNumberHere)
}
// don't forget to put the movie name in the object and embed
//tags and that swLiveConnect="True"
</script>
<TITLE>goto</TITLE>
</HEAD>
<BODY bgcolor="#FFFFFF" onLoad="goTo()">
<!-- URL's used in the movie-->
<!-- text used in the movie-->
<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0"
ID=YOUR_MOVIE_NAME_HERE WIDTH=550 HEIGHT=400>
<PARAM NAME=movie VALUE="your.swf"> <PARAM NAME=quality VALUE=high> <PARAM NAME=bgcolor VALUE=#FFFFFF> <EMBED src="your.swf" name=YOUR_MOVIE_NAME_HERE quality=high swLiveConnect="True" bgcolor=#FFFFFF WIDTH=550 HEIGHT=400 TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash"></EMBED>
</OBJECT>


[Edited by edeveloper on 02-28-2001 at 09:38 PM]

aatwater
03-05-2001, 03:51 PM
What modifications to this example need to be made in order to get the movie to start playing at the frame the playhead has been moved to? Also, where would I find information on the "TgotoFrame" command and others like it?

Thanks in advance

edeveloper
03-05-2001, 04:18 PM
<script language="javascript">
function goTo(clipName,frameNum){
var movie = window.document.YourMovieNameGoesHere;movieclip
movie.TGotoFrame(clipName, frameNum)
}
</script>


you call the function like this:
<a href="Javascript:goto('put_the_clip_name_here','the_fram e_number_here')">gotoFrame</a>

you can get the info at macromedia