actionscript 3 presentation onclick without buttons

118 views Asked by At

Is there a possibility to go to the next slide with left click, I can only see buttons in the default one right to go forward and left to go backwards. is this possible with the left click to go forward? without any buttons?

This is the default code:

stage.addEventListener(KeyboardEvent.KEY_DOWN, fl_changeSlide);
function fl_changeSlide(evt:KeyboardEvent):void
{
    if(evt.keyCode == 37) // LEFT
    {
    gotoAndStop(this.currentFrame-1);
    }
    else if (evt.keyCode == 39 || evt.keyCode == 32) // RIGHT OR SPACE
    { 
        gotoAndStop(this.currentFrame+1);
    }
}stop();
2

There are 2 answers

1
the R On BEST ANSWER

Worked it out.

stage.addEventListener(MouseEvent.CLICK, Test);

function Test(event:MouseEvent):void
{
    gotoAndStop(this.currentFrame+1);
}stop();

Thank you for the help

2
suzuiyue On
stage.addEventListener(KeyboardEvent.KEY_DOWN, fl_changeSlide); 
function fl_changeSlide(evt:KeyboardEvent):void {
if(evt.keyCode == 37) // LEFT
{
gotoAndStop(this.currentFrame+1);
}
else if (evt.keyCode == 39 || evt.keyCode == 32) // RIGHT OR SPACE
{ 
    gotoAndStop(this.currentFrame-1);
} }stop();