Search code examples
actionscript-3flashpresentation

actionscript 3 presentation onclick without buttons


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();

Solution

  • Worked it out.

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

    Thank you for the help