Hi all,
I'm trying to control a flash movie that contains slides using javascript. I've tried both FF1.5 and IE. the flash was made with MX pro. The movie will start when I hit the play Flash button, but won't respond to the other buttons(stopmovie and go). Any Ideas?
The JS I have seen in several places and it works fine. I'm wondering if there is something in the swf that keeps it from responding once it is started. (maybe related to the goToNextSlide functions in the swf??)
And the markup.
Thanks,
George
I'm trying to control a flash movie that contains slides using javascript. I've tried both FF1.5 and IE. the flash was made with MX pro. The movie will start when I hit the play Flash button, but won't respond to the other buttons(stopmovie and go). Any Ideas?
The JS I have seen in several places and it works fine. I'm wondering if there is something in the swf that keeps it from responding once it is started. (maybe related to the goToNextSlide functions in the swf??)
Code:
var movieName = "FOSEMovie";
//replace this with your own movie ID
function thisMovie(movieName) {
// IE and Netscape refer to the movie object differently.
// This function returns the appropriate syntax depending on the browser.
if (navigator.appName.indexOf ("Microsoft") !=-1) {
return window[movieName]
} else {
return document[movieName]
}
}
// Checks if movie is completely loaded.
// Returns true if yes, false if no.
function movieIsLoaded (theMovie) {
if (typeof(theMovie) != "undefined") {
return theMovie.PercentLoaded() == 100;
} else {
return false;
}
}
function playmovie() {
if (movieIsLoaded(thisMovie(movieName))) {
thisMovie(movieName).Play();
}
}
function stopmovie() {
if (movieIsLoaded(thisMovie(movieName))) {
thisMovie(movieName).TStopPlay();
}
}
function go(theFrame) {
if (movieIsLoaded(thisMovie(movieName))) {
thisMovie(movieName).GotoFrame(theFrame);
}
}
function golabel(thelabel) {
if (movieIsLoaded(thisMovie(movieName))) {
thisMovie(movieName).GotoLabel("_level0/",thelabel);
}
}
And the markup.
Code:
<form>
<input type = "button" onclick = "playmovie();" value = "Play Flash"></input>
<input type = "button" onclick = "stopmovie();" value = "Stop Flash"></input>
<input type = "button" onclick = "go(400);" value = "Frame400"></input>
</form>
<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
codebase="[URL unfurl="true"]http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab"[/URL]
WIDTH="250" id="FOSEMovie">
<PARAM NAME= "movie" VALUE="FOSEDemo0.5.swf">
<PARAM NAME="quality" VALUE= "high">
<PARAM NAME= "bgcolor" VALUE="#FFFFFF">
<PARAM NAME = "Play" VALUE = "false">
<PARAM NAME = "LOOP" VALUE = "false">
<PARAM NAMW = "SCALE" VALUE = "SHOWALL">
<EMBED
src="FOSEDemo0.5.swf"
quality=high
bgcolor=#FFFFFF
WIDTH="250"
HEIGHT="200"
NAME="FOSEMovie"
ALIGN=""
PLAY = "false"
LOOP = "false"
SCALE = "SHOWALL"
swLiveConnect="true"
TYPE="application/x-shockwave-flash"
PLUGINSPAGE="[URL unfurl="true"]http://www.macromedia.com/go/flashplayer">[/URL]
</EMBED>
</OBJECT>
Thanks,
George