Skip to main content
Inclusive Web Access
Inspiring
September 28, 2018
Question

How to number key press instances?

  • September 28, 2018
  • 1 reply
  • 175 views

Do all the key press instances Need to have separate numbers like:

var frequency = 1;stage.enableMouseOver(frequency);

this.buttonPacific.addEventListener("mouseover", fl_MouseOverHandler_1.bind(this));

function fl_MouseOverHandler_1()

{

// Start your custom code

// This example code displays the words "Moused over" in the Output panel.

this.gotoAndPlay("pacific");

// End your custom code

}

var frequency = 2;

stage.enableMouseOver(frequency);

this.buttonWest.addEventListener("mouseover", fl_MouseOverHandler_2.bind(this));

function fl_MouseOverHandler_2()

{

// Start your custom code

// This example code displays the words "Moused over" in the Output panel.

this.gotoAndPlay("west");

// End your custom code

}

If so where do they go in the case of:

window.addEventListener("keydown", keyPressed.bind(this)); 

  function keyPressed(evt) {

     var theKey = evt.key.toLowerCase();

     if(theKey=="s"){

  window.open("pacific.html", "_self");

  }

  }

Hope this makes sense. Thank you!

    This topic has been closed for replies.

    1 reply

    Legend
    September 28, 2018

    I'm going to guess that by "key press instances" you mean key press event handlers.

    But I don't understand what you mean by "where do they go". They're code. They go in the Actions window.