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

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

asp.net - In javascript how to find the height and width -

c# - DataTable to EnumerableRowCollection -