This is a very simple but effective ActionScript 2 effect. All that we need for this is:
-Flash
-A Name or Text
Not much huh? Well lets get to it!
First start off by making a new file. You can use the default size (550x400) but for a better effect change the background to black.
Now draw a circle without a boarder. Change the height and width (properties panel) to something like 5px by 5px (that's what I used).
Convert that circle to a movie clip (F8). It doesn't matter what you call it, don't instance it.
Now select that movie clip with the circle and open up the Actions panel (F9). Once in the actions panel paste this code:
onClipEvent (load) {
x00 = _x;
y00 = _y;
MAAI = 400;}
onClipEvent (enterFrame) {
x0=_x
y0=_y
x=_root._xmouse
y=_root._ymouse
a=x-x0
b=y-y0
r=Math.sqrt(a*a+b*b)
quer_fugir_x=this._x-(a/r)*MAAI/r
quer_fugir_y=this._y-(b/r)*MAAI/r
quer_voltar_x=(x00-x0)/2
quer_voltar_y=(y00-y0)/2
this._x=quer_fugir_x+quer_voltar_x
this._y=quer_fugir_y+quer_voltar_y
}
[Don't paste this or below]
=================================
Now that we have our movie clip with our action script, its time to create our art! (Name or text or drawing or whatever you might think of)
Select your circle and duplicate it (CTRL+D). This may take some time...
Make your name, a drawing or whatever by duplicating your circles, that way that your actionscript will be on all of them. When you test your movie (CTRL+ENTER) it should look like mine.
If you don't really get it so well you can download my source code here:
-Pato
No comments:
Post a Comment