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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T09:43:08+00:00 2026-06-09T09:43:08+00:00

In flex3, List has isItemSelected() method, but I didn’t find them in flex4. My

  • 0

In flex3, List has isItemSelected() method, but I didn’t find them in flex4. My scenario is determining whether the current ItemRenderer is selected or not, and then depends on the selected value, do some logic on specific component in the ItemRenderer(suppose ItemRenderer has an Image component and Label component, I only want to do some logic on the Image)

  • 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-09T09:43:09+00:00Added an answer on June 9, 2026 at 9:43 am

    In Flex 4, item renderer functionality can make better use of states. What this means is that they have the default states, which we can use them to implement state-specific logic:

    normal
    hovered
    selected
    up
    

    If you want to do something when the item becomes selected, you could add a listener for the stateChangedComplete event, and implement your logic in that handler (of course, you would have to test if the current statate is ‘selected’). The code could look something like this:

    <s:ItemRenderer xmlns:fx="http://ns.adobe.com/mxml/2009"
                    xmlns:s="library://ns.adobe.com/flex/spark"
                    xmlns:mx="library://ns.adobe.com/flex/mx"
                    stateChangeComplete="stateChangedHandler()"
                    autoDrawBackground="false">
    
        <fx:Script>
            <![CDATA[
                protected function stateChangedHandler():void
                {
                    if(currentState == "selected")
                    {
                        // implement your logic here
                    }
                }
            ]]>
        </fx:Script>
    
        <!-- Your original MXML code here -->
    
    </s:ItemRenderer>
    

    This would be the way to go, if you need some non-trivial logic done. If, however, you just need to change some attributes on the image, when the item renderer becomes selected, you could just specify a state-specific property/value pair on the element instead, like so (let’s assume the images are faded by default, and when the item is selected, you want to fade them in, for the sake of the explanation):

    <s:Image alpha="0.5" alpha.selected="1" />
    

    This way, no listener/handler is required.

    Hope this helps. Have a great day.

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

Sidebar

Related Questions

I have a Flex3 application which has to be capable of uploading multiple files
I have a Flex3 project with 2 HorizontalList controls; one of which has drag
I have a list control in Flex that has been data bound to an
I'm developing an application that will randomize a list of words, and display them
I'm a pretty experienced Grails developer, but most of my experience has been with
I have an ArrayCollection that is the dataProvider for a spark.components.List , which has
I'm currently working on a Flex3/blazeDS/Spring/Oracle project. My requirement is display a list of
I want to create a custom list in Flex for an interface prototype. The
I have a list of webservices from a Flex project. I am trying to
i am doing a web application in flex. i have a list of items

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.