Flash - time from press -
i working on little project, what's goal working widget system in flash - creating separate class, , loading flash movies this, dragging them around screen.
i ran little problem when writing dragging code: can not found code can time function call. more precise, want container draggable after 2 seconds of continuous press, , that's trying detect.
is there easy solution?
timer presstimer = new timer(2000); presstimer.addeventlistener(timerevent.timer, ontimer); container.addeventlistener(mouseevent.mouse_down, onmousedown); container.addeventlistener(mouseevent.mouse_up,onmouseup); function onmousedown(e:mouseevent):void { presstimer.start(); } function onmouseup(e:mouseevent):void { presstimer.reset(); } function ontimer(e:timerevent):void { presstimer.reset(); //do dragging , stuff. }
Comments
Post a Comment