开发者

Custom cursor gets overlayed by vertical ibar cursor on Text component

开发者 https://www.devze.com 2022-12-23 03:01 出处:网络
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 poi

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">

  <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:Ar开发者_如何学运维ray>
      <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


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">


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消