[Flashcoders] separating MouseEvent.MOUSE_UP from MouseEvent.CLICK
hi guys quick question - is it possible to separate a MOUSE_UP event from a CLICK event? i have a mouse listener function that does the following: [code] private function grabListener(e:MouseEvent):void { switch(e.type) { case MouseEvent.MOUSE_DOWN : startDrag(); stage.addEventListener(MouseEvent.MOUSE_UP, grabListener, false, 0, true); addEventListener(MouseEvent.MOUSE_MOVE, grabListener, false, 0, true); break; case MouseEvent.MOUSE_UP : stopDrag(); stage.removeEventListener(MouseEvent.MOUSE_UP, grabListener); break; case MouseEvent.MOUSE_MOVE : _nShowPosition = y; break; case MouseEvent.CLICK : popup(); break; } } [/code] but the problem is that every time MOUSE_UP fires, it also completes the CLICK event, even after the user has dragged the object i've tried setting the useCapture to true for the following line stage.addEventListener(MouseEvent.MOUSE_UP, grabListener, true, 0, true); and in the mouse_up case i've tried doing the following e.stopPropagation() and e.stopImmediatePropagation() to try and head the event off before it gets to the click but i guess because click is a separate event, it didn't affect it am i missing a trick here? hope you can help best alz thefieldcomic.com ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] separating MouseEvent.MOUSE_UP from MouseEvent.CLICK
You might be able to set a timer for your CLICK. Eg: If this is clicked so fast, do CLICK else do MOUSE_UP Karl Sent from losPhone On Jul 12, 2009, at 4:08 AM, Allandt Bik-Elliott (Receptacle) alla...@receptacledesign.com wrote: hi guys quick question - is it possible to separate a MOUSE_UP event from a CLICK event? i have a mouse listener function that does the following: [code] private function grabListener(e:MouseEvent):void { switch(e.type) { case MouseEvent.MOUSE_DOWN : startDrag(); stage.addEventListener(MouseEvent.MOUSE_UP, grabListener, false, 0, true); addEventListener(MouseEvent.MOUSE_MOVE, grabListener, false, 0, true); break; case MouseEvent.MOUSE_UP : stopDrag(); stage.removeEventListener(MouseEvent.MOUSE_UP, grabListener); break; case MouseEvent.MOUSE_MOVE : _nShowPosition = y; break; case MouseEvent.CLICK : popup(); break; } } [/code] but the problem is that every time MOUSE_UP fires, it also completes the CLICK event, even after the user has dragged the object i've tried setting the useCapture to true for the following line stage.addEventListener(MouseEvent.MOUSE_UP, grabListener, true, 0, true); and in the mouse_up case i've tried doing the following e.stopPropagation() and e.stopImmediatePropagation() to try and head the event off before it gets to the click but i guess because click is a separate event, it didn't affect it am i missing a trick here? hope you can help best alz thefieldcomic.com ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] separating MouseEvent.MOUSE_UP from MouseEvent.CLICK
I think that it makes sense that the functions like formHidden() gets called, because that is what you put down. It think you will need to put only the function name/ref like so: this.quoteRequest_mc.ySlideTo(quoteHideY,4,easeoutbounce,.5, formHidden ,20,4.5); Give it a try. Jiri Karl DeSaulniers wrote: Hello List, I'm having an issue getting my MC_Tween2 scripts to behave appropriately. AS2. I am trying to set a function that triggers after the tween is done. I am sure this is easier than I am figuring, but I'm stuck. I can get the tweens to work, but they trigger the function while tweeneing. [code eg] var beginAlpha = 0; var endAlpha = 100; var quoteShowY:Number = 219.9; var quoteHideY:Number = -219.9; this.quoteRequest_mc._y = quoteHideY; function formVisible() { if (!this.quoteRequest_mc.isTweening()) {//this way doesn't work at all ??? this.quoteRequest_mc.gotoAndPlay(2); } } function formHidden() { //this way plays while hideForm() is Tweening this.quoteRequest_mc.gotoAndStop(1); } function showForm() { this.quoteRequest_mc.alphaTo(endAlpha,3.5,easeoutquint,.5); this.quoteRequest_mc.ySlideTo(quoteShowY,4,easeoutbounce,.5,formVisible(),20,4.5); } function hideForm() { this.quoteRequest_mc.alphaTo(beginAlpha,3.5,easeoutquint,.5); this.quoteRequest_mc.ySlideTo(quoteHideY,4,easeoutbounce,.5,formHidden(),20,4.5); } showForm(); What on earth am I doing wrong?? It all looks like it should work! Also, on the tweens themselves, they dont play very smooth. Am I doing somthing wrong with the timing or the ease period or amount of ease? What? I want them to play somewhat quickly, but smooth. Thank you for any help. Karl DeSaulniers Design Drumm http://designdrumm.com ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] separating MouseEvent.MOUSE_UP from MouseEvent.CLICK
Thanks Jiri, I will try that. Karl Sent from losPhone On Jul 12, 2009, at 2:47 PM, Jiri jiriheitla...@googlemail.com wrote: I think that it makes sense that the functions like formHidden() gets called, because that is what you put down. It think you will need to put only the function name/ref like so: this.quoteRequest_mc.ySlideTo(quoteHideY,4,easeoutbounce,.5, formHidden ,20,4.5); Give it a try. Jiri Karl DeSaulniers wrote: Hello List, I'm having an issue getting my MC_Tween2 scripts to behave appropriately. AS2. I am trying to set a function that triggers after the tween is done. I am sure this is easier than I am figuring, but I'm stuck. I can get the tweens to work, but they trigger the function while tweeneing. [code eg] var beginAlpha = 0; var endAlpha = 100; var quoteShowY:Number = 219.9; var quoteHideY:Number = -219.9; this.quoteRequest_mc._y = quoteHideY; function formVisible() { if (!this.quoteRequest_mc.isTweening()) {//this way doesn't work at all ??? this.quoteRequest_mc.gotoAndPlay(2); } } function formHidden() { //this way plays while hideForm() is Tweening this.quoteRequest_mc.gotoAndStop(1); } function showForm() { this.quoteRequest_mc.alphaTo(endAlpha,3.5,easeoutquint,.5); this.quoteRequest_mc.ySlideTo(quoteShowY,4,easeoutbounce,. 5,formVisible(),20,4.5); } function hideForm() { this.quoteRequest_mc.alphaTo(beginAlpha,3.5,easeoutquint,.5); this.quoteRequest_mc.ySlideTo(quoteHideY,4,easeoutbounce,. 5,formHidden(),20,4.5); } showForm(); What on earth am I doing wrong?? It all looks like it should work! Also, on the tweens themselves, they dont play very smooth. Am I doing somthing wrong with the timing or the ease period or amount of ease? What? I want them to play somewhat quickly, but smooth. Thank you for any help. Karl DeSaulniers Design Drumm http://designdrumm.com ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] separating MouseEvent.MOUSE_UP from MouseEvent.CLICK
Thanks Jiri, That worked perfectly. I knew I had been looking at this code too long and that it was something as simple as deleting a couple of parenthesis. Thanks again.. Karl On Jul 12, 2009, at 2:47 PM, Jiri wrote: I think that it makes sense that the functions like formHidden() gets called, because that is what you put down. It think you will need to put only the function name/ref like so: this.quoteRequest_mc.ySlideTo(quoteHideY,4,easeoutbounce,.5, formHidden ,20,4.5); Give it a try. Jiri Karl DeSaulniers wrote: Hello List, I'm having an issue getting my MC_Tween2 scripts to behave appropriately. AS2. I am trying to set a function that triggers after the tween is done. I am sure this is easier than I am figuring, but I'm stuck. I can get the tweens to work, but they trigger the function while tweeneing. [code eg] var beginAlpha = 0; var endAlpha = 100; var quoteShowY:Number = 219.9; var quoteHideY:Number = -219.9; this.quoteRequest_mc._y = quoteHideY; function formVisible() { if (!this.quoteRequest_mc.isTweening()) {//this way doesn't work at all ??? this.quoteRequest_mc.gotoAndPlay(2); } } function formHidden() { //this way plays while hideForm() is Tweening this.quoteRequest_mc.gotoAndStop(1); } function showForm() { this.quoteRequest_mc.alphaTo(endAlpha,3.5,easeoutquint,.5); this.quoteRequest_mc.ySlideTo(quoteShowY,4,easeoutbounce,. 5,formVisible(),20,4.5); } function hideForm() { this.quoteRequest_mc.alphaTo(beginAlpha,3.5,easeoutquint,.5); this.quoteRequest_mc.ySlideTo(quoteHideY,4,easeoutbounce,. 5,formHidden(),20,4.5); } showForm(); What on earth am I doing wrong?? It all looks like it should work! Also, on the tweens themselves, they dont play very smooth. Am I doing somthing wrong with the timing or the ease period or amount of ease? What? I want them to play somewhat quickly, but smooth. Thank you for any help. Karl DeSaulniers Design Drumm http://designdrumm.com ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Karl DeSaulniers Design Drumm http://designdrumm.com ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders