PDA

View Full Version : Mouse trailer Battle



pom
June 15th, 2003, 06:00 AM
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:

RussianBeer
June 15th, 2003, 07:50 PM
I might, I am just begining to venture in the world of AS, but I wouldnt mind trying! As script tut might be nice!

nobody
June 15th, 2003, 08:06 PM
I might be up for that

Clown Staples
June 15th, 2003, 09:27 PM
count me in

zylum
June 16th, 2003, 04:23 PM
great idea ilyas, im in

turkey
June 16th, 2003, 07:25 PM
I'm an actionscript noob, but I'll give it a shot. (my first contest:))

pom
June 17th, 2003, 12:19 PM
Let's roll then =)

thoriphes
June 17th, 2003, 04:45 PM
so am i allowed in this? :blush:

turkey
June 18th, 2003, 02:26 AM
when is the deadline?

pom
June 18th, 2003, 06:41 AM
Thor >> :bad:
sushis >> Check this thread :) http://www.kirupaforum.com/forums/showthread.php?s=&postid=223855#post223855

RussianBeer
June 18th, 2003, 07:03 AM
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?

radicaljugnu
June 18th, 2003, 07:46 AM
I've never taken part in a battle before, but here goes!

PS. That means "yes"

pom
June 18th, 2003, 08:49 AM
Originally posted by RussianBeer
Can anyone do this please? Hum, err... Let me work on that.

radicaljugnu
June 20th, 2003, 07:24 AM
Can we import grafix and trace bitmap?

pom
June 20th, 2003, 07:49 AM
Nope, nothing external :)

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.

pom
June 20th, 2003, 07:53 AM
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...

mlk
June 20th, 2003, 08:53 AM
mmhhh. Doesnt that make the CPU blow up?, looks like the loop could be repeated billions of of times....

senocular
June 20th, 2003, 09:00 AM
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 :)

pom
June 20th, 2003, 12:37 PM
The first code I posted WILL blow your computer out, though :beam:

zylum
June 20th, 2003, 01:40 PM
who needs to keep duplicating movieclips when you can have a set amount with the ilusion of fading.... try this:
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

fluid_0ne
June 20th, 2003, 03:47 PM
im in, can i?

pom
June 20th, 2003, 07:08 PM
fluid >> Yes :bad:

zylum >> I was trying to keep it simple :) And anyway, it depends on what effect you're trying to achieve... But that code is interesting =)

Scootman
June 23rd, 2003, 02:15 AM
hey can i get in on this too? or is it too late... i think this might be kinda fun...

and when is the deadline?

pom
June 23rd, 2003, 05:21 AM
Everybody can submit something, it's written in the rules...
And the deadline is tomorrow night :)