Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3312178
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T21:57:51+00:00 2026-05-17T21:57:51+00:00

I will need to handle a piano key that can respond as fast as

  • 0

I will need to handle a piano key that can respond as fast as possible without high CPU load with repetitive key press and release on virtual piano in Flex application.

Is calling function much effective or Switch?

Example:

switch(keyNote)
case 'c4': keypress.button=down;
case 'c4': keypress.button=down;
case 'c4': keypress.button=down;
case 'c4': keypress.button=down;
case 'c4': keypress.button=down;
case 'c4': keypress.button=down;

or

function () {
if (keyNote=='c4'){keypress.button=down}
if (keyNote=='c4'){keypress.button=down}
if (keyNote=='c4'){keypress.button=down}
if (keyNote=='c4'){keypress.button=down}
}

or

function c4_Key() {
keypress.button=down;
}

I also wonder if there another method using dispatchevent to call a button by id and set button with down state?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-17T21:57:51+00:00Added an answer on May 17, 2026 at 9:57 pm

    Do not go with your own if, if, if function. The compiler does not like options ( eg. if can be either true or false )
    I would make a dictionary object, so that you could get the response like:

    var keyMap:Dictinary = new Dictionary()
    //Here you would populate the dictionary with the diff. keys and values
    
    //pseudo body of keyDown test funcion
    keyMap[keyNote].keypress.down; 
    

    Or whatever your example code seeks to do 🙂

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this java simulator that will need to handle a huge amount of
I'm returning a complex result of indeterminate size that I will need to handle
I'm working on designing a new database that will need to handle an enormous
I am working on an app that will need to handle very large numbers.
My application will need some windows but I can't use the popUpManager to handle
I am building a web application that will need to allow users to save
I am creating a multilingual site that will need to support at minimum five
I have a web application that will need to access code behind methods as
I'm working on a program that will need to delete a folder (and then
I am writing an application that will need to send a massive amount of

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.