Eek’s World

Tag: 3D cubes

Flash Programming / Running away MovieClips

by on Mar.07, 2009, under Programming

:)
Some of you asked me how i’v realized that effect in Flash. Well.. It’s maybe one of the simplest to do if you know a little actionscript 2…

The animation you’ve seen with Eek (The Eek Logo) it’s made quite simple. You open a new project in Flash and there you draw a form (in my case, those 3D cubes…), after that you select your form, press F8 and convert it to Movie clip… Here you go to the timeline and insert another 2 keyframes.

In the first keyframe you add this code:
x00 = _x;
y00 = _y;
DIAM = 1000;

The important thing you need to know here is that DIAM is the diametre in which the “shapes” can run away from you :)

In the second keyframe there’s a little more actionscripting:

x0 = _x;
y0 = _y;
x = _root._xmouse;
y = _root._ymouse;
a = x - x0;
b = y - y0;
r = Math.sqrt(a * a + b * b);
a_x = this._x - a / r * DIAM/ r;
a_y = this._y - b / r * DIAM/ r;
b_voltar_x = (x00 - x0) / 2;
b_voltar_y = (y00 - y0) / 2;
this._x = a_x + b_x;
this._y = a_y + b_y;

And that’s almost everything… In the last (third) keyframe you add the code gotoAndPlay(2); so that the script will aways run. :)

Then you go back into the Main Scene and draw everything you want by inserting the shapes into the stage and copy-paste them and making the form you desire out of them :)

That’s all regarding to that flash…

I think i’ll gonna do something related to that on the first page (http://eek.ro)… But a lot more visual atractive, i experimented a little more with my logo by replacing those 3D cubes with tiny circles… Then added around 300 in my scene to draw a better looking Eek :) But after i exported i realised there were too many and the animation was working like SH*T :( Eh… I think i’ll gonna remain at some photoshop :)

Hope you like the new design of my blog… Added to it what i done yestarday in photoshop, and besides that i added a favicon… Not a very good looking one that’s a little nice :D

Heh! :)

I’ll gonna start working on Eek.ro and rowl.eek.ro

Comments Off :, , , , , , , , , more...

Looking for something?

Use the form below to search the site:

Still not finding what you're looking for? Drop a comment on a post or contact us so we can take care of it!

Archives

All entries, chronologically...