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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T20:31:42+00:00 2026-05-11T20:31:42+00:00

My item renderer is an image, and the highlight for the selected item is

  • 0

My item renderer is an image, and the highlight for the selected item is under the image so you cannot see the highlight, is there a way to make the highlight “over” the image?

Thanks.

  • 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-11T20:31:42+00:00Added an answer on May 11, 2026 at 8:31 pm

    This is exactly the point at which I realized how complicated certain simple-seeming things in Flex can really be. 🙂

    There are various ways of handling a problem like this one depending on the effect you’re after, but the way I’ve always done it is first by overriding certain functions of the TileList, then by using custom itemRenderers. (I’ve never been able to figure out how to have the List’s graphics object of draw on top of the rendered content, though — someone else might be able to shed some light on that.)

    For example, I’ll usually create a new class that extends TileList, then override the methods responsible for drawing the highlight and selection indicators to get a bit more control over the way those functions draw the indicators (or sometimes I’ll just comment out their contents altogether, such that nothing gets drawn):

    public class MyCustomTileList extends TileList
    {
        public function MyCustomTileList()
        {
            super();
        }
    
        override protected function drawHighlightIndicator(indicator:Sprite, x:Number, y:Number, width:Number, height:Number, color:uint, itemRenderer:IListItemRenderer):void
        {           
            var g:Graphics = Sprite(indicator).graphics;
                g.clear();
                g.beginFill(getStyle("myRolloverColor"), getStyle("myRolloverAlpha"));
                g.drawRect(1, 1, width - 1, height - 1);
                g.endFill();
    
                indicator.x = x;
                indicator.y = y;
        }
    
        override protected function drawSelectionIndicator(indicator:Sprite, x:Number, y:Number, width:Number, height:Number, color:uint, itemRenderer:IListItemRenderer):void
        {
            //
        }
    }
    

    But as you say, since the graphics object always seems to draw behind the content of the list item, I’ll usually opt to use an item renderer to draw something (e.g., a translucent box) on top of the image associated with my data item:

    <?xml version="1.0" encoding="utf-8"?>
    <mx:Canvas xmlns:mx="http://www.adobe.com/2006/mxml">
    
        <mx:Script>
            <![CDATA[
    
                private function img_rollOver():void
                {
                    highlight.visible = true;
                }
    
                private function img_rollOut():void
                {
                    highlight.visible = false;
                }
    
            ]]>
        </mx:Script>
    
        <mx:Image id="img" source="{something}" horizontalCenter="0" verticalCenter="0" buttonMode="true" useHandCursor="true" mouseChildren="true" rollOver="img_rollOver()" rollOut="img_rollOut()" />
        <mx:Box id="highlight" alpha="0.1" color="#FFFFFF" horizontalCenter="0" verticalCenter="0" width="{img.width}" height="{img.height}" buttonMode="true" useHandCursor="true" mouseChildren="true" rollOver="img_rollOver()" rollOut="img_rollOut()" visible="false" />
    
    </mx:Canvas>
    

    I’m sure there are other approaches, but this one works pretty well for me, and I usually find other benefits to subclassing the stock Flex controls as well.

    Hope it helps!

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

Sidebar

Related Questions

i want to reuse an image multiple times within an item renderer, is it
In my flex app there's an item renderer for a TileList that I am
I have this item renderer MyRenderer.mxml <?xml version=1.0 encoding=utf-8?> <mx:HBox xmlns:mx=http://www.adobe.com/2006/mxml implements=mx.core.IDataRenderer > <mx:Script>
I am enabling multiple row selection with clicking checkbox Item renderer. this works for
I'm attempting to add an image to a datagrid item render dynamically in flex.
I use an item renderer to display a checkbox in my datagrid like; <mx:DataGridColumn
I have an item renderer with the following states: <s:states> <s:State name=normal/> <s:State name=hovered/>
I have a custom item renderer which displays a different gif in the row
I'm trying to write an item renderer (in Flash Builder 4.6) purely in action
I have a TileList with a custom ItemRenderer, and each item shows an image

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.