FORUMS: list search recent posts

HELP! can't stop flv

COW Forums : Adobe Flash

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Hoss Sarbaz
HELP! can't stop flv
on Nov 20, 2009 at 12:37:49 am

Hi all I created a slide show which loads a different external swf video when going to the next or previous frame.
but I want it to stop playing the flv when clicking to next or previous frame.

Please help thanks!



Here is my code:

//---start code----//

stop();




prev_btn.addEventListener(MouseEvent.CLICK, prevClick);

next_btn.addEventListener(MouseEvent.CLICK, nextClick);

function nextClick (event:MouseEvent): void
{
if(this.currentFrame == this.totalFrames)
{

gotoAndPlay(1);

}
else {

nextFrame();

}

}

function prevClick (event:MouseEvent)
{
if(this.currentFrame == 1)
{
gotoAndPlay(this.totalFrames);
}
else {

prevFrame();

}

}

//----stop code----/

can someone please help thanks!


Return to posts index

demetri tashie
Re: HELP! can't stop flv
on Nov 20, 2009 at 2:12:23 am

i'll assume you are using a FLVPlayback component . then you just simply tell it to stop when you want - in your case upon either button click. the additional code looks like this. note that i cahnged your previous function from go to and play to go to and stop . you should probablay change the next function likewise - better coding


stop();

flvPlayer.source="myVideo.flv";
flvPlayer.autoPlay=true;

prev_btn.addEventListener(MouseEvent.CLICK, prevClick);

next_btn.addEventListener(MouseEvent.CLICK, nextClick);

function nextClick (event:MouseEvent): void
{ flvPlayer.stop();
if(this.currentFrame == this.totalFrames)
{

gotoAndPlay(1);

}
else {

nextFrame();

}

}

function prevClick (event:MouseEvent)
{ flvPlayer.stop();
if(this.currentFrame == 1)
{
gotoAndStop(this.totalFrames);
}
else {

prevFrame();

}

}



Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2018 CreativeCOW.net All Rights Reserved
[TOP]