Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6534599
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T10:16:12+00:00 2026-05-25T10:16:12+00:00

When button1 is clicked, the cursor changes into a ‘movieclip’ I want this movieclip

  • 0

When button1 is clicked, the cursor changes into a ‘movieclip’
I want this movieclip cursor to switch back into a regular cursor
when button1 is clicked again, so toggle the function on and off.

My question to you is, is it likely to use some kind of boolean here to toggle the function on and off or am I in the wrong direction?
Thanks in advance!

button1.addEventListener(MouseEvent.CLICK,wipe);

function wipe(e:Event):void 
{

        Mouse.hide();
        stage.addEventListener(MouseEvent.MOUSE_MOVE,follow);
        function follow(evt:MouseEvent)
              {
              cursor.x = mouseX;
              cursor.y = mouseY;
              }
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T10:16:12+00:00Added an answer on May 25, 2026 at 10:16 am

    Try

    protected function wipe(e:Event):void {
        if (stage.hasEventListener(MouseEvent.MOUSE_MOVE, follow) {
            stage.removeEventListener(MouseEvent.MOUSE_MOVE, follow);
        } else {
            stage.addEventListener(MouseEvent.MOUSE_MOVE, follow);
        }
    }
    

    I’d move the definition of follow out of wipe. Does that even work?

    If you need to have other listeners for MOUSE_MOVE directly on the stage then you might want to go with something more like:

    protected var isFollowing:Boolean;
    protected function wipe(e:Event):void {
        if (isFollowing) {
           stage.removeEventListener(MouseEvent.MOUSE_MOVE, follow);
       } else {
            stage.addEventListener(MouseEvent.MOUSE_MOVE, follow);
       }
       isFollowing = !isFollowing;
    }
    

    Note: I’ve assumed you’re going to put your code into a document Class, since I always assume that if you care enough to ask on a place like Stack Overflow, you’d like to use good practice.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to bring the cursor to a textbox when i clicked a button.
So I want a Button1 to be clicked when the submit button has been
I changed the cursor Icon whenever a certain toggle button is clicked. But the
Typical jQuery over-use: $('button').click(function() { alert('Button clicked: ' + $(this).attr('id')); }); Which can be
when a submit button is clicked i want to generate a pop up showing
I've been working on this for days, off and on. What I want to
I need a way of changing the mouse-cursor on a html-page. I know this
I want to show mouse coordinates while the cursor over the red div and
This is what I want to accomplish. I have two buttons, when I press
I would like to handle a button clicked event in a native c++ class.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.