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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T06:04:24+00:00 2026-06-15T06:04:24+00:00

This is my second day using FLEX and AS 3.0 so I am very

  • 0

This is my second day using FLEX and AS 3.0 so I am very new at this. I am trying to obtain the value of the selected item in a tree component, in this case it is just a name. Below is the tree I have created. The tree contents have been populated programmatically with an array called “cat”. The tree gets populated just fine but I can’t figure out how to get the name of the currently selected item.

<mx:Tree id="category_tree" x="10" y="80" width="160" height="169" showRoot="true" dataProvider="{cat}" labelField="name">

I have used the selectedItem.toString() function but this only seems to return the type of object and not the value. Currently it returns “object Object”
In my script I have…

category_tree.selectedItem.toString();

Any help on this would be greatly appreciated. Thank you in advance for your time.

  • 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-15T06:04:26+00:00Added an answer on June 15, 2026 at 6:04 am

    You can add a change event to the tree and have use a callback similar to:

     private function changeEvt(event:Event):void {
            var lableData:*;
            var label:String;
    
            if (event.currentTarget.selectedItem.@data) {
               labelData = event.currentTarget.selectedItem.@data;
            }
    
            label = event.currentTarget.selectedItem.@label; 
         }
     }
    

    or access the value directly

    category_tree.selectedItem.@label;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I know I'm a newbie in Rails but this is the second day I'm
I'm in my second day of learning Objective-C, Cocoa and IB. This is probably
This is very similar to a question I asked the other day but my
This is very similar to a question I asked the other day but my
I have a very simple chat system I've built using PHP and MySQL (this
This is my second day of doing anything at all with javascript so I
I'm quite new to Mac OS X development(just my second day). Did a couple
Today is my second day of trying to use amazon and i have started
I am using: $(function () { endAuction = new Date( data.year, data.month, data.day, data.hour,
I’m trying to complete the second exercise on IO day 2 in the book

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.