PDA

View Full Version : Playing a movieclip using a button



dmind
September 15th, 2009, 02:35 AM
Hello guys,

I just need a little help here...


I have two buttons named buttonOne and buttonTwo. When I click buttonOne, the movie clip named oneMc should play its intro and then stop then after that whenever I click buttonTwo, the movieclip oneMc should play outro animation and then movieclip twoMc intro comes in.


What is the general idea for this one?
Do I need to use the Loader and URLRequest for this one? or use a String?

Also, how can I call the movieclip to play its outro and play the next movieclip's intro?

Here is my code so far...


buttonOne.buttonMode = true;
buttonTwo.buttonMode = true;


buttonOne.addEventListener(MouseEvent.CLICK, btnOneHandler);
function btnOneHandler(e:MouseEvent):void
{
oneMc.gotoAndPlay("intro");
}


buttonTwo.addEventListener(MouseEvent.CLICK, btnTwoHandler);
function btnTwoHandler(e:MouseEvent):void
{
twoMc.gotoAndPlay("intro");
}




Thanks!