View Poll Results: Was this post clear and to the point?
- Voters
- 1. You may not vote on this poll
-
Wait what? say that again....complete jibberish
-
i don't think u knwo what yoru talking about
-
you could clarify your post better
-
VERY CLEAR POST!
-
is there a way to reset the last clicked currentTarget?
something like "(DisplayObject(e.currentTarget).name).resetAfterE vent();
i tried updateAfterEvent(); but that didnt solve the problem...
basically i have multiple event listeners, one for MOUSE_DOWN, MOUSE_UP, and DOUBLE_CLICKED.
then i have a timer event, where everytime the MOUSE_DOWN lasts for about 3 seconds, the binary socket sends out another number.
for all my event listeners, it has been sending out the right number, but when i use the timer event, it always sends out the last clicked button.
TO SUMMARIZE:
for example, ill hold down "on1" and it will say "on1 was held"
then ill hold down on2, and it will still say "on1 was held"
-
rabid_Delineator
Code:
import flash.utils.Timerl
import flash.events.TimerEvent;
var downTimer : Timer;
var selectedItem : MovieClip;
var ONarray:Array=new Array(on1,on2,on3,on4,on5);
stop();
for (var i:uint = 0; i < ONarray.length; i++) {
var ON:MovieClip= ONarray[i];
ON.buttonMode = true;
ON.addEventListener(MouseEvent.MOUSE_DOWN, Press1);
ON.addEventListener(MouseEvent.MOUSE_UP, onMouseUp );
};
function Press1(e:MouseEvent):void{
downTimer = new Timer( 3000 , 0 );
downTimer.addEventListener( TimerEvent.TIMER , handleTimer );
downTimer.start();
selectedItem = e.currentTarget;
//do other things
};
function handleTimer( evt : TimerEvent ) : void {
//do something
trace( selectedItem );
};
function onMouseUp( evt : Event ) : void {
downTimer.stop();
downTimer.removeEventListener( TimerEvent.TIMER , handleTimer );
downTimer = null;
//do more things
};
Last edited by AttackRabbit; 11-10-2009 at 10:21 AM.
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|