Skip to main content
November 15, 2013
Answered

How to make mouse become normal again on an other scene

  • November 15, 2013
  • 1 reply
  • 920 views

Hi guys, so I have this bit of code :

import flash.events.MouseEvent;

import flash.events.Event;

stop();

addEventListener(Event.ENTER_FRAME, GetMouse);

function GetMouse(event:Event)

{

 

          if(mouseX>365 && mouseX<613 && mouseY <170 && mouseY >120)

          {

                    Mouse.cursor="button";

                    addEventListener(MouseEvent.MOUSE_DOWN, goToLevel);

                              function goToLevel(event:MouseEvent):void

                                        {

                                                  gotoAndStop(1, "Lv1");

                                        }

          }

 

          else if(mouseX>365 && mouseX<613 && mouseY <234 && mouseY >185)

          {

                    Mouse.cursor="button";

                    addEventListener(MouseEvent.MOUSE_DOWN, goToLevelSelect);

                              function goToLevelSelect(event:MouseEvent):void

                                        {

                                                  gotoAndStop(2, "LvSelect");

                                        }

          }

 

          else

          {

                    Mouse.cursor="auto";

          }

}

And it basically makes my first scene have 2 clickable buttons that lead me to a 2nd and 3rd scene. The problem is that once I am on scene 2 or 3, the cursor stays like if it was on a button when i put it over the zone i defined in the other scene, I thought code would not affect my other scenes that's why I did that. Is there any way I can make my cursor go back to normal in the other scenes?

This topic has been closed for replies.
Correct answer kglad

do you have any problem in scene 2 after that code executes and you apply no other Mouse.cursor code?

1 reply

kglad
Community Expert
Community Expert
November 15, 2013

assign it to "auto" when in other scenes.

November 15, 2013

Mouse.cursor="auto";

Got this on scene 2 but I still have the button cursor appear when I go to the same locations as scene 1

kglad
Community Expert
kgladCommunity ExpertCorrect answer
Community Expert
November 15, 2013

do you have any problem in scene 2 after that code executes and you apply no other Mouse.cursor code?