PDA

View Full Version : Stop flash movies when slide changes



shlajfka
11-13-2008, 03:19 PM
1) Script Title:
onChange: function(previndex, curindex){
}

2) Script URL (on DD):
http://www.dynamicdrive.com/dynamicindex17/featuredcontentslider.htm

3) Describe problem:

Hi, at first, thanks alot for the script.

I have 9 slides on this Featured Content Slider and every slide have one flv movie loaded. When i start one movie, and i want to load another slide, and start that flv movie. But the movie from previous slide is not stoping, and plays in same time with the movie from other slide. I hope that you understand me. Thanks a lot.

p.s. i give you an example here:
http://www.silveradv.com/www/bg/skills/tvklipove.html

ddadmin
11-14-2008, 09:02 AM
Is there a way to stop the playing of your Flash movie using JavaScript? Once you know what it is, you can then use the onChange event handler of the script to call that whenever the user changes slide:


onChange: function(previndex, curindex){
if (previndex==curindex) //if two indices point to the same slide (page first loads)
return //do nothing
else if (previndex==1)
videoplayer.stop("cats")
else if (previndex==2)
videoplayer.stop("dogs")
else if (previndex==3)
videoplayer.stop("myvacation")
}

shlajfka
11-14-2008, 09:36 AM
Should i post else if as much as i have slides with videos? and videoplayer.stop("ID or NAME of video are here? ")

ddadmin
11-14-2008, 09:49 AM
It really depends how your Flash player actually allows you to stop the player using JavaScript. videoplayer.stop("cats") is just an example, not how you'd actually do it. You need to find that out first, then post the line required before I can provide the rest of the code.