tags:

views:

78

answers:

2

Hi,

I am making use of a custom cursor on itemRenderers in a List component. The custom cursor works just fine except when I mouse over the Text component which is a child of the itemRenderer at which point I get two cursors, the custom and an iBar one on top of the other.

Here's the code:

<?xml version="1.0"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"&gt;

  <mx:Script>
<![CDATA[

    import mx.managers.CursorManager;
    import mx.managers.CursorManagerPriority;

    [Embed("grab.png")]
    public static const grabbing:Class;

    CursorManager.setCursor(grabbing, CursorManagerPriority.LOW, -16, -16);

]]>
  </mx:Script>

  <mx:List>

<mx:dataProvider>
  <mx:ArrayCollection>
    <mx:Array>
      <mx:Object title="Stairway to Heaven" />
    </mx:Array>
  </mx:ArrayCollection>
</mx:dataProvider>

<mx:itemRenderer>
  <mx:Component>
    <mx:Text text="{data.title}"/>
  </mx:Component>                       
</mx:itemRenderer>

  </mx:List>

</mx:Application>

If anyone could help me figure out how to get rid of this iBar it would be much appreciated.

Thanks,

Chris

A: 

I Think you probably need to extend the Text class your using in the item renderer and override something there.

FYI, anything in the <mx:Component> tag is out of scope with the rest of the file, so that Text class you're using in there doesn't even have access to the grabbing class you created.

invertedSpear
A: 

If you don't need to select the text, e.g. for copy-paste, you may just set the selectable attribute to false <mx:Text text="{data.title}"/ selectable="false">

Haha, excellent such a simple solution to such a big headache!
ChrisInCambo