# Littile nothing with pointer

**URL:** <https://forum.kirupa.com/t/littile-nothing-with-pointer/188201>\
**Category:** Uncategorized\
**Created:** [May 5, 2006, 8:10am UTC](https://forum.kirupa.com/t/littile-nothing-with-pointer/188201 "2006-05-05T08:10:29Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![gvozden](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/gvozden/32/1084_2.png) [@gvozden](https://forum.kirupa.com/u/gvozden)\
**Post date:** [May 5, 2006, 8:10am UTC](https://forum.kirupa.com/t/littile-nothing-with-pointer/188201/1 "2006-05-05T08:10:29Z")

</div>

this is nothing special but maybe for someone can be usefull  
someone can add infinite trail 😉  
composition of basic stuff with pointer and mc’s

[AS]function createRectangle(x:Number, y:Number, width:Number, height:Number, color:Number, alpha:Number):MovieClip {  
var depth:Number = this.getNextHighestDepth();  
var mc:MovieClip = this.createEmptyMovieClip(“mc\_” + depth, depth);  
mc.beginFill(color);  
mc.moveTo(x-width/2,y-height/2);  
mc.lineTo(x+width/2, y-height/2);  
mc.lineTo(x+width/2, y+height/2);  
mc.lineTo(x-width/2, y+height/2);  
mc.\_alpha = alpha;

```
return mc;

```

} // draw rectangle function

\_tempx = \_xmouse;  
\_tempy = \_ymouse;  
\_tempH = 1;  
\_tempW = 1;  
angle = 0;  
// initialaze needed values

Mouse.hide();  
// hiding mouse pointer

onEnterFrame = function() {  
removeMovieClip(\_mc);  
removeMovieClip(\_mc1);  
removeMovieClip(\_mc2);  
// removing MovieClips of pointer and trails

```
_tw = (Math.abs((_xmouse - _tempx)+(_ymouse-_tempy))/4+2)*5;
_w = (_tw +_tempW)/1.5;
// pointer becomes bigger if mouse move distance is bigger

_mc2 = createRectangle(_tempx2,_tempy2, _tempH2, _tempH2, 0xFF0000, 20);
// second trail
_mc1 = createRectangle(_tempx,_tempy, _tempH, _tempH, 0xFF0000, 50);
// first trail
_mc = createRectangle(_xmouse,_ymouse, _w+Math.cos(angle*Math.PI/180)*2, _w+Math.cos(angle*Math.PI/180)*2, 0xFF0000, 100);
// pointer with pulsation with cosinus help

_tempx2 = _tempx;
_tempy2 = _tempy;
_tempH2 = _tempH;
// remembering trail 1 position, in new frame it will be second trail

_tempx = _xmouse;
_tempH = _mc._height;
_tempy = _ymouse;
// remembering real pointer position, it will be first trail in new frame

angle += 10;
if (angle &gt; 360) {
	angle = 0;
}
// rotating angle so pointer can pulsate

```

}[/AS]
