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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T05:07:31+00:00 2026-05-31T05:07:31+00:00

I am trying to assign a value from my database to a variable inside

  • 0

I am trying to assign a value from my database to a variable inside my Flex application. So far I read up a few ideas and I have at the moment the following code using a PHP web service:

protected function btnSubmitUser_clickHandler(event:MouseEvent):void
        {
            username = txtUsername.text;
            password = txtPassword.text;
            serialno = txtSerialNo.text;
            userName.writeUTFBytes(username);
            passWord.writeUTFBytes(password);
            serialNo.writeUTFBytes(serialno);
            EncryptedLocalStore.setItem("Username", userName);
            EncryptedLocalStore.setItem("Password", passWord);
            EncryptedLocalStore.setItem("Serial", serialNo);
            getRepnameByUsernameResult2.addEventListener(ResultEvent.RESULT, onMyResult); 
            getRepnameByUsernameResult2.token = repnameService.getRepnameByUsername(username);
        }

        protected function onMyResult(event:ResultEvent):void{ 
            repServ = getRepnameByUsernameResult2.lastResult as Repname; 
            repid = repServ.RepID; 
            RepID.writeInt(repid); 
            EncryptedLocalStore.setItem("Rep", RepID); 
            lblTestRep.text = RepID.toString();
        } 

The label is a test label to see if the data is being assigned correctly. Unfortunately, I am getting errors with this where it declares:

Error #1009: Cannot access a property or method of a null object reference.
at views::SettingsView/onMyResult()[C:\Users\Justin\Adobe Flash Builder 4.6\Rep Aware\src\views\SettingsView.mxml:62]

This error is found at repid = repServ.RepID; of the above code.

Any help as to what I am doing wrong would be appreciated.

  • 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-31T05:07:31+00:00Added an answer on May 31, 2026 at 5:07 am

    That error means that repServ is null. So the property lastResult in:

    repServ = getRepnameByUsernameResult2.lastResult as Repname;
    

    is either null, or is not of type Repname.

    The second option is possible because casting an object to an unrelated type using as returns null. The same cast would throw an exception if you do it like this:

    repServ = Repname(getRepnameByUsernameResult2.lastResult);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an asp.net mvc application and i am trying to assign value to
i'm trying to assign a parent's variable from the parent's child //Parent public class
I am trying to get my program to read a value from a particular
I am trying to get value from the databse and assign it to the
I am trying to assign a regular expression result to an array inside of
In My application I am pre-populating some data from the Server. When I assign
PLATFORM: PHP, mySQL WHAT I HAVE: I have a Database table. Within my application,
Im trying to call all users from a database with the same interests as
I am trying to get a value fro query string and assign that value
I have code which selects data from my database and then sets these selected

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.