A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: Replacing mouse with a mc Issue

  1. #1
    Senior Member
    Join Date
    May 2005
    Location
    Wisconsin
    Posts
    181

    Question Replacing mouse with a mc Issue

    When I use the code in red once my cursor has replaced the mouse i can no longer click on my boxes. When i do not use the hide mouse code i can click the boxes just fine. What am I doing wrong?

    Code:
     
    stage.addEventListener("mouseMove", eyesFollow);
    function eyesFollow(e:MouseEvent):void {
    	Mouse.hide();
    	cursor_mc.x=mouseX;
    	cursor_mc.y=mouseY;
    }
    
    
    
    //Dim boxes for answers.
    var mc0:Box=new Box();
    var mc1:Box=new Box();
    var mc2:Box=new Box();
    var mc3:Box=new Box();
    
    
    //Get boxes on screen
    var myx:Number = 0
    var myy:Number = 100
    var i:Number = new Number();
    Addboxs();
    function Addboxs() {
    
    	for (i=0; i<4; i++) {
    
    		addChild(this["mc"+i]);
    		this["mc"+i].x=myx;
    		this["mc"+i].y=myy;
    		this["mc"+i].mytext.text="this is "+i;
    
    		myy+=100;
    
    	}
    	for (i=0; i<4; i++) {
    		swapChildren(this["mc"+i], cursor_mc);
    	}
    }
    
    mc0.addEventListener(MouseEvent.MOUSE_UP, mc0_btn);
    function mc0_btn(event:MouseEvent):void {
    	trace("Hit")
    }
    mc1.addEventListener(MouseEvent.MOUSE_UP, mc1_btn);
    function mc1_btn(event:MouseEvent):void {
    	trace("Hit")
    }
    mc2.addEventListener(MouseEvent.MOUSE_UP, mc2_btn);
    function mc2_btn(event:MouseEvent):void {
    	trace("Hit")
    }
    mc3.addEventListener(MouseEvent.MOUSE_UP, mc3_btn);
    function mc3_btn(event:MouseEvent):void {
    	trace("Hit")
    }
    Josh
    Multimedia Programmer
    flashmajic.com

  2. #2
    Ө_ө sleepy mod
    Join Date
    Mar 2003
    Location
    Oregon, USA
    Posts
    2,441
    Try:

    PHP Code:
    cursor_mc.mouseEnabled false
    Please use [php] or [code] tags, and mark your threads resolved 8)

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