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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T23:51:12+00:00 2026-05-25T23:51:12+00:00

I am having an issue with picking up custom data types from a drop

  • 0

I am having an issue with picking up custom data types from a drop down lists. To make this as easy to understand as possible, I’ll use a simple example of what I want to be able to do

So say I have a custom data type (Say of type Dog). Dog contains a name, breed and age. I store each instance of a dog in an ArrayCollection:

[Bindable]
private var dogData : ArrayCollection;

This ArrayCollection holds 1..N Dog objects with the respective information. Now having a dropdown like so:

<s:DropDownList x="81" y="178" id="dogSelected" prompt="Dog Selected:" dataProvider="{dogData}" labelField="dogNameData"  />

the dogNameData would hypothetically come from a custom ActionScript class that has the ‘name’ field of the Dog in that object.

Now I want to select a certain dog from the dropdown. I tried to just do it this way:

var theDog : Dog;
theDog = dogSelected.selectedItem;

However, ActionScript does not seem to like this. Now, I read around and found out that using the label field is the way to be able to select this. I have been unable to select the dog item, so I can then bind it to:

var selectedDogBreed : String;
//var theDog : Dog = the selected object from my drop down
selectedDogBreed = theDog.breed

Would anyone be able to help me be able to select this object from the drop down? Much thanks in advance.

Also to note, the ArrayCollection is dynamically generated. In my actual application I am trying to figure this out for, my array of custom data is dynamic. Nothing is hard coded

  • 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-25T23:51:13+00:00Added an answer on May 25, 2026 at 11:51 pm

    To access the selectedItem of a drop down; you’ll have to cast it as the type you want:

    var theDog : Dog;
    theDog = dogSelected.selectedItem as Dog
    

    The labelfield has nothing to do with accessing the selectedItem. The labelField is just used by the default itemRenderer to decide what value to display in the drop down. IF you’re not seeing any text displayed in the drop down; or seeing [object object] or something similar, then that is where labelField comes into play.

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

Sidebar

Related Questions

I’m having an issue where a drop down list in IE 6/7 is behaving
I am having issue when sending data from Service to Activity through Notification ,
Having issue with displaying the Data from a second Activity. when I run the
Possible Duplicate: Check checkbox checked property using jQuery I am having an issue picking
I'm having this issue on several server environments. We have a list at the
i have a design issue regarding sending user data from a mobile phone app
I'm having issue converting this string to a decimal. I tried to follow the
I'm hoping non-IIS people can help me on this though the issue I'm having
I am having issue with opencv's Sobel edge detector. From its documentation it seems
So this error is coming from an attempt to solve another issue I am

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.