dcsimg
A Flash Developer Resource Site

Results 1 to 5 of 5

Thread: handCursor to work on a TextField?

  1. #1
    Member
    Join Date
    Feb 2006
    Posts
    96

    handCursor to work on a TextField?

    I am having problems getting a hand cursor to come up over a textField. I have verified the way I am doing it and everything looks ok, but no cursor.

    Here's my code:
    PHP Code:
    var myText:TextField=new TextField();
    var 
    mySprite:Sprite=new Sprite();

    myText.text="this is a test";
    myText.mouseEnabled=true;

    mySprite.buttonMode=true;
    mySprite.useHandCursor=true;
    mySprite.mouseEnabled=true;

    mySprite.addChild(myText);

    addChild(mySprite);

    myText.addEventListener(MouseEvent.ROLL_OVER,rollover);

    function 
    rollover(e:MouseEvent):void {
        
    trace("myText rolled over!");

    My trace works and I am not throwing any errors. Any ideas what I am doing wrong?

  2. #2
    Total Universe Mod jAQUAN's Avatar
    Join Date
    Jul 2000
    Location
    Honolulu
    Posts
    2,429
    Try adding,
    mySprite.mouseChildren = false;

  3. #3
    Senior Member joshstrike's Avatar
    Join Date
    Jan 2001
    Location
    Alhama de Granada, España
    Posts
    1,131
    er, I think
    myText.selectable=false;
    is what's missing... if it's not input text. Killing mouseChildren on the sprite would prolly work too, but I'm not sure it would stop text selection (?)

  4. #4
    Mod cancerinform's Avatar
    Join Date
    Mar 2002
    Location
    press the picture...
    Posts
    13,448
    Place the textfield into a Sprite. Only Sprites or Movieclips can have buttonMode.

    var myText:TextField = new TextField();
    myText.text = "This is text";
    myText.mouseEnabled = false;
    var mc:Sprite = new Sprite();
    addChild(mc);
    mc.addChild(myText);
    mc.buttonMode = true;
    - The right of the People to create Flash movies shall not be infringed. -
    | www.Flashscript.biz | Flashscript Biz Classes/Components |

  5. #5
    Member
    Join Date
    Sep 2009
    Posts
    88
    Was having that issue with a textfield within a movieclip, the buttonmode was glitchy due to the child textfield but

    mouseChildren = false;

    did the trick, ty.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center