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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T22:34:32+00:00 2026-05-19T22:34:32+00:00

I have this project for school where i have to populate a drop down

  • 0

I have this project for school where i have to populate a drop down list control from an xml file.
I mange to do that for a label/text input control, but i can’t seem to do that on a drop down.
I get this error any time i tell him to “additem” with an xml query (not getting it with simple text):
“#1009 Cannot access a property or method of a null object reference”

This is the function that getting the xml file:

private function myFunc(event:ResultEvent):void
{
   myXml=event.result as XML;
}

This is the function that launch after the control got build:

protected function ActivityDropDown_creationCompleteHandler(event:FlexEvent):void
{

    droplistdb=new ArrayList();
    ActivityDropDown.dataProvider=droplistdb;
    droplistdb.addItem({label:myXml.Activity.(attribute("publish")=="true").ActivityName});
} 
  • 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-19T22:34:32+00:00Added an answer on May 19, 2026 at 10:34 pm

    Here are a couple tweaks that should make debugging this a bit easier.

    First don’t create a new ArrayList just for the DropDown’s dataprovider. Just set the XMLList of Actitivies as the dataProvider and use a labelFunction to grab the ActivityName out of the XML.

    Here’s your debug labelFunction:

    //set a breakpoint on each line
    function(obj:XML):String{
      var activityName:XML = obj.ActivityName;
      return activityName.toString();
    }
    

    If you don’t get to the label function then this E4X query is wrong -> myXml.Activity.(attribute(“publish”)==”true”). You’ll want to break that down piece by piece. Try to get a proper XMLList out of myXml.Activity nodes?

    trace(myXml.Activity.length());//should show the number of Activity nodes
    

    Try that out and let us know how it turns out.

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

Sidebar

Related Questions

This is for a school project. I have a Query<E> class that holds an
I have this project that it's due in a few hours and I still
I have this large C++ project that I need to build on a platform
I have this tiny Qt project with a project file like this: TEMPLATE =
For a school project I have to create a distributed system from a standalone
I have this school project I'm making, where I need to make my code
For a school project we have to create an evaluation website that requires a
I have a group project for school that I am working on. A member
Basically I have a school project where I must create a new wave file
I have a function that reads a formatted file. It looks like this: 1;Name_of_the_author;The

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.