studiobindia

Travel . Art . Design

Mouse follower August 22, 2007

Filed under: Design, Flash, studiob — studiobindia @ 7:33 pm
Tags: , , , ,

1. Open new document (any size, I’ll set 500*500)

2. Draw circle just with stroke, without fill color

3. Convert circle to movie clip and add him a istance name: circle

4. Add new layer

5. On new layer, on first frame, write this code in actionscript window:

code

_root.onEnterFrame = function(){
positionX = _root._xmouse – 55;
positionY = _root._ymouse – 50;
circle._x = circle._x + (positionX – circle._x)/15
circle._y = circle._y + (positionY – circle._y)/15
}

 

Leave a Reply