SwishTalk.com
 
#1   Mouse trail (Crazy)  
 
cycle1500's Avatar

Name: 
cycle1500
Status: Offline
Rank: Bradly, IL, USA
Posts: 939
Mood: MEAN
Old 01-30-2010, 07:15 AM Reply With Quote


It's been to long since someone has worked on or brought up a new style of mouse follower. So what the s**t here is one.
Copy the code and paste it in your movie.
When you test you will see it sit at the upper left corner, just click to start the follower. This was done for those who don't like something running all over, but guess what click a link and it will come after you
Click again and it holds position, neat.

Code:
 onFrame (1) {
fm = 0;//if you comment this fm = 0 out the star starts right off.
var speed = 60;
var accel = 70;
px = py=0;
c = 1000;
onMouseDown = function () {
    fm == 1 || fm == undefined ? fm=0 : fm=1;
};
interv = setInterval(function () {
    c++;
    _root.createEmptyMovieClip("cir"+c, c);
    _root["cir"+c].lineStyle(0, 0xFFFFFF, 80);
    _root["cir"+c].beginFill(0xFF0000, 10);
    _root["cir"+c].moveTo(-2, 1);
    _root["cir"+c].curveTo(-5, -1, -1, -1);
    _root["cir"+c].curveTo(0, -5, 1, 0);
    _root["cir"+c].curveTo(5, -1, 2, 1);
    _root["cir"+c].curveTo(3, 6, 0, 3);
    _root["cir"+c].curveTo(-3, 6, -2, 1);
    _root["cir"+c].endFill();
    fm == 1 || fm == undefined ? pmx=((_xmouse-px)/10) : pmx=0;
    fm == 1 || fm == undefined ? pmy=((_ymouse-py)/10) : pmy=0;
    px += pmx;
    py += pmy;
    _root["cir"+c]._x = px;
    _root["cir"+c]._y = py;
    _root["cir"+c].spd = speed/100;
    _root["cir"+c].ex = 1;
    _root["cir"+c].onEnterFrame = function() {
        if (this.spd<7 && this.ex == 1) {
            this.spd *= 1+(_root.accel/1800);
            this._width += this.spd;
        } else if (this.spd>7) {
            this.ex = 0;
            this.spd = 6.9;
        } else if (this.spd<7 && this.ex == 0) {
            this.spd *= 1-(_root.accel/2500);
            this._width -= this.spd;
            this._alpha -= 1;
        }
        this._height = this._width;
        if (this._alpha<1 && this.ex == 0) {
            this.removeMovieClip();
        } else {
            this._x += (((Stage.width/2)-_xmouse)/ 750)*this.spd;
            this._y += (((Stage.height/2)-_ymouse)/ 750)*this.spd;
        }
    };
}, 120);
}


Wayne
               
__________________
The Hairy One
As Homer would say beer beer beer beer aaaaaahhhhhh beer.
Cycle's Roost
Action in Action
 
View Public Profile Send a private message to cycle1500 Visit cycle1500's homepage! Find all posts by cycle1500 Add cycle1500 to Your Contacts
#2    

Name: 
nish
Status: Offline
Rank: Registered User
Posts: 4
Old 02-01-2010, 11:09 AM Reply With Quote


Brilliant! Great effect.
Thanks for sharing
               
 
View Public Profile Send a private message to nish Find all posts by nish Add nish to Your Contacts
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump