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








A Line That Will Following The Mouse Cursor


Hi, can anyone teach me how to program this kind of question?

After a user clicks on a pointA on a graph, a line starting from that pointA will follow the mouse cursor until the user clicks on another pointB then the line will join pointA to pointB.

Hence, that line will "grow" longer if the mouse cursor move further away from pointA.

Then a line starting from pointB will follow the mouse cursor until the user clicks on another pontC then the line will joint pointB to pointC ..
and so on, until the last point is clicked.

Thanks alot for any help.

Regards,
LWM




ActionScript.org Forums > ActionScript Forums Group > ActionScript 1.0 (and below)
Posted on: 01-31-2005, 08:47 AM


View Complete Forum Thread with Replies

Sponsored Links:

Custom Cursor To Return To The Regular Mouse Cursor
How can I get my custom cursor to return to the regular mouse cursor when in the bottom 3rd of my flash movie. I need to do this for nav functions and I want the regular cursor actions in this area. So to recap: within the top 2/3 of the movie I will have my custom cursor, upon entering the bottom 3rd of my movie I need the cursor to switch back and vice verse...

my code below, please any suggestions are very helpful as I have tried several things:

stop();

import flash.events.Event;
import flash.events.MouseEvent;
import flash.ui.Mouse;

Mouse.hide();

stage.addEventListener(MouseEvent.MOUSE_MOVE, moving);
function moving(evt:MouseEvent):void {
if (cursor.currentFrame != 0) {
cursor.gotoAndStop(1);
}
cursor.x = stage.mouseX;
cursor.y = stage.mouseY;
cursor.mouseEnabled = false;
evt.updateAfterEvent();
}





//These three eventlisteners are telling flash to "listen" for specific events
//in our case if the mouse moves and if the mouse button is down or up.
//then if one of these events happens, it calls a function (mouse_down, mouse_up or moving).
stage.addEventListener(MouseEvent.MOUSE_DOWN, mouse_down);
stage.addEventListener(MouseEvent.MOUSE_UP, mouse_up);


// This is how to construct a simple function,
// this function will write in our text field "mouse is moving"
// when the even is raised by the eventlistener

// function just like above, just for the mouse down event.





function mouse_down(e:MouseEvent) {
if (mouseX < 800 && mouseY < 450) {
timer.start();
timer2.start();
}
}

// function just like above, just for the mouse up event.
function mouse_up(e:MouseEvent) {
timer.stop();
timer2.stop();
}

Thanks again and help!

View Replies !    View Related
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!

View Replies !    View Related
Changing Mouse Cursor On Mouse Over/out Without Drag Movie?
Hello,
I have a movie clip/button that activates some actions but I don't want the mouse pointer show the link icon (hand) and instead show the normal arrow icon. Is this possible with a fast mouse.smth actionscript or is a complex startdrag/stopdrag of movieclips the only way out? Thanks in advance.

View Replies !    View Related
Edited Mouse Cursor Vs Right Mouse Button Click
I changed the mouse cursor using a tutoral from this forum, but when I press the right mouse button, the standard mouse cursor reapears...

How to prevent that?

View Replies !    View Related
Mouse.hide(); Does Not Work - Mouse Cursor Is Still Shown
why mouse cursor does not hide ?
the mc cursor to replace mouse cursor is shown together with it;
whatīs wrong?
thanks



Quote:




onLoad = function () {
Mouse.hide();
cursor.swapDepths(200);
};

onEnterFrame = function () {
cursor._x = _xmouse;
cursor._y = _ymouse;
};

onUnload = function () {
Mouse.show();
};

View Replies !    View Related
Edited Mouse Cursor Vs Right Mouse Button Click
I changed the mouse cursor using a tutoral from this forum, but when I press the right mouse button, the standard mouse cursor reapears...

How to prevent that?

View Replies !    View Related
Line Tool Cursor
Can someone tell me how to change the color of the cursor so when I am using the line tool on a black background, I can see the cursor

