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 1042549
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T15:31:35+00:00 2026-05-16T15:31:35+00:00

I try to do preloder in Flex for my project written in Flash. I

  • 0

I try to do preloder in Flex for my project written in Flash.
I make this with the help of this site
link text
My Flash project have next source in main class called Game

stage.addEventListener(KeyboardEvent.KEY_DOWN, keyDown);
stage.addEventListener(KeyboardEvent.KEY_UP, keyUp);

private function keyDown(event:KeyboardEvent) {
   if (event.keyCode == 81 && q_was_push == false) q_was_push = true;
   if (event.keyCode == 81) press_q = true;
   if (event.keyCode == 65) press_a = true;
   if (event.keyCode == 83) press_s = true;
   if (event.keyCode == 32) press_space = true;
} ...

When I take new swf file maked by Flex, I have error
TypeError: Error #1009: Cannot access a property or method of a null object reference.
at Game()

if I comment

//stage.addEventListener(KeyboardEvent.KEY_DOWN, keyDown);
//stage.addEventListener(KeyboardEvent.KEY_UP, keyUp);

Flex application work but Flash application does not react to button presses

Please how I can make preloader and work buttons together

  • 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-16T15:31:36+00:00Added an answer on May 16, 2026 at 3:31 pm

    The stage property will be null until a display object is added to the display list. Listen to the addedToStage event and add the key listeners from there.

    addEventListener(Event.ADDED_TO_STAGE, onAddedToStage);
    function onAddedToStage(e:Event):void
    {
        stage.addEventListener(KeyboardEvent.KEY_DOWN, keyDown);
        stage.addEventListener(KeyboardEvent.KEY_UP, keyUp);
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Try this: Make a new XCode4 Applescript project. In the delegate, paste this code:
Try this: <div style=float:left><p>LEFT</p></div> <div style=float:right><p>RIGHT</p></div> <div><p> <input type=text style=width:100% /> <input type=submit />
try this in chrome (ff,ie works ok): in msword or writer make a 3
Try this code - import java.io.StringReader; public class StringReaderTest { public static void main(String[]
Try this piece of code - public class WhitespaceTest { public static void main(String[]
try: recursive_function() except RuntimeError e: # is this a max. recursion depth exceeded exception?
When I try to run test with FlexUnit4 and IntelliJ, I get this error:
Try yourself : as example, try to retrieve the fields of this video :
Try as I might, I cannot get this to work. Here is my latest
Try this showcase: <!doctype html> <html> <head> <style> html { min-height: 100%; overflow-y: scroll;

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.