yeah that was an old post when I was just starting out Glad it could help But I have one further suggestion, The "numbered" functions were just changing the names otherwise the error would be a duplicate function error(though I didn't know it at the time).
Also, I like to structure my listeners nice and neatly first and then write my functions, the code is cleaner.
Code:
btn_one.addEventListener(MouseEvent.MOUSE_UP,eventResponse1);
btn_two.addEventListener(MouseEvent.MOUSE_UP,eventResponse2);
btn_three.addEventListener(MouseEvent.MOUSE_UP,eventResponse3);
function eventResponse1(evt:MouseEvent):void
{
gotoAndStop("one");
}
function eventResponse2(evt:MouseEvent):void
{
gotoAndStop("two");
}
function eventResponse3(evt:MouseEvent):void
{
gotoAndStop("three");
}
you can also of course use
Code:
btn_one.addEventListener(MouseEvent.CLICK,eventResponse1);
in order to have the button repond to being clicked rather than a MouseUp if you want.
Bookmarks