PDA

View Full Version : Double_click ?



453.0
November 24th, 2007, 05:27 PM
Ok, this on is simple but it simply won't work for me... I tried it 1000 times but nothing :) I have no idea what I'm doing wrong but I simply can't make DOUBLE_CLICK work:
var circle:Sprite = new Sprite(); addChild(circle); circle.graphics.beginFill(0xff0000); circle.graphics.drawCircle(0, 0, 50); circle.graphics.endFill(); circle.x = stage.stageWidth / 2; circle.y = stage.stageHeight / 2; circle.addEventListener(MouseEvent.DOUBLE_CLICK, onMouseEvent); function onMouseEvent(event:MouseEvent):void { trace(event.type); } Thanks.

453.0
November 24th, 2007, 05:29 PM
it simply won't react... no output, no nothing.... why ?

ethernal
November 24th, 2007, 06:51 PM
You missed the magic instruction:


circle.doubleClickEnabled = true;

(-:

Felixz
November 24th, 2007, 06:56 PM
Thats because u need to set
circle.doubleClickEnabled=true;
It's in Flash's help.

453.0
November 24th, 2007, 07:43 PM
Uhh, thanks, I missed that crap somehow... thanks ;)