Search  

DRAG AND ROTATION PHYSICS

HomeBrowse CategoriesFlashApplications and UtilitiesUtilitiesDrag and rotation physics

Drag & Rotation is a demonstration of the algorithms involved in making movieclips behave naturally when dragging and rotating them.

Simply copy the DragRotationCard from the library to your own project, edit the graphic and put as many of them as you need on stage. Or; attach the MovieClip at runtime and load an image into it – whatever you need really. :)

The example cards are not meant to solve any particular problem – they are for demonstration purposes. I encourage you to study the code and adapt it to your specific problem. Collision detection and all the algebra is clearly separated and very portable.

Posted 3 months ago

I have been playing with this for about 5 minutes, it is cool.

Posted 3 months ago

realistic! nice :)

Posted 3 months ago

nice physics on this. great work.

Posted 3 months ago

very nice, ulfben :)

Posted 3 months ago

excellent work

I would like to buy this

Posted 3 months ago

something weird happend, i dragged one really fast and some disappeared

Posted 3 months ago

michelsteege – ah, damn.

First, here’s the solution: If your custom shapes behave strangely when rotating, replace all the matrix operations in rotate() (lines 85-91) with this line:

_rotation += Math.atan2(projected, anchLength)*57.2957795;

Second, here’s the problem: There is some wierd edge cases with the matrix operations on some shapes. I couldn’t figure it out, but the workaround is simple – as stated above.

That line is in the the code, but commented out. I forgot to put it back in for my pentagons in this preview. Sorry. :)

Thus: if your custom shapes are dissapearing under some rotations, just replace the matrix code with the above line. I’ll update the file in a couple of days.

Posted 3 months ago

nice!

Posted 3 months ago

cool… like it..

Posted 3 months ago

Hi,

I have a question,

are you using dynamic text fields which can have any font-family and text dynamically from code. Or you include static text field on the cards.

I need to buy this but be able to insert the text and styling from an external XML file.

If that is possible please let me know so that I can buy this product.

Please respond.

Thank you Satya

Posted 3 months ago

You can use any type of textfield, but if you need to rotate the text itself you must of course embedd the font.

Posted 3 months ago

wow… it’s great,

so realistic… fun.;)

Posted 3 months ago

DESERVES DEFINITLY MORE THAN $3!!! Preloaders are at the same price!

Posted 3 months ago

The file, documentation and preview has been updated, so the pentagons and you own custom shapes should behave properly.

wildwise – thank you. :) I’ll have to contact support and have them re-evaluate the pricing. My ToolTip is the same price as this, but the effort involved is definetly not comparable.

Posted 3 months ago

cool :D

Posted 3 months ago

ulfben Nice work. The pricing seems a bit low to me too. Maybe you need to create more robust examples to illustrate its usefulness.

Posted 3 months ago

Hi!

I have a question,

Does it worik if I replace de shape with a jpg or png? is it possible? thanks!

Posted 2 months ago

cokimono – it’s just a movieclip. You can draw whatever you want in it.

Posted 2 months ago

Thanks! I bought it :)

Now I’m trying to put a button into one of the dragable-movieclip in order to jump to another scene, but it didn’t work… and I could’t find why, yet! Any suggestion? thanks again!

Posted 2 months ago

Hey, great file thanks – just playing with it now, using it as a button to load in another movie to a section of the file but seems to lose the ‘onRelease’ part of it. I.e will load the relavnt swf into the movieclip but will keep dragging. even when release the mouse button. What am i doing wrong?!

Posted 2 months ago

Don’t worry – delete my comment… had 2 onReleases’ on the go. doh!

Posted 2 months ago

Nice work,

Is it possible to put different words onto each shape, then pile up your choice of words, once piled up the words could be collected into a database at the back end?

I would pay for this

Geewizz

Posted about 1 month ago

geewizz – I’ve got your email and will get back to you shortly. Thanks!

Posted about 1 month ago

beautiful piece of work

Posted 17 days ago