dcsimg
A Flash Developer Resource Site

Results 1 to 6 of 6

Thread: Problem with mouseEnabled = false;

  1. #1
    Senior Member
    Join Date
    Oct 2008
    Posts
    179

    Problem with mouseEnabled = false;

    I have a video time line and am trying to use a custom cursor when in the time line. I added a mouse_over and mouse_out event to the time line which works fine. Here are my functions:
    PHP Code:
            private function trackOver(e:MouseEvent):void
            
    {
                
    Mouse.hide();
                
    stage.addEventListener(MouseEvent.MOUSE_MOVEstartFollow);
                
    _hrCursor = new HorizontalResizeCursor();
                
    addChild(_hrCursor);
                
    _hrCursor.mouseEnabled false;
                
    _xOffset mouseX _big_timeline["thumb_mc"].x;
            }

            private function 
    trackOut(e:MouseEvent):void
            
    {
                
    Mouse.show();
                
    stage.removeEventListener(MouseEvent.MOUSE_MOVEstartFollow);
                
    stage.removeEventListener(Event.ENTER_FRAMEgetTimeText);
                
    removeChild(_hrCursor);
                
    _big_timeline["thumb_mc"].alpha 0;
            }

            private function 
    startFollow(e:MouseEvent):void
            
    {
                
    _hrCursor.e.stageX;
                
    _hrCursor.e.stageY;
                
    _big_timeline["thumb_mc"].alpha 1;
                
    _big_timeline["thumb_mc"]._big_timeline.mouseX - (_big_timeline["thumb_mc"].width 2) + 2;
                
    stage.addEventListener(Event.ENTER_FRAMEgetTimeText);
                
    e.updateAfterEvent();
            } 
    My problem with the new cursor is, when I move the mouse in the time line, it adds it then removes itself. I put some traces in the trackover trackout functions and I saw that it would do trackover then trackout right after. So I did mouseEnabled = false on the custom cursor, but its still doing it. Any ideas??

  2. #2
    Mod cancerinform's Avatar
    Join Date
    Mar 2002
    Location
    press the picture...
    Posts
    13,448
    Which is the object triggering trackOver(e:MouseEvent)?
    - The right of the People to create Flash movies shall not be infringed. -
    | www.Flashscript.biz | Flashscript Biz Classes/Components |

  3. #3
    Senior Member
    Join Date
    Oct 2008
    Posts
    179
    Its when you mouse over big_timeline. I ended up not doing the addChild way and just placed it on the stage with its visibilty set to false, showed it when in trackOver and hid it when trackOut. It was doing the same thing so I did mouseEnabled = false as well as mouseChildren = false and it worked! I tried mouseChildren with the addChild method and it didnt work.

  4. #4
    Mod cancerinform's Avatar
    Join Date
    Mar 2002
    Location
    press the picture...
    Posts
    13,448
    If mouseChildren=false did not work, it means that the movieclip was at the time not a child of the object, which refers to the parent of mouseChildren. You can test that by a trace.
    - The right of the People to create Flash movies shall not be infringed. -
    | www.Flashscript.biz | Flashscript Biz Classes/Components |

  5. #5
    Senior Member
    Join Date
    Oct 2008
    Posts
    179
    Well according to my first post code, can you see where it would not be a child of stage? doing just 'addChild(MovieClip)' makes it a child of stage right? or child of root?

  6. #6
    Mod cancerinform's Avatar
    Join Date
    Mar 2002
    Location
    press the picture...
    Posts
    13,448
    It makes it a child of the root. But the Stage is the parent of root as well. This example works whether you use stage or not:
    It should be a child of the stage. This example works well. If you use mouseChildren, all children of the parent are affected.
    var aa:Clip=new Clip();
    aa.addEventListener (MouseEvent.CLICK, cl);
    function cl (e:MouseEvent):void
    {
    trace ("clicked");
    }
    addChild(aa);
    stage.mouseChildren = false;

    However if you use mouseEnabled you need to specify the object:
    aa.mouseEnabled = false;
    - The right of the People to create Flash movies shall not be infringed. -
    | www.Flashscript.biz | Flashscript Biz Classes/Components |

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