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

  • Home
  • SEARCH
  • 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 6238175
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T11:09:49+00:00 2026-05-24T11:09:49+00:00

I wrote a simple game and I want to add custom pointer. I created

  • 0

I wrote a simple game and I want to add custom pointer. I created MovieClip called Pointer, exported it to AS3 and wrote this code:

var pointer:Pointer = new Pointer();
pointer.scaleX=0.1; //that's because cursor turned to be MUCH bigger than needed
pointer.scaleY=0.1;
stage.addEventListener(MouseEvent.MOUSE_MOVE, redrawCursor); 
stage.addEventListener(Event.MOUSE_LEAVE, hideCursor); 
Mouse.hide(); 
function redrawCursor (event:MouseEvent):void { 
    pointer.visible = true; 
    pointer.x = event.stageX; 
    pointer.y = event.stageY; 
} 
function hideCursor (event:Event):void { 
    pointer.visible = false; 
} 

I suppose there’s nothing to explain — code is too simple.
In the game, on frame 74 some objects are created on the stage. If I paste this code BEFORE generating and adding other MovieClip instances, cursor is actually BEHIND these objects. If I paste this code AFTER, mouse is on top, but MouseListeners don’t react at all. What’s the problem? :SS

  • 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-24T11:09:50+00:00Added an answer on May 24, 2026 at 11:09 am

    Add a container to your movie at the very top. If not sure use:

    var container : Sprite = new Sprite();
    container.name = "pointer";
    stage.addChild(container);
    

    This should work to have your pointer placed at the very top at all times. This is because your main application is by default the first (and the only) child of the stage. Adding the container to the stage will place it right above the main application.

    Add your pointer to this container.

    Sprite(stage.getChildByName("pointer")).addChild(pointer);
    

    Disable mouse interactivity of your pointer. Otherwise it could swallow your mouse clicks and they never reach the movie clips underneath.

    pointer.mouseEnabled = false;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hey, I recently wrote this fairly simple game of life in JavaScript. Within this
I wrote a simple Windows Forms program in C#. I want to be able
I'm trying to set a color variable in a simple game I want to
I'm trying to write a very simple number guessing game (code is below). After
I want to write a simple game like pacman in C# in order to
I want to write a very simple game in Java to demonstrate a wireless
I want to create a simple game like Space Invaders. I know that I
This is a very simple game I'm trying to write but I have a
I want to create a 2D game with monsters build as a custom vertex
I want to try making a simple game engine. Just something that handles states,

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.