View Replies !    View Related
Custom Mouse Cursor With Mouse Events
i'm trying to use a custom mouse cursor for a mouse over and dragging effect (an open hand and a closed hand).

the hand MC has two frames, one frame with the label "open", and one with the label "closed". i'd like to rollover an object, display the hand cursor with the "open" frame. however, when i do this, because the hand is now tracking underneath the mouse cursor, the object underneath immediately calls it's roll_out dispatcher.

how can objects underneath the hand cursor still fire their mouse event dispatchers (roll_out, mouse_up and mouse_down)?

View Replies !    View Related
Mouse Cursor Changing On Mouse Over A Button
Iīve made a custom mouse cursor but the cliente wants that little hand when the mouse is over a button and/or links. Is that possible?

View Replies !    View Related
Mouse Cursor Changing On Mouse Over A Button
Iīve made a custom mouse cursor but the cliente wants that little hand when the mouse is over a button and/or links. Is that possible?

View Replies !    View Related
Detect The Line The Cursor Is On In A Text Box
I know how to find the position of a character in a string in a text box, but how do I figure out what line the cursor is on? It must be possible because I would think that the scroll property must use it somehow.

View Replies !    View Related
Drawing A Single Line That Extends To The Cursor
My goal is to draw a line from 0,0 to wherever the cursor is clicked, but as you hold down the mouse, the line continues to follow the mouse.

Here's where I am so far. This draws a line to the mouse, but as the mouse drags around it creates a new line for every frame so I have hundreds of lines instead of just one line that appears to follow the mouse.

Can anyone help?

Thanks!


Code:
onMouseDown = function () {
this.createEmptyMovieClip("line1_mc", 1);
line1_mc.lineStyle(.5, 0xFF0000, 100);
line1_mc.onEnterFrame = function() {
line1_mc.moveTo(0, 0);
line1_mc.lineTo(_xmouse, _ymouse);
line1_mc.endFill();
};
};
onMouseUp = function () {
line1_mc.clear();
};

View Replies !    View Related
Drawing Using Actionscript: Getting A Line To Follow The Cursor
So I'm working on a project for school and I need some help. In my file, I've replaced the cursor with a custom cursor of a pencil. It roams around the screen and on mouse over, triggers various actions. While it moves, I'd really like it to draw, so the user has more of an active role in the narrative. Is there a way to do this?

Thanks in advance for your advice.

View Replies !    View Related
[Flash 8] Line Cursor Trailer... Noob Needing Help :)
Hey everyone, this is my first post in this forum. I'm a bit of a flash beginner and hopefully with some help will one day be able to help out people like me!

I have a cursor follower which is a little animated bee. And what I am trying to do is give it a little dotted line trail - - - - - - - like this. Which follows it, and then fades out after a while. Ive found numerous line trailers which are ALMOST perfect, but I don't know very much actionscript, especially when you start putting x and y variables and stuff in there.

The ones that I have all scale up the line mc when you move the cursor faster. So instead of having a nice even trail, you get big ones and small ones all over the place. I'm really not sure if this is even avoidable, seeing as every single one I have downloaded does this.

I'm not even sure how to post a link to my file so that you can download it to have a look. But I can post it up here if someone tells me how!

Any help will be much appreciated!

Thanks

View Replies !    View Related
Mouse Over Attached To Mouse Cursor..
Hey,

I've made a basic mouse over in flash that opens a box displaying text in a fixed position. I was wondering if anyone knows any good tutorials for making the box move with the cursor when its moused over?

P.s. Ive attached an image of the mouse over.

Cheers.

View Replies !    View Related
Mouse Cursor
how do i fix up an image or text as my mouse cursor

View Replies !    View Related
Following The Mouse Cursor
How can I make a movie clip follow the mouse cursor, but a slower speed?
thanks
cyborgyin

View Replies !    View Related
Mouse Cursor
I am creating a flash animation that would run from a CD through a flash player. I saw a tutorial in flashkit, on how to change the mouse cursor, but didnt find what I want. I want to change the mouse cursor when I move my mouse pointer to a movie clip. IS THIS POSSIBLE IN FLASH

