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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T10:01:54+00:00 2026-06-02T10:01:54+00:00

i use a flex spark itemrenderer to visualize rows of data. each row also

  • 0

i use a flex spark itemrenderer to visualize rows of data. each row also has a button that should do something dependening on which row it is. for this i need access to the datarow when the button is clicked. but i dont know how to get it.

this is how the itemrenderer looks:

<?xml version="1.0" encoding="utf-8"?>
<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/halo">
<fx:Script>
<![CDATA[
private function click(e:flash.events.Event):void
{
    //how do i get access to the data of the row here?
}
]]>
</fx:Script>

<s:HGroup>
 <s:Label text="{data.GameName}" width="300" />
 <s:Button label="Start" click="click(event)" />
</s:HGroup>

</s:ItemRenderer>
  • 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-02T10:01:57+00:00Added an answer on June 2, 2026 at 10:01 am

    The data property of the itemRenderer will contain the element from your dataProvider that this itemRenderer is currently displaying.

    You can use use the itemIndex property to get the index of your data element inside the list’s dataProvider.

    I think you need one of the previous two, but since “datarow” is ambigious to me, here are a few other thoughts that may help.

    If you need to access the instance of the row; that is no different than the itemRenderer instance, so you can use the this keyword to access properties on the itemRenderer where the button was clicked.

    If you need to know the index of the itemRenderer in the context of all of the list’s itemRenderers; that is going to be much more difficult. Since itemRenderers are reused as the list is scrolled, there is not a one-to-one relation between the number of renderer instances and the number of items in your dataProvider. I’m not sure why you’d need that, though, so I’m guessing this is not what you need.

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

Sidebar

Related Questions

Can a Flex application that was designed for use on a PC be run
Does websites created by Flex Builder works on every browsers that use Flash ?
In my Flex 4.6 web application I use mainly spark components, but there is
I need to create an application that will use Flex on the client side
I have an ArrayCollection that is the dataProvider for a spark.components.List , which has
I use flex to work on a scanner to replace \ with ; and
I am learning how to use Flex with Adobe Flash Builder 4 standalone. I
How do I reference a fla component from an actionscript project? I use flex
Could anyone tell me if it is possible to use the flex 4 framework
This question may be an absolute crap. Can i use the flex 4 sdk

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.