This content has been marked as final. Show 3 replies
Hm, instead of doing coding this, you could use the startDrag() method. You can specify left, top, bottom, right parameters for drag boundaries. Use stopDrag() to…well, stop dragging.
i tried startDrag() but wasn't able to successfully code the inertia for when the MC is released. i'm a designer learning actionscript, therefore a lot of what i've discovered has been by trial and error.
could you recommend any tutorials for adding the inertia to the startDrag() method?
i feel like it should be a little more simple than what i keep coming up with... thanks.
hm... well I think what you really need to get out of the dragging step is the vector of the object when the object is ‘released’?
I suppose you could use the actual startDrag()/stopDrag methods to do the dragging work for you and then add on to it. Perhaps while the mouse is moving, keep track of (and update) the values/vector of where the mouse was 1 ‘movement unit’ before (1 frame before I presume), then when stopDrag() is called, at the same spot, subtract the current vector from the vector stored and use the result for calculating inertia.
(Note that I don’t have flash in front of me so this actually coming from my head, -someone may have a better method)