Copy link to clipboard
Copied
import(flash.events.MouseEvent);{
}
stop();
button1.addEventListener(MouseEvent.CLICK,showpic1);
button1.addEventListener(MouseEvent.CLICK,showpic2);
button1.addEventListener(MouseEvent.CLICK,showpic3);
button1.addEventListener(MouseEvent.CLICK,showpic4);
function showpic1(Event:MouseEvent);{
gotoAndstop("pic1");
}
function showpic2(Event:MouseEvent);{
gotoAndstop("pic2");
}
function showpic3(Event:MouseEvent);{
gotoAndstop("pic3");
}
function showpic4(Event:MouseEvent);{
gotoAndstop("pic4");
}
Copy link to clipboard
Copied
AS3 is case sensitive. gotoAndStop() method must have capital "S"
Copy link to clipboard
Copied
Also, what are these brackets around and after import statement? Use just this:
import flash.events.MouseEvent;
Copy link to clipboard
Copied
And another thing. Event (with capital E) is a particular datatype in AS3. You should avoid using reserved words. The handlers should look like this:
function showpic1(event:MouseEvent);
{
gotoAndStop("pic1");
}