Mouse trailer Battle

Hi,

Would anyone be interested is a little Actionscript battle? I was thinking about mouse trailers because they are easy to make and you can get some really nice effects.

Tweens would be allowed, but no imported graphics or things like that…

If some of you are interested but need a script to get started, I (or anyone else) can provide a quick tute on mouse trailers.

I hope some of the mods will be interested too, I know we have a few masters… (Dan, Thor :bad: )

Cheers.
pom :love:

I might, I am just begining to venture in the world of AS, but I wouldnt mind trying! As script tut might be nice!

I might be up for that

count me in

great idea ilyas, im in

I’m an actionscript noob, but I’ll give it a shot. (my first contest:))

Let’s roll then =)

so am i allowed in this? :blush:

when is the deadline?

Thor >> :bad:
sushis >> Check this thread :slight_smile: http://www.kirupaforum.com/forums/showthread.php?s=&postid=223855#post223855

If some of you are interested but need a script to get started, I (or anyone else) can provide a quick tute on mouse trailers.

Can anyone do this please?

I’ve never taken part in a battle before, but here goes!

PS. That means “yes”

*Originally posted by RussianBeer *
**Can anyone do this please? **
Hum, err… Let me work on that.

Can we import grafix and trace bitmap?

Nope, nothing external :slight_smile:

RussianBeer >> The basis: Let’s say you have a clip in your library with the linkage name “theClip”. First step:

this.onEnterFrame = function(){
i++;
var mc = this.attachMovie("theClip","theClip"+i,i);
mc._x = _xmouse;
mc._y = _ymouse;
}

You attach a clip at the position of the mouse onEnterFrame.

Next step: we add an enterFrame to the created clips

function fadeOut(){
this._alpha -= 5;
if (this._alpha < 10){
this.removeMovieClip();
}
}
this.onEnterFrame = function(){
i++;
var mc = this.attachMovie("theClip","theClip"+i,i);
mc._x = _xmouse;
mc._y = _ymouse;
mc.onEnterFrame = fadeOut;
}

You can do pretty much anything you want in that function.
The next step would be attaching the clip at another position that the mouse position, making the clips react to each other…

mmhhh. Doesnt that make the CPU blow up?, looks like the loop could be repeated billions of of times…

because the clip’s enterFrame is fadeout, it will end up removing itself after a couple of frames and you wont have to worry about it clogging up the system - clips get removed at the same rate they are added so you get an equilibrium :slight_smile:

The first code I posted WILL blow your computer out, though :beam:

who needs to keep duplicating movieclips when you can have a set amount with the ilusion of fading… try this:
[AS]numMCs = 100; //the number of movie clips that will trail
speed = 1.1; //the speed at which the movie clips will follow the mouse
for (i=1; i<=numMCs; ++i) { //starts a for loop
MC = “MC”+i; //MC is a variable that stores the names of all the new movie clips
//MC is updated every loop
_root.attachMovie(“MCID”, MC, i); //attaches a movie clip from the library with the linkage name “MCID”
_root[MC]._alpha = (100/numMCs)*(numMCs-i+1); //adjusts each MC’s alpha. if you’re going to use 100 MC’s the
//just use 'MC._alpha = 100-(i+1). the original code spreads out
//alpha throughout the MC no matter how many you have
} //ends the for loop
onEnterFrame = function () { //starts an onEnterFrame function
for (i=1; i<=numMCs; ++i) { //starts a for loop
MC = “MC”+i; //stores the names of all the new movie clips
if (i == 1) { //checks if i is equal to 1
_root[MC]._x = _xmouse; //if i = 1 then the loop is on the first loop and on the first MC
_root[MC]._y = _ymouse; //this means the first MC has to follow the mouse
} else { //if the above if statement is not satisfied, then do the following actions
MCb = “MC”+(i-1); //MCb stores the name of the MC that’s ahead of it
_root[MC]._x -= (_root[MC]._x-_root[MCb]._x)/speed; //the current MC eases towards the MC that’s
_root[MC]._y -= (_root[MC]._y-_root[MCb]._y)/speed; //ahead of it
} //closes the if statement
} //declares the end of the for loop
}; //declares the end of the onEnterFrame function[/AS]