Welcome to WebmasterWorld Guest from 54.158.198.141

Forum Moderators: open

Message Too Old, No Replies

switching between multiple videos

actionscript 3

     
1:47 pm on Aug 7, 2008 (gmt 0)

Junior Member

10+ Year Member

joined:June 30, 2005
posts: 48
votes: 0


I have a simple application that I want the user to be able to switch between videos on a button click.

The problem is that I cannot get the first video to stop once the second video is clicked.


import flash.events.*;

squash.addEventListener(MouseEvent.CLICK,squashClick);
function squashClick(event:MouseEvent):void {
gotoAndStop(2);
}
okra.addEventListener(MouseEvent.CLICK,okraClick);
function okraClick(event:MouseEvent):void {
gotoAndStop(3);
}
eggplant.addEventListener(MouseEvent.CLICK,eggplantClick);
function eggplantClick(event:MouseEvent):void {
gotoAndStop(4);
}

each button has an instance name of squash, okra, eggplant. I add the event listener and tell it to go to a certain frame when clicked.

2:08 pm on Aug 8, 2008 (gmt 0)

Senior Member

WebmasterWorld Senior Member eelixduppy is a WebmasterWorld Top Contributor of All Time 10+ Year Member

joined:Nov 12, 2005
posts:5966
votes: 0


You just need to stop it:

myMovie.stop();

you might want to see if there is an easier implementation of your flash app so instead of having the movies on separate frames you dynamically load them with AS.