PDA

View Full Version : gotoAndStop on mouse click


special_sauce
10-16-2007, 02:12 AM
Hi,
I'm new to action script and flash.
I have placed a button on my design that says "SKIP INTRO". I have been trying for hours to place code into that frame that says when a mouse is clicked, go to the frame that is labeled "final" or "424".
So far I'm up to:

btn_skip.addEventListener(MouseEvent.CLICK, ClickHandlerFunction);
function ClickHandlerFunction(event:MouseEvent);
{
// need some code for gotoAndStop that works!!
trace("wow");
}

A lot of old posts simply say you can right click on the button and click actions and simply place this into the actions area:

on(release) {
gotoAndStop(5);
}

This doesn't seem to work.

All I want it to do is go to a frame (or the end of the movie) when i click on a symbol? Can someone help me out. Struggling to synthesize the plethora on code examples on the net.

Cheers

stompwampa
10-16-2007, 02:16 AM
what you have is pretty close actually, try this and it should work just fine:


btn_skip.addEventListener(MouseEvent.CLICK, ClickHandlerFunction);

function ClickHandlerFunction(event:MouseEvent):void
{
gotoAndStop("Final");
}


That should work just fine, if not then make sure that you have your instance names and code references matching.

special_sauce
10-16-2007, 02:29 AM
fantastic - that worked. I'm such a happy little chappy now