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

  • Home
  • SEARCH
  • 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 8005977
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T17:21:46+00:00 2026-06-04T17:21:46+00:00

I am receiving an error of access of undefined property from the following code

  • 0

I am receiving an error of access of undefined property from the following code on the line which i’ve starred, even though i have already defined the function further in the class:

package {

  import flash.display.Stage;
  import flash.events.Event;
  import flash.events.KeyboardEvent;
  public class Key{
    private static var initialized:Boolean = false;
    private static var keysDown:Object = new Object();
    private function initialize(stage:Stage){
      if(!initialized){
        stage.addEventListener(KeyboardEvent.KEY_DOWN, keyPressed);
        stage.addEventListener(KeyboardEvent.KEY_UP, keyReleased);
      **stage.addEventListener(Event.DEACTIVATE, clearKeys);**
        initialized = true;
      }
    }
    public static function isDown(keyCode:uint):Boolean {
      return Boolean(keyCode in keysDown);
    }
    Private static function keyPressed(event:KeyboardEvent):void {
      keysDown[event.keyCode] = true;
    }
    private static function keyReleased(event:KeyboardEvent):void{
      if(event.keyCode in keysDown){
        delete keysDown[event.keyCode];
      }
    }
    Private static function clearkeys(event:Event):void{
      keysDown = new Object():
    }
  }
}

EDIT:New error popping up after I have fixed the caps error (Thank you Jason).
Can anyone help me with this?

  • 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-06-04T17:21:48+00:00Added an answer on June 4, 2026 at 5:21 pm

    Private must be lowercase to be the access modifier keyword private.

    As in:

    private static var initialized:Boolean = false;
    

    As upper case Private the compiler assumes you are referencing namespace “Private”, such as:

    package
    {
        import flash.utils.flash_proxy;
        import mx.core.mx_internal;
    
        use namespace arcane;
    
        public dynamic class X
        {
            flash_proxy var prop1:Boolean;
    
            mx_internal var prop2:Boolean;
    
            arcane var prop3:Boolean;
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am receiving an error on the following line of code: Object reference not
I am receiving the following error though I don't really know why: Uncaught TypeError:
I am receiving error messages while working with Twitter4J: java.lang.IllegalStateException: Access token already available.
I am attempting to access a queue and receiving an access denied error. The
I'm recieving the following error on trying to run an append query in access.
I am receiving an error in my error console which states: arguments array passed
I am receiving this error. I have no clue as to why it would
I have a winForms application running on a server and I access it from
I want to call the following function from my managed code: short LS_LoadConfig(LS_ID SensorID,LPVARIANT
I am receiving an error that states: The HTTP verb POST used to access

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.