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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T16:51:02+00:00 2026-05-21T16:51:02+00:00

Im creating a game in Flash and I have a class that have some

  • 0

Im creating a game in Flash and I have a class that have some text fields that I need to populate in this case a highScore. I get this error.

TypeError: Error #1009: Cannot access a property or method of a null object reference.

Meaning that the object doesn´t exist , for some reason.

if (highscore.data.hard != null){ 
    highscore_txt.text= String( highscore.data.hard);. 
}

The highscore_txt I have created it , on the design view , meaning timeline.

I have other textfield, that I acess like the score and dont have any problem, this is problable because is acessed and I try to write to the textfield in the constructer of the class. I have done some tests and if I populate the field after all the constructer stuff is done , it works, like when I click some place and call that function using a eventlister.

what can I do , so that only after the class is completed initialized I insert the data in the textfield, is there any event that is listening for the class endes to create itself??

  • 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-21T16:51:03+00:00Added an answer on May 21, 2026 at 4:51 pm

    Just put an event Listener in your constructor that listens to the ADDED_TO_STAGE-event 🙂

    addEventListener(Event.ADDED_TO_STAGE, yourFunctionToPopulate);
    
    private function yourFunctionToPopulate(e:Event):void
    {}
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm creating a flash rhythm game. I have a looping (at a certain frame
I'm planning on creating a game that contains a landscape with objects on it.
I'm interested in creating a game that uses fractal maps for more realistic geography.
I'm creating a 2d flash game (coded in flex/actionscript 3) where assets are downloaded
I'm creating a tower-defense game in javascript and want to have a high score
I am creating a matching game for Android, and when the user gets a
I am creating a C++ SDL game engine, and it is relevant to know
Creating Traversals for Binary Search Tree with Recursion. void inOrder(void (*inOrderPtr)(T&)) { if(this->left !=
When creating a web application, and lets say you have a User object denoting
I'm creating a game where a lot of images are being used in Actionscript

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.