Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

How to restrict the custom mouse cursor area

Participant ,
Jan 13, 2013 Jan 13, 2013

Dear Friends,

i have an swf loaded in another frame, i want to show a custom cursor (hand pic). iam using the following code. its working fine in the loaded swf. when i move the mouse to the bottom of the screen that is navigation area in actual frame the cursor has to go back to flash arrow cursor.

var hide_m:Boolean = true;

stage.addEventListener(MouseEvent.MOUSE_MOVE, handmove);

function handmove(event:MouseEvent) {

    trace(mouseY);

    if (hide_m && mouseY<138) {

        Mouse.hide();

        hand.gotoAndStop(1);

        hand.x = mouseX;

        hand.y = mouseY;

    } else {

        showmouse();

    }

}

function showmouse() {

//hide hand pic and show mouse....

    hand.gotoAndStop(2);

}

it is not working, it shows the hand pic in the stage. but when i move the bottom area that is more than 138, the normal cursor is not coming back pls help me.  to restrict the area to show the custom cursor....

Thanks in advance,

Syed Abdul Rahim

TOPICS
ActionScript
878
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Expert , Jan 13, 2013 Jan 13, 2013

unless there is a Mouse.show() in frame 2 of hand, that's not going to work.  to remedy, execute Mouse.show() in showmouse() and remove hand from the display list (removeChild).

use addChild() and Mouse.hide in the first conditional branch of handmove

Translate
Community Expert ,
Jan 13, 2013 Jan 13, 2013

unless there is a Mouse.show() in frame 2 of hand, that's not going to work.  to remedy, execute Mouse.show() in showmouse() and remove hand from the display list (removeChild).

use addChild() and Mouse.hide in the first conditional branch of handmove

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Jan 16, 2013 Jan 16, 2013
LATEST

Thks Mr.kglad, its working fine! when i click on the particular button and hide my custom mouse and show my actual mouse. its shows the computer mouse in the same place where i click, is there any way to show or move the mouse to some where else in the stage?

Thanks in advance,

Regards,

Syed Abdul Rahim

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines