A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: [RESOLVED] [CS3] Custom cursor disappearing

  1. #1
    Junior Member
    Join Date
    Aug 2008
    Posts
    19

    resolved [RESOLVED] [CS3] Custom cursor disappearing

    Hi. My custom cursor keeps disappearing behind other elements on the stage. I've tried bringing the mycursor_mc movie clip to the front with Arrange, and I've also tried moving the layer the cursor is on to the top and bottom of the stack in the fla file. Neither method has fixed the problem.
    Thanks in advance for any help with the problem. Here's the AS3 code I've used in frame 1 of the timeline:

    stop();
    addChild(mycursor_mc);
    Mouse.hide();
    stage.addEventListener(MouseEvent.MOUSE_MOVE, moveCursor);

    function moveCursor(myevent:MouseEvent):void{
    mycursor_mc.x=mouseX;
    mycursor_mc.y=mouseY;
    myevent.updateAfterEvent();
    }

    Mosk

  2. #2
    Jack Foster cabbar's Avatar
    Join Date
    Feb 2007
    Location
    England
    Posts
    111
    if the mycursor_mc is on top of all the other MCs layers then it should realy work !

    I've just checked it and I can't see any problem with it !
    try removing addChild(mycursor_mc); from the code,
    so it would be;

    Mouse.hide();
    stage.addEventListener(MouseEvent.MOUSE_MOVE, moveCursor);

    function moveCursor(myevent:MouseEvent):void{
    mycursor_mc.x=mouseX;
    mycursor_mc.y=mouseY;
    myevent.updateAfterEvent();
    }

    this should also work ...

  3. #3
    Junior Member
    Join Date
    Aug 2008
    Posts
    19

    resolved

    Cabbar,

    Getting rid of the addChild statement got rid of the problem, leaving my custom cursor on top of the other items as dictated by its layer.

    Thanks for the help,
    Mosk

    (? Is there a specific way to mark this thread as finished / problem solved)
    Last edited by Mosk; 08-02-2008 at 11:07 PM. Reason: Want to mark thread / problem as resolved

  4. #4
    Jack Foster cabbar's Avatar
    Join Date
    Feb 2007
    Location
    England
    Posts
    111
    Im glad you've solved it

    yes , look up and find "Thread Tools" here on this page ,
    and
    click on "Mark Thread Resolved" ...

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