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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T08:01:51+00:00 2026-06-14T08:01:51+00:00

I am trying to create two var one var is a object that gets

  • 0

I am trying to create two var one var is a object that gets another object inside the same class

package plus1 
{

public class ScreenInfo 
{

    //setting a button to 0 means that it is disabled 

    public var object:Object = { button1:_Object2 };

    public var _Object2:Object = { name:"test name" };                          

    public function ScreenInfo() 
    {

    }


}

}

but ever time i do this

var screens:ScreenInfo = new ScreenInfo(); 
var obj:Object = screens.object["button1"]

the object is null why is this shouldn’t it pass me the second object?

  • 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-14T08:01:53+00:00Added an answer on June 14, 2026 at 8:01 am

    Because you are using variable initializers, you can’t safely use references to other members. How do you know that _Object2 exists when you create object ?

    I suggest you move the instantiation of object in the constructor of your class :

    public var object:Object;
    public var _Object2:Object = { name:"test name" };
    
    public function ScreenInfo(){
        this.object = {button1:_Object2};
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to create two separate sessions- one for if the user is
I am trying to create two separate sessions- one for if the user is
I am trying to create two select lists both filled with the same times.
I'm trying to create two functions: get & set, that both accept an arbitrary
I'm trying to create a two-level horizontal navigation menu (or menubar) that displays the
I'm trying to create a map using Google Fusion Tables with two layers, one
Trying to create two clients; one is pub/sub, the other is a standard connection.
Does it make sense to create new object before trying to save object that
I'm trying to create two ASP.NET Membership login pages for an ASP.NET website I'm
I am trying to create two different sets of settings for datepicker( http://keith-wood.name/datepick.html )

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.