View Replies !    View Related
Run Away From Mouse Cursor
How to write the action script to make a movie clip run away from the mouse cursor?

Like this one:
http://www.sheepgame.co.uk/

Thanks!

View Replies !    View Related
Mouse Cursor
Hi, I'd like to know how do i change my mouse cursor when i rollOver a button. ( I hope I 've been clear)
thanks
Gpardo

View Replies !    View Related
Mouse Cursor
How do I prevent the mouse cursor from moving but it's still able to click on a button ??

View Replies !    View Related
Mouse Cursor
hello,

i have a dragable window which has coordinates it cannot exide this window contains pixel fonts, now my problem is somtimes when i drag this window to the point where it stops but my mouse cursor exides the sides of the movie the fonts somtimes go blured, i think this is due to the window stoping on 0.whatever of a pixel, i have a reset button with the following code:

on (release) {
_root.back = true;
}

and my dragable window has this code:

onClipEvent (load) {
speed = 10;
_root.target = 75;
_root.target2 = 14;
}
onClipEvent (enterFrame) {
if (_root.back == true) {
_y += (_root.target-_y)/speed;
_x += (_root.target2-_x)/speed;
}
}

is there a way i can tell it that if while im draging the window if the cursor leaves the movie clip to set _root.back = true


hope i have explained this well enough

thanks

View Replies !    View Related
A New Mouse Cursor
Hi everyone,

I would like to know how to write a script for replace the actual mouse's cursor by another symbol?? I have ever tryed for a single frame but not for a complete web site.

Thanks

View Replies !    View Related
Mouse Cursor Help
Is there anyway to make it so that when your cursor goes over a button, it does not change from the arrow to the little hand. Currently I am having to use a custom cursor to avoid this problem, but if there is some otherway to get rid of that hand I would really like to know.

View Replies !    View Related
Mouse Cursor
hey everybody,
I am making a movie where I have a trigger that when the cursor rolls over it moves an object.. the trigger is only used for mouse over and not for onclick events. I was wondering if anyone knows how to change the cursor so that when the cursor is over the trigger it is the normal arrow instead of the click hand..
thanks in advance..
here is the project:
http://hybrid.concordia.ca/~n_earle
-Noah

View Replies !    View Related
Mouse Cursor
Hi,

I would like to know how thanks AS3 i can change the mouse cursor to a pointing finger hand cursor...as if there was a htlm link.

thanks a lot.

A.

View Replies !    View Related
Mouse Cursor ?
Hello,

I don't like the way the cursor turns into a hand when I mouse over a button. How can I make it so the mouse arrow doesn't change into a hand? I would just like it to stay an arrow.

Thanks..... I'm using CS3

FireWire Girl

View Replies !    View Related
Mouse Cursor
Hi... this may be a stupid question, but I'm just not figuring this out...

I want to make a custom cursor that only appears when you mouseover a specific movie clip....

I created an actionscript that does this, but the problem is that the mouse cursor needs to change back to the default, once the mouse rolls off the specific clip...

I attached these actions to my movie clip, which changes the cursor...


onClipEvent(mouseMove){

if (this.hitTest(_root._xmouse,_root._ymouse)){

Mouse.hide();

_root.cursor._x = _level0._xmouse;
_root.cursor._y = _level0._ymouse;

updateAfterEvent;
trace ("cursor")
}

}



Can someone help me figure out how to change back when the mouse rolls off this?

Thanks for reading!

View Replies !    View Related
Mouse Cursor
Hi,

I would like to know how thanks AS3 i can change the mouse cursor to a pointing finger hand cursor...as if there was a htlm link.

thanks a lot.

A.

View Replies !    View Related
About Mouse Cursor
I want to change the hand cursor of the mouse to an ordinary cursor the pointer, when it hovers over the button, i know theres a simple code for that but i forgot it... i laready used it in my other project but i forgot to save the file... does someone here knows the code?

View Replies !    View Related
? Eye Following (looking At) Mouse Cursor ?
Hello!

I can't seem to solve this one at all:
I've made an image with an eye in photoshop which I'd like to use as an "enter page" on my band's website.
It would be pretty cool if the eye would look at the mouse cursor all the time, so it should follow the direction when you move the mouse.
I was thinking that using two image layers could be the base of animating this: one layer for the eyeball itself which can move behind the "skin" in the larger image. If i move the eyeball layer behind the skin layer in photoshop, it looks ok.

The problem is that I don't have a clue about how to do this in Flash (I use Flash 5) Could anyone help me out about this?

PS: can I save the skin layer as a file with transparency that can be used in Flash? I guess this is essential to be able to see the lower eyeball layer...

THANX!

View Replies !    View Related
No Mouse Cursor
Okay, I know in flash it is possible to create custom cursors, but is there a way to not use the default mouse settings.

Default mouse settings meaning, whenever you create a rollover in flash, upon rollover the arrow cursor is replaced with a hand/finger to indicate a link. Is there a way to get rid of the hand cursor upon rollover?

Thanks.

View Replies !    View Related
Mouse Cursor
In my flash movie, I have an action when the mouse rolls over a movie clip, but the mouse cursor changes to a hand when it rolls over it. How do I get the cursor to stay an arrow when they rollover the clip?

View Replies !    View Related
Mouse Cursor
Hi,

I would like to know how thanks AS3 i can change the mouse cursor to a pointing finger hand cursor...as if there was a htlm link.

thanks a lot.

A.

View Replies !    View Related
Mouse Cursor
Oke
I only used flash for a month now and got
a little sick of making those weird stick movie's
so I visited kirupa and found tutorials,
and started working with them so
I made a borderless window ( tnx 2 kirupa )
And I made a mouse cursor ( tnx 2 kirupa )
and it all worked
but every time you leave the borderless window the cursor
stay's in the window and the mouse reappears
so my question is, is it possible 2 make the mouse cursor inside the borderless window disappear when you leave the window and come back when you enter it
Plz help me
and soz for the english but the dutch schools failed on me
( thank god for word )

View Replies !    View Related
Different Mouse Cursor
Is there a way to change the mouse cursor ondifferent occasion using the default pointer?
Like for a draggable object, when we rollover it, we can see a palm curson, and when we click and drag it we can see a drag cursor.

View Replies !    View Related
? Eye Following (looking At) Mouse Cursor ?
Hello!

I can't seem to solve this one at all:
I've made an image with an eye in photoshop which I'd like to use as an "enter page" on my band's website.
It would be pretty cool if the eye would look at the mouse cursor all the time, so it should follow the direction when you move the mouse.
I was thinking that using two image layers could be the base of animating this: one layer for the eyeball itself which can move behind the "skin" in the larger image. If i move the eyeball layer behind the skin layer in photoshop, it looks ok.

The problem is that I don't have a clue about how to do this in Flash (I use Flash 5) Could anyone help me out about this?

PS: can I save the skin layer as a file with transparency that can be used in Flash? I guess this is essential to be able to see the lower eyeball layer...

THANX!

View Replies !    View Related
Mouse Cursor And Pop Up Windows
I am having a proplem with my mouse cursor. It go's behind my pop up windows after i reopen them. Here is a link so you can test it to see what i mean. http://3dwarptdesign.50megs.com/help.swf

View Replies !    View Related
Changing My Mouse Cursor
Hi folks,

I have a button on the current scene and I don't want my mouse cursor to change from the simple arrow to the hand cursor when moving over the button. Is there any way to solve this problem?

Thanx in advance,
Zoo_Mann

View Replies !    View Related
Mouse Cursor Transparency
I have a custom mouse cursor that is on a white box approx. 36x36 I would like to know how I could just have the cursor show and not the box that surronds it. Is there a way I can fade out the background?

View Replies !    View Related
Mouse Cursor Problem...please Help
I want to change the mouse cursor using two movieclips.
One MC contains a vertical line witch can be dragged from left to right and another MC containing a dot witch can be dragged from top to bottom. So you get a crosshair effect with a dot, instead of a horizontal line.
It works perfect but the problem is....I can't click buttons anymore !

This are the actionscripts I use:
MC vertical line:

onClipEvent (mouseMove) {
Mouse.hide();
startDrag ("_root.line", true, 0, 250.5, 751,250.5);
}

MC dot:

onClipEvent (mouseMove) {
_root.dot._x = _root._xmouse;
_root.dot._y = _root._ymouse;
}

Can anyone help me ?


[Edited by MysteryMan-RLF on 10-14-2001 at 04:14 PM]

View Replies !    View Related
Hidin Mouse-cursor
hi peeps..

i need to now how to hide the cursor in flash4.
i already tried

"Set property ("mouse","_visibile")="0"

..but wont fit

second question is to open a java-window with height;width;screenx and screenY.
u have a neet GetUrl-code for that?!

plz help

best regards

View Replies !    View Related
Mouse-cursor Following Spotlight
Do you remember the masking (spotlight) example in the flash5 help file; I'm trying to achieve that effect but the only difference is I want the spotlight to go wherever the mouse cursor is. I tried masking, but it would not follow the mouse. Is there a solution with action-scripting?

Any suggestions?

View Replies !    View Related
Following Mouse Cursor Along A Set Path
I am looking for a tutorial/example/explanation on how to do the following. I want something to travel back and forth along a straight horizontal line and I want it to go back and forth as the mouse travels back and forth around the clip.

Thanks in advance!
Umnbrella

View Replies !    View Related
Restraining The Mouse Cursor~ How?
Hello,

I read somewhere, and played some games (such as the Teletubbies Killing thing) where the mouse cursor can be restrained to a certain area of the movie.

Meaning that you can make the mouse not able to move over specified areas of the movie.

Could someone please teach me how to do this, or refer me to a tutorial?

Thank you.

View Replies !    View Related
Mouse Cursor Coordinates
Hi

Can anyone help? I'm trying to show the position of the mouse cursor in a Flash 5 movie. Rather than having just 3 digits for both the x and y positions I would like a longer list of numerals, similar to how they are displayed in the status bar of vector drawing programs.

Thanks

View Replies !    View Related
Changing The Mouse Cursor
hello there,

does anybody know, if itīs possible to change the mouse cursor in Flash 4?? I didnīt find anything about it. Thanx already for help!!!

jasmina

View Replies !    View Related
Changing The Mouse Cursor
I want to change the mouse cursor within a flash movie only when the mouse is over a rectangular area on the screen, but be the usual pointer when it is in the area outside. I used the Mouse.hide action to hide the original cursor but it hides it on the whole movie unless you're over the rectangular area. Does anyone know a way around this? I tried putting Mouse.show() in the overall actions which didn't work.

View Replies !    View Related
Hiding The Mouse/cursor ?
how can i hide the cursor in flash mx, i cant seem to find it anywhere in the actions

View Replies !    View Related
Mouse Cursor Movie?
i have a question. i have this landscape movie i'm working on. and what i want to do is if the mouse is not active for lets say 30 seconds the landscape turns into a night scene. Is the a script for that? if the mouse in not active goto night movie and when the mmouse is active it goes back to where they left off.
thank you

View Replies !    View Related
Mouse Cursor Is Not In Synch
HI

I HAVE USED THE TYPICAL MOUSE CURSOR CODE TO CHANGE MY MOUSE CURSOR TO ANOTHER SYMBOL.

the problem is that when i run the swf, i see that the symbol is actually about an inch away from where my mouse cursor is. making it very difficult to click on anything.

i looked in the actionscript dictionary for lockcenter, but it doesnt work with the code to hide mouse, use this.

does anyone have a solution for me?

thank you
slimpixi

View Replies !    View Related
Copyright Đ 2005-08 www.BigResource.com, All rights reserved