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

The Archive Base Latest Questions

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

I have some List and TileList controls. How can I get a reference to

  • 0

I have some List and TileList controls. How can I get a reference to the list item that’s currently under the mouse pointer?

  • 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-13T19:19:35+00:00Added an answer on May 13, 2026 at 7:19 pm

    Thanks for the answers so far. I ultimately came up with something different, and thought I would share it as well. The main reason I opted for this solution is because I am actually responding to an external event, as I am using the custom context menu library to capture the right-click in Javascript. When the right-click is happening, the user may not necessarily be moving the mouse. I could keep track of which item the pointer is over at all times, but I thought that would get complicated. Anyhow my solution worked by subclassing List, some thing like:

    package components{
        import mx.controls.List
        use namespace mx_internal
    
        public class MyList extends List{
    
            public function findItemIndexForMouse(stageX:Number, stageY:Number):Number{
                var item
                var pt:Point = new Point(stageX, stageY)
                pt = listContent.globalToLocal(pt)
                var rc:int = listItems.length
                for (var i:int = 0; i < rc; i++)
                {
                    if (rowInfo[i].y <= pt.y && pt.y < rowInfo[i].y + rowInfo[i].height)
                    {
                        item = listItems[i][0]
                        break
                    }
                }
                return itemRendererToIndex(item)
            }
        }
    }
    

    Now you can call list.findItemIndexForMouse() to get the index of the item given the mouse’s stage coordinates. Make sure you use the mx_internal namespace, or you won’t have access to some of the required instance variables. For TileList you have to do the same thing except the method looks a bit different:

    public function findItemIndexForMouse(stageX:Number, stageY:Number):Number{
        var item
        var pt:Point = new Point(stageX, stageY)
        pt = listContent.globalToLocal(pt)
        var rc:int = listItems.length;
        for (var i:int = 0; i < rc; i++)
        {
            if (rowInfo[i].y <= pt.y && pt.y < rowInfo[i].y + rowInfo[i].height)
            {
                var cc:int = listItems[i].length;
                for (var j:int = 0; j < cc; j++)
                {
                    if (listItems[i][j] && listItems[i][j].x <= pt.x
                        && pt.x < listItems[i][j].x + listItems[i][j].width)
                    {
                        item = listItems[i][j];
                        if (!DisplayObject(item).visible)
                            item = null;
                        break;
                    }
                }
                break;
            }
        }
        return itemRendererToIndex(item)
    
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 318k
  • Answers 318k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Set the SizingGrip attribute to false: StatusStrip.SizingGrip = false; May 13, 2026 at 11:55 pm
  • Editorial Team
    Editorial Team added an answer I saw a question on ScottGu's blog about it and… May 13, 2026 at 11:55 pm
  • Editorial Team
    Editorial Team added an answer Despite some other tools I feel the best approach is… May 13, 2026 at 11:55 pm

Related Questions

I have two mx:TileList controls that I'm using to allow editing of objects in
I have some data that I have stored in a list and if I
I have some data I want to work with. Two string and two numbers
I have some Haskell code that does work correctly on an infinite list, but
I have tried some ways to use LINQ dynamic queries - LINQKit and LINQ

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.