Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

How to number key press instances?

Explorer ,
Sep 28, 2018 Sep 28, 2018

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!

160
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Sep 28, 2018 Sep 28, 2018
LATEST

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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines