Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    Flash




Mouse Trail On RollOver ?



Hi,

Does anyone know how to get a movie clip to trail the cursor after rolling over it?

is it possible to do multiple trails, so that after you 'pick up' one movie clip... u can 'pick up' more.. which are added to the trail?

Many thanks in advance

Marc



FlashKit > Flash Help > Flash ActionScript
Posted on: 05-06-2005, 01:35 PM


View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread

Mouse Trail On RollOver?
Hey,

Could anyone help me with this?


Does anyone know how to get a movie clip to trail the cursor after rolling over it?

is it possible to do multiple trails, so that after you 'pick up' one movie clip... u can 'pick up' more.. which are added to the trail?

Many thanks in advance

Marc

Make Mouse Trail Into Object Trail
Hi,

Maybe someone can help - this is really urgent!!

I have a movie with a star graphic travelling across the screen. I want the star to leave behind a trail of other twinkling stars.

I've tried to amend a mouse-trail script to do this, but can't make it work.

Any ideas?

Thanks very much, your help would be really greatly appreciated!

http://www.djbramall.com/star_trails.fla

Mouse Trail To Movie Trail
I have a mouse trail that uses the following code,

var leaderX = function() { return _xmouse; };

I was wondering if it is possible modify this code section to trail a movieclip instead of the mouse to generate the trail.

thanks

Mouse Trail (line Trail)
I remember a long long time ago in a galaxy far away there was a mouse trail here that would create a line that would fade out after a while.

i tried googling line and mouse trails but I found nothing

if anyone could help i will be their eternal sex monkey for ETERNITY

thank you

Custom Mouse Cursor Conflict With Mouse Trail
When I put mouse trails and custom mouse cursor script in the same scene the mouse trails work but the cursor does not change to the custom cursor. If I use the custom mouse cursor script in a seperate scene, on its own, it works fine. I think that the two scripts are conflicting.
Mouse trail script:

onClipEvent (enterFrame) {
//x movement
mx=_root._xmouse;
if (mx<_x) {
dx=_x-mx;
}
else {
dx=mx-_x;
}
moveSpeedx=dx/10;
if (mx<_x) {
_x=_x-moveSpeedx;
}
else {
_x=_x+moveSpeedx;
}
//y movement
my=_root._ymouse;
if (my<_y) {
dy=_y-my;
}
else {
dy=my-_y;
}
moveSpeedy=dy/10;
if (my<_y) {
_y=_y-moveSpeedy;
}
else {
_y=_y+moveSpeedy;
}
}

Custom mouse cursor script:
Layer 1(functions):

stop();
/* update the cursor coords */
function updateCursor() {
_root.cursor._x = _xmouse;
_root.cursor._y = _ymouse;
updateAfterEvent();
}

Layer 2(on event handlers):

onClipEvent(load) {
Mouse.hide();
this.swapDepths(100);
}
onClipEvent(mouseMove) {
_root.updateCursor();
}

Please help!

Help With Mouse Trail, Can't Get It To Go Vertical When I Stop Mouse
this is the code. the problem is when the mouse stops, the text trail align themselves from left to right. But what i want is for them to go from top to bottom line a line straight down.

Text = ">>>>>>";
letters = Text.split("");
letterformat = new TextFormat();
letterformat.font = "Verdana";
letterformat.align = "center";
letterformat.size = "10";
letterformat.color = 0xFFFFFF;
spacing = 8;
speed = 4;
for (var LTR = 0; LTR<letters.length; LTR++) {
mc = _root.createEmptyMovieClip(LTR+"l", LTR);
mc.createTextField(letters[LTR]+"t", LTR, LTR*spacing, 10, 20, 20);
with (mc[letters[LTR]+"t"]) {
text = letters[LTR];
setTextFormat(letterformat);
selectable = false;
}
if (LTR) {
mc.prevClip = _root[(LTR-1)+"l"];
mc.onEnterFrame = function() {
this._x += (this.prevClip._x-this._x+5)/speed;
this._y += (this.prevClip._y-this._y)/speed;
};
} else {
mc.onEnterFrame = function() {
this._x += (_root._xmouse-this._x-10)/speed;
this._y += (_root._ymouse-this._y-25)/speed;
};
}
}

any suggestions?

How To Cause A Mouse Trail To Change Scale On Mouse Down Only
I'm still very new to AS, but I have a project I need to complete for work. I have some code for a mouse trail that is working well, but now I need the trail effect to scale up by about 200 pixels (or 6 to 7 times) when the mouse is clicked and held/dragged and go back to original size when the mouse is released. I can't seem to get this to work. Any help with how this should be done? Code is below.
Thank you!

var cursor:MovieClip;
var particle:MovieClip;

function initializeMovie():void {
cursor = new Cursor();
addChild(cursor);
cursor.enabled = false;
Mouse.hide();
stage.addEventListener(MouseEvent.MOUSE_MOVE, dragCursor);
}

function dragCursor(event:MouseEvent):void {
cursor.x = this.mouseX;
cursor.y = this.mouseY;
}

initializeMovie();


var alphaRate:Number = .02;
var scaleRate:Number = .01;


var particleTimer:Timer = new Timer(20);
particleTimer.addEventListener(TimerEvent.TIMER, createParticle);

function createParticle(event:TimerEvent):void {

particle = new Particle();
particle.x = this.mouseX;
particle.y = this.mouseY;
addChild(particle)
particle.addEventListener(Event.ENTER_FRAME, animateParticle);

}

function animateParticle(event:Event):void
{
if(event.target.alpha > 0)
{
event.target.y += 1;
event.target.alpha -= alphaRate;
event.target.scaleX -= scaleRate;
event.target.scaleY = event.target.scaleX;
}
else
{
removeChild(getChildByName(event.target.name));
event.target.removeEventListener(Event.ENTER_FRAME , animateParticle);
}
}

particleTimer.start();

Mouse Trail
Hey i tryed making mouse trails with the tout... but i couldent figure out the script (End if ?) if someone could help me that would be great

Mouse Trail
Hi
i'm looking for a script for mouse trail
like in the barbie site
http://www.barbie.com

thanks

Mouse Trail
Hi
i'm looking for a script for mouse trail
like in the barbie site
http://www.barbie.com

thanks

Mouse Trail
Help Needed!

Having probs with mouse trail whereby balls will follow the mouse wherever it goes..and balls will animated around the mouse when it is not moving..

Mouse Trail
hey,


does any1 know how this mouse trail is done??

http://www.spezzo.com/main2.html


i know a lot of html and java. Mouse trails in html are sooo easy. You just copy and paste the code and modify it anyway you want it. Does is work the same with flash, probably not. It's probably a lot more complicated then that.

thx,
Baljinder

Mouse Trail
I'm trying to get a group of lines/blocks to follow the mouse and lock into a certain place a specific point so it looks something like this:

http://www.chameleoncreative.co.uk

If you've got the know-how or perhaps have seen similar tutorial anywhere please let me know!
Thanking y'all !

Mouse Trail Help
Hey, I was working on a code for a mouse trailer but it just doesn't seem to be working. I want a trailer that is confined to a space and would "lock" onto a button when the user hovers the button. For an example: http://team-die.net/
As you can seem in the navigation, when a user hovers over the button, there is a moving graphic at the top that is confined to a space and "locks" onto the button the user is currently hovering. I would also like it to have a slight delay. I so far go the mouse to lag but can't find out how to keep it confined and locking onto objects. Any help would be appreciated, thanks.

Mouse Trail
hey,

how can i create this mouse over effect in Flash?

http://www.mandarinbuffet.com/home.html

if you mouse over the buttons, a little info bar pops-up and follows the mouse (as long as the mouse if over the button).

Thanks.

MC Trail Mouse
Hey, I've got quite a problem.

I have an MC with an instance name of "buddy". Now within the MC are a bunch of frames, and 3 labels :

stand
walkL
walkR

Back on the main timeline, this is the code on frame 1 (the only frame) {

code: function onEnterFrame() {
if(_xmouse > buddy._x) {
buddy.gotoAndPlay("walkL");
} else if(_xmouse < buddy._x) {
buddy.gotoAndPlay("walkR");
}
}

Basically, if the mouse is to the left of the buddy, make the buddy go to the frame labeled "walkR", and vice versa. But it acts as if it is only "gotoAndStop" and not "gotoAndPlay".

Now, if I add in traces, it detects them fine, meaning the if statements are working - yet when I leave the code that way, it never goes to either of the 2 frame labels (walkL or walkR)...

If I just leave one if statement, then it works fine, but it will only go to one of the labels, thus only allowing the buddy to walk in one direction. It's as if the 2 if statements are clashing, and stopping one another from working.

Is there a better way to do this? All help would be greatly appreciated

[F5] Mouse Trail
How do I get a movie clip that follows my mouse, but isn't "fast" enough to keep up and sort of lags behind. When the mouse stops moving, the movie clips slows down and stops when it reaches the mouse. Preferably, I would like the movie clip's movement to be restricted to the y-axis when it's following the mouse. Thanks!

Mouse Trail
I am trying to make a mc tag along with the _ymouse. The _x of the mc is already locked at 200. The thing is i only want the mc to move up and down within a certain area. I also want the mc to lock on to these 4 buttons. I don't want the mc to wander off jus move up and down in the buttons area. Can someone please help me. I'm new to actionscript. The actionscript that I used here is:

onClipEvent (enterFrame) {
diffY = _root._ymouse-10-_y;
_y = _y+diffY/10;
}

How can i modify it so it would fit my needs

Mouse Trail
I am trying to make a mouse trail with a spherical white blur and a purple line that trails off in alpha.
I have a picture of it at http://www.erawanet.com/images/mouseTrail.jpg

Any ideas how I can implement this?

Many thanks!!!!

Mouse Trail
I am trying to make a mouse trail with a spherical white blur and a purple line that trails off in alpha.
I have a picture of it at http://www.erawanet.com/images/mouseTrail.jpg

Any ideas how I can implement this?

Many thanks!!!!

Mouse Trail Help
HI, please can u help? i want to use the mouse trail in the special effects section on this site, but i want the word 'kirupa' to change and be the word 'IMPRESSIONS'......but when i change it, the trail does not trail at all. i dont know much about codes so please can a clever person change the whole code for me and email me it so i can just copy and paste it into flash. i would be ever so grateful, please help me its v important and i will owe u one, i am a designer so could help u some time.. thanks lucy x< please please email me someone!!!!!!!!

Mouse Trail
hey everybody. im trying to make a mouse trail thingy for my website and wat im tryin to do is there's gonna be a bomb and whenever someone clicks on a hyperlink there's an explosion, but i cant seem to get the code to work. the original code works but when i added the MovieClip.onMouseDown i stopped working.
here's the code:

onClipEvent (load) {
_x = 0;
_y = 0;
speed = 5;
}
onClipEvent (enterFrame) {
endX = _root._xmouse;
endY = _root._ymouse;
_x += (endX-_x)/speed;
_y += (endY-_y)/speed;
}
onClipEvent (enterFrame) {
MovieClip.onMouseDown = function() {
gotoAndStop(2);
}
}

Mouse Trail
hello..does anyone know how to change the color of the text following the mouse?

Text = "Kirupa has the best site on the net!!!";
letters = Text.split("");
letterformat = new TextFormat();
letterformat.font = "Verdana";
letterformat.align = "center";
letterformat.size = "10";
spacing = 8;
speed = 3;
for (var LTR = 0; LTR<letters.length; LTR++) {
mc = _root.createEmptyMovieClip(LTR+"l", LTR);
mc.createTextField(letters[LTR]+"t", LTR, LTR*spacing, 10, 20, 20);
with (mc[letters[LTR]+"t"]) {
text = letters[LTR];
setTextFormat(letterformat);
selectable = false;
}
if (LTR) {
mc.prevClip = _root[(LTR-1)+"l"];
mc.onEnterFrame = function() {
this._x += (this.prevClip._x-this._x+5)/speed;
this._y += (this.prevClip._y-this._y)/speed;
};
} else {
mc.onEnterFrame = function() {
this._x += (_root._xmouse-this._x+10)/speed;
this._y += (_root._ymouse-this._y)/speed;
};
}
}

Re: Mouse Trail
On the "Mouse Trail" tutorial, for Flash MX here on Kirupa, it doesn't explain how to change the color of your text. Does the text have to stay black or is there a script to change it?

Mouse Trail Help
if you check out the FLASH MX tutorial section, theres a tutorial for Mouse trail, it works in mx2004 as well. my question is, how to change the color of the mouse trail text, im not sure what code to add tochange the color, default is black

Mouse Trail
Can I change the color of mouse trail text to any color i want instead of black?

Mouse Trail
I'm trying to addapt this tutorial here...

What I want to know is; can I change the colour of the trail too?

And is it possible to use somehing other than text as a trail?


/mette

Mouse Trail
First Question:How do you make the font color white or any other color?


Code:
Text = "Kirupa has the best site on the net!!!";
letters = Text.split("");
letterformat = new TextFormat();
letterformat.font = "Verdana";
letterformat.align = "center";
letterformat.size = "10";
spacing = 8;
speed = 3;
for (var LTR = 0; LTR<letters.length; LTR++) {
mc = _root.createEmptyMovieClip(LTR+"l", LTR);
mc.createTextField(letters[LTR]+"t", LTR, LTR*spacing, 10, 20, 20);
with (mc[letters[LTR]+"t"]) {
text = letters[LTR];
setTextFormat(letterformat);
selectable = false;
}
if (LTR) {
mc.prevClip = _root[(LTR-1)+"l"];
mc.onEnterFrame = function() {
this._x += (this.prevClip._x-this._x+5)/speed;
this._y += (this.prevClip._y-this._y)/speed;
};
} else {
mc.onEnterFrame = function() {
this._x += (_root._xmouse-this._x+10)/speed;
this._y += (_root._ymouse-this._y)/speed;
};
}
}


Second question:
Okay, I made a complex button and it links to a certain place. How do I make it that when I click the button, it changes only a certain portion of the page to that place?

For example:

I have the title bar, then I have a black bar (navigation bar) and then I have a blue box undernear the navigation bar. Now I click a button on the navi bar and then the blue box changes to that location not the whole page. The title bar and navigation bar are still the same.

Mouse Trail
hey, i no how to change the colour of the mouse trial but what is the codde (#00FF00 dosent work) for the colour BRITE GREEN

Mouse Trail
Hi there, I tried to put in the code for mouse trail on my website but it doesnt work? is it a flash thing? can someone please show me the html code to add text mouse trail effect like the one on this site? thanks

Mouse Trail... How They Did That?
Hi
Does anybody knows, how to make this mouse trail?!
http://www.rassai.com/ourwork/

Thnx

[OOP] Mouse Trail
hi all...

i recently made motion trail in simple script in stanalonetrail.fla. it works perfectly.

then... i made a class using similar script. what i dont understand is, why it doesnt work in class (OOP)

please have a look at the code in Classes/StarTrail.as and please tell me whats wrong with it.


i really need help in this matter. thx a lot

Mouse Trail
I am trying to get the code to work for the mousetrail animation. I wanted to change the color and the word. Somehow, when i play the movie, the initial instance displays the word at first and then reverts back to 'kirupa' and the color doesnt change. Can anyone help me with that? PLEASE? I really need it quite urgently, and havent been able to figure it out. TIA!


CODE below:

Text = "Kirupa has the best site on the net!!!";
letters = Text.split("");
letterformat = new TextFormat();
letterformat.font = "Verdana";
letterformat.align = "center";
letterformat.size = "10";
spacing = 8;
speed = 3;
for (var LTR = 0; LTR<letters.length; LTR++) {
mc = _root.createEmptyMovieClip(LTR+"l", LTR);
mc.createTextField(letters[LTR]+"t", LTR, LTR*spacing, 10, 20, 20);
with (mc[letters[LTR]+"t"]) {
text = letters[LTR];
setTextFormat(letterformat);
selectable = false;
}
if (LTR) {
mc.prevClip = _root[(LTR-1)+"l"];
mc.onEnterFrame = function() {
this._x += (this.prevClip._x-this._x+5)/speed;
this._y += (this.prevClip._y-this._y)/speed;
};
} else {
mc.onEnterFrame = function() {
this._x += (_root._xmouse-this._x+10)/speed;
this._y += (_root._ymouse-this._y)/speed;
};
}
}

How Do Do A Mouse Trail
I want to be able to make a mosue trail ie when the mouse gets to a point it will advance to next frame. Any Help anyone?? Thanks Lukeintosh

Mouse Trail
Hey - I am trying to do your tutorial for the mouse trail and I want it to say designsbymikele but it isn't working. The is the code below, are you able to help me trouble shoot why this isn't working?

//--Type in all the letters--
Text = " designsbymikele";
letters = Text.split("");
//--The text appearance--
letterformat = new TextFormat();
letterformat.font = "Verdana";
letterformat.align = "center";
letterformat.size = "10";
//--Custom values--
spacing = 12;
speed = 3;
//--Creating the text--
for (L=0; L<letters.length; L++) {
_root.createEmptyMovieClip(letters[L], L);
_root[letters[L]].createTextField(letters[L]+"t", L, L*spacing, 10, 50, 20);
with (_root[letters[L]][letters[L]+"t"]) {
text = letters[L];
setTextFormat(letterformat);
selectable = false;
}
//--Making it move--
if (L>0) {
_root[letters[L]].id = L;
_root[letters[L]].onEnterFrame = function() {
this._x += (_root[letters[this.id-1]]._x-this.lastX)/speed;
this._y += (_root[letters[this.id-1]]._y-this.lastY)/speed;
this.lastX = this._x;
this.lastY = this._y;
};
} else {
_root[letters[L]].onEnterFrame = function() {
this._x += (_root._xmouse-this.lastX+10)/speed;
this._y += (_root._ymouse-this.lastY)/speed;
this.lastX = this._x;
this.lastY = this._y;
};
}
}

Mouse Trail
i want to use the mouse trail in the special effects section on this site, but i want the word 'kirupa' to change and be the word 'IMPRESSIONS'......but when i change it, the trail does not trail at all. i dont know much about codes so please can a clever person change the whole code for me and email me it so i can just copy and paste it into flash.

Mouse Trail
hey everybody. im trying to make a mouse trail thingy for my website and wat im tryin to do is there's gonna be a bomb and whenever someone clicks on a hyperlink there's an explosion, but i cant seem to get the code to work. the original code works but when i added the MovieClip.onMouseDown i stopped working.
here's the code:

onClipEvent (load) {
_x = 0;
_y = 0;
speed = 5;
}
onClipEvent (enterFrame) {
endX = _root._xmouse;
endY = _root._ymouse;
_x += (endX-_x)/speed;
_y += (endY-_y)/speed;
}
onClipEvent (enterFrame) {
MovieClip.onMouseDown = function() {
gotoAndStop(2);
}
}

Mouse Trail
hello..does anyone know how to change the color of the text following the mouse?

Text = "Kirupa has the best site on the net!!!";
letters = Text.split("");
letterformat = new TextFormat();
letterformat.font = "Verdana";
letterformat.align = "center";
letterformat.size = "10";
spacing = 8;
speed = 3;
for (var LTR = 0; LTR<letters.length; LTR++) {
mc = _root.createEmptyMovieClip(LTR+"l", LTR);
mc.createTextField(letters[LTR]+"t", LTR, LTR*spacing, 10, 20, 20);
with (mc[letters[LTR]+"t"]) {
text = letters[LTR];
setTextFormat(letterformat);
selectable = false;
}
if (LTR) {
mc.prevClip = _root[(LTR-1)+"l"];
mc.onEnterFrame = function() {
this._x += (this.prevClip._x-this._x+5)/speed;
this._y += (this.prevClip._y-this._y)/speed;
};
} else {
mc.onEnterFrame = function() {
this._x += (_root._xmouse-this._x+10)/speed;
this._y += (_root._ymouse-this._y)/speed;
};
}
}

Re: Mouse Trail
On the "Mouse Trail" tutorial, for Flash MX here on Kirupa, it doesn't explain how to change the color of your text. Does the text have to stay black or is there a script to change it?

Mouse Trail Help
if you check out the FLASH MX tutorial section, theres a tutorial for Mouse trail, it works in mx2004 as well. my question is, how to change the color of the mouse trail text, im not sure what code to add tochange the color, default is black

Mouse Trail
Can I change the color of mouse trail text to any color i want instead of black?

Help With Mouse Trail
Ok, I like the mouse trail called mouse trap. But the problem is how do I make the mouse trail follow the mouse all over the page? Instead of staying in the Flash box?

Mouse Trail Problem
Hello everybody, has anyone combined javascript to an swf so when you move the mouse around on the page outside of the swf the trail still moves. In theory it should work, its just transferring the variables into the swf. But as you are sure to have guessed I am not a programmer.
Any help would be gratefully received.

thank you

Crusty

The Anti-mouse Trail
I'm trying to create an effect which shouldn't be too hard. I want a movie clip to try to maintain its "home" position, but at the same time I want it to shy away from the mouse. The way I've approached it is to have it constantly tend towards its home position but if the mouse is within a set distance it will calculate the angle from the mouse and move in the opposite direction.

This seems theoretically correct but it doesn't work. Don't know if my maths has deserted me or what.

Anyone done anything similar I could rip off? Not life or death, it's just getting on my nerves.

Ta.

Duplicating Mouse Trail
I've searched for this, but I can only find explainations for flash 4, so sorry if this has been discused.

I am trying to create a duplicating mouse trail, basicaly for every frame a rain drop falls from the mouse. I've tried in multiple ways, I've tried having an empty tracer clip follow the mouse(by making the x and y equal the mouses at the start of every frame, not by dragging), by placing the mouses position into variables and duplicating the movieclip using those, doing that using raw input(without the in-between variables), and using attachMovie. None of these methods allow me to duplicate the movieclip every frame.

Thanks for any help.

Mouse Trail Across Scenes?
Hi,

I have created a flash site and thought it would be cool to have something follow the mouse as they move about but I can't seem to do it correctly.

Each scene I have has kind of a transistion from the last and all the 'mouse trail' open Flas I get only use about three frames the end own being goto frame one, there my page never loads... Should I be using load movie or something? If so, does any one know how its done? And will it continue to work thoughout the site everytime I change scene? And will the same work with a sound loop so it doesn't start again when you change scene, if you know what I mean?

Help,

ANTneTOM!

Button And Mouse Trail
how can i change the mouse when im ova a button and i want to use my own movie clip

Any One Ever Made A Mouse Trail ? Then Help Me Out.
Hi ppl,

Can someone tell me what is the problem with makin a mouse trail... i made a movieclip whose _x and _y are constantly updated to match the _xmouse and _ymouse properties ...this works.... BUT the movieclip is always almost 100 pixels away from where the pointer is!!!!! so my question is why is this happening????? is this a bug? or am i doin something wrong? please dont tell me tht the center of the mc i just made is around a 100 pixels away from the content of that mc. cos its not.

Complicated Mouse Trail
Ok i havent beena ble to find this in the movies sections.

But i want an mc to go lag behind the mouse. But go to exactly everywhere the mouse has been.



So its like the mouse makes the path for the mc to follow

Copyright © 2005-08 www.BigResource.com, All rights reserved