PDA

View Full Version : Xtmas Light effects w/ mouseover


lenissek
12-17-2006, 04:27 AM
:) Someone can help me to figure how to do this effect?


http://www.ohmyflash.com/effect/194.html


Please, help me...

LK:o

Noct
12-18-2006, 09:03 PM
It looks like one of two things to me, and it's probably the latter.
Either:

A.) The circles are animated in thier own timeline shrinking and expanding with the middle point at the numerically middle frame in the timeline. Then at runtime the mouse x/y are grabbed. If your x/y is higher then the saved value, it moves that value in frames to the right, or vice-versa.

B.) The shapes are created dynamically and move based solely on the mouse coordinates. As in, they all start at certain points of origin. The mouse position is taken and again the difference between where the mouse was, and where it is now, determines the movement of the shapes.
If xMouse is moving posotively, the shapes scale is made larger.
If xMouse is moving in a negative swing, the shapes shrink down.

syntax
12-24-2006, 07:52 AM
i think checking the distance between the the circles and the mouse seems right... i did something similar but the code i did was "messy". a tutorial that might help you could be found here: http://www.kirupa.com/developer/actionscript/calculating_distance.htm