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

Popular posts from this blog

windows - Why does Vista not allow creation of shortcuts to "Programs" on a NonAdmin account? Not supposed to install apps from NonAdmin account? -

c++ - How do I get a multi line tooltip in MFC -

unit testing - How to mock PreferenceManager in Android? -