2 Replies Latest reply on Oct 15, 2007 11:34 AM by Apts247

    Tab Navigator Tabs show Hand Cursor

    upshotvideo Level 1
      Can anyone tell me how to get the hand cursor to show up when rolling over the tabs on a tab navigator? Button mode works, but also shows hand cursor over everything, not just the tab.
      Thanks
        • 1. Re: Tab Navigator Tabs show Hand Cursor
          Gregory Lafrance Level 6
          To use the below code you need to get a hand icon from a yahoo image search, or create your own. Maybe there is a way to access the system hand icon, that would be best:

          <?xml version="1.0"?>
          <mx:Application xmlns:mx=" http://www.adobe.com/2006/mxml">
          <mx:Script>
          <![CDATA[
          import flash.utils.*;
          import mx.managers.CursorManager;

          private var cursorID:Number = 0;

          private function setHandCursor(event:MouseEvent):void {
          var classInfo:XML = describeType(event.target);
          var cn:String = classInfo.@name.toString();
          if(cn == "mx.controls.tabBarClasses::Tab") {
          [Embed(source="assets/images/cursor_hand.gif")]
          var handCursorSymbol:Class;
          cursorID = CursorManager.setCursor(handCursorSymbol);
          }
          }
          private function removeHandCursor(event:MouseEvent):void {
          var classInfo:XML = describeType(event.target);
          var cn:String = classInfo.@name.toString();
          if(cn == "mx.controls.tabBarClasses::Tab") {
          CursorManager.removeCursor(cursorID);
          }
          }
          ]]>
          </mx:Script>

          <mx:WipeLeft id="myWL"/>
          <mx:TabNavigator id="tabNav" mouseOver="setHandCursor(event)" mouseOut="removeHandCursor(event)">
          <mx:VBox label="Accounts"
          width="300"
          height="150"
          showEffect="{myWL}">
          <!-- Accounts view goes here. -->
          </mx:VBox>
          <mx:VBox label="Stocks"
          width="300"
          height="150"
          showEffect="{myWL}">
          <!-- Stocks view goes here. -->
          </mx:VBox>
          <mx:VBox label="Futures"
          width="300"
          height="150"
          showEffect="{myWL}">
          <!-- Futures view goes here. -->
          </mx:VBox>
          </mx:TabNavigator>
          </mx:Application>
          • 2. Re: Tab Navigator Tabs show Hand Cursor
            Apts247
            wow, thank you so much, it works great.
            Thanks again