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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T07:17:55+00:00 2026-06-08T07:17:55+00:00

I have an application which has a ‘user.as’ class and I have a popup

  • 0

I have an application which has a ‘user.as’ class and I have a popup which displays products details. I want to add a ‘market’ property to this popup but it’s not working. here is the code:

User.as:

package com.brb.domain
{

[RemoteClass(alias="com.brb.user.userIBO")]
[Table(name="User")]
[Bindable]
public class User
{
    /**
     * Id of the user.
     */
    [Id(strategy="assigned")]
    public var UserID: Number;
    
    public var market: String;
    
    public var isAuthenticated: Boolean;
    
    public function User()
    {
        super();
    }
}

}

I then have an Product.mxml class which displays the product details in a popup:

import com.brb.domain.Product;
import com.brb.domain.User;

...
[Bindable]
private var _product: Product;
[Bindable]
private var _currentUser: User;

public function set product( value: Product ): void
        {
this._product = value;
mySrc ="file:///C|/MultimediaSync/market_"+this.market.toString()+"/pictures/"+imageName;   
trace(this._currentUser.market.toString());
...

}

The above is returning:

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

My question is how can I access properties from User.as class in another function like above?

  • 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-08T07:17:57+00:00Added an answer on June 8, 2026 at 7:17 am

    Flex is an Object Oriented language. What this means is that (in most cases, excluding things called ‘statics’) you need an instance of an object to access its characteristics.

    In this case, ‘User’ is your object, as defined in User.as, and you need an instance of it, by calling

    _currentUser = new User();
    

    somewhere in your MXML, before you try to reference _currentUser.market. This new User() syntax is referred to as instantiating an object, or creating an instance. Afterwards, _currentUser holds a reference to that instance of the object, which has a _market property you can access.

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

Sidebar

Related Questions

I have an application which has a Prefernces Class and I want to know
I have an MVC application which has a set of fields for contact details
I have a application which has 6 count down timers. I want the application
I have an application which has many icons (Buttons). I want to put a
I have one Application which has more then 5 Activity I want to know
I have an application which has multiple activities associated with it. When the user
I have an application which has settings where user can define what file will
I have an application which has a similar interface to Visual Studio, in that
I have an application which has a Projects table and a Users table. In
We have an application which has about 15000 pages. For better SEO reasons we

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.