Hi everybody,
I’m working on a flash project using 7 loaded flv movies each inside their own movieclips. When I use the play and stop buttons the movies work fine but here’s the problem: when I use the next button to jump to the next movie it plays fine until almost to the end and then the next movie starts to play before the first one is finished.
So i get 2 movies playing at once.
Hope my explanations were clear.
Here’s the code if it can help.
import fl.video.*;
navbar.visible = true;
navbar.addEventListener(MouseEvent.MOUSE_OVER, showmenu);
function showmenu(e:MouseEvent):void{
navbar.alpha = 1;
}
navbar.addEventListener(MouseEvent.MOUSE_OUT, hidemenu);
function hidemenu(e:MouseEvent):void{
navbar.alpha = 0;
}
navbar.next_btn.addEventListener(MouseEvent.CLICK, nextButtonClick);
navbar.prev_btn.addEventListener(MouseEvent.CLICK, previousButtonClick);
navbar.play_btn.addEventListener(MouseEvent.CLICK, playButtonClick);
navbar.stop_btn.addEventListener(MouseEvent.CLICK, stopButtonClick);
navbar.menu_btn.addEventListener(MouseEvent.CLICK, menuButtonClick);
function stopButtonClick(e:MouseEvent):void
{
if(delay1)
{
delay1.VidDesign1.stop();
delay1.stop();
}
else if (delay2)
{
delay2.Video2.stop();
delay2.stop();
}
else if (delay3)
{
delay3.VidDesign3.stop();
delay3.stop();
}
else if (delay4)
{
delay4.VidDesign4.stop();
delay4.stop();
}
else if (analysis1)
{
analysis1.VidDesign5.stop();
analysis1.stop();
}
else if (analysis2)
{
analysis2.VidDesign6.stop();
analysis2.stop();
}
else if (analysis3)
{
analysis3.VidDesign7.stop();
analysis3.stop();
}
stop();
}
function playButtonClick(e:MouseEvent):void
{
if(delay1)
{
delay1.VidDesign1.play();
delay1.play();
}
else if(delay2)
{
delay2.VidDesign2.play();
delay2.play();
}
else if(delay3)
{
delay3.VidDesign3.play();
delay3.play();
}
else if(delay4)
{
delay4.VidDesign4.play();
delay4.play();
}
else if (analysis1)
{
analysis1.VidDesign5.play();
analysis1.play();
}
else if (analysis2)
{
analysis2.VidDesign6.play();
analysis2.play();
}
else if (analysis3)
{
analysis3.VidDesign7.play();
analysis3.play();
}
play();
}
function previousButtonClick(e:MouseEvent):void
{
if(delay1)
{
delay1.VidDesign1.stop();
delay1.stop();
}
else if (delay2)
{
delay2.Video2.stop();
delay2.stop();
gotoAndPlay(“delay1”);
}
else if (delay3)
{
delay3.VidDesign3.stop();
delay3.stop();
gotoAndPlay(“delay2”);
}
else if (delay4)
{
delay4.VidDesign4.stop();
delay4.stop();
gotoAndPlay(“delay3”);
}
else if (analysis1)
{
analysis1.VidDesign6.stop();
analysis1.play();
}
else if (analysis2)
{
analysis2.VidDesign7.play();
analysis2.play();
gotoAndPlay(“analysis1”);
}
else if (analysis3)
{
analysis3.VidDesign7.stop();
analysis3.stop();
gotoAndPlay(“analysis2”);
}
gotoAndStop(currentFrame - 250);
}
function nextButtonClick(e:MouseEvent):void
{
if(delay1)
{
delay1.VidDesign1.stop();
delay1.stop();
gotoAndPlay(“delay2”);
}
else if(delay2)
{
delay2.VidDesign2.stop();
delay2.stop();
gotoAndPlay(“delay3”);
}
else if (delay3)
{
delay3.VidDesign3.stop();
delay3.stop();
gotoAndPlay(“delay4”);
}
else if (delay4)
{
delay4.VidDesign4.stop();
delay4.stop();
}
else if (analysis1)
{
analysis1.VidDesign5.stop();
analysis1.stop();
gotoAndPlay(“analysis2”);
}
else if (analysis2)
{
analysis2.VidDesign6.stop();
analysis2.stop();
gotoAndPlay(“analysis3”);
}
else if (analysis3)
{
analysis3.VidDesign7.stop();
}
gotoAndStop(currentFrame + 250);
}
function menuButtonClick(e:MouseEvent):void
{
if(delay1)
{
delay1.stop();
}
else if (delay2)
{
delay2.stop();
}
else if (delay3)
{
delay3.stop();
}
else if (delay4)
{
delay4.stop();
}
else if (analysis1)
{
VidDesign5.stop();
}
else if (analysis2)
{
VidDesign6.stop();
}
else if (analysis3)
{
VidDesign7.stop();
}
gotoAndPlay(1);
}