-
how can i chack if the mouse goes up or down?
thank's
-
do you mean on the screen or a mouse button being pressed...
for the first bit, simply compare the position of the mouse to a point of origin, and the sign of this will tell you if it's up or down...eg.
Code:
yorigin=300;
if (_root._ymouse>=yorigin){
//mouse down
}
else{
//mouse up
}
hope this is what you mean...
-
i think that in what you said it chack;s if the mouse is under or above 300, but i want it to know if i'm moving up or down allways.
hope i made myself understandable.
-
You could put a control movieclip on the stage somewhere.
just attach
Code:
onClipEvent (mousemove) {
if (old > _root._ymouse) {
_root.mouseDir = "Up"
old = _root._ymouse
} else {
_root.mouseDir = "Down"
old = _root._ymouse
}
}
Not sure what you'd want it for but it works.
A
-
well what i want to do is, to have a row of pictures that starts at the bottm left, and end at the top right. now evrytime the mouse will go up i want the row to move down, and oppsite.
i'll try to play with you're code.
thank's
-
could you help again? i didn't quit understand, you're code, where should i put it, and how do i tell it to do diffrent actions when it's "up" or "down".
thank's again
-
Go to menu "Insert > New Symbol". Make the new movie a movie clip and give it a name. Drag it to the stage and it will appear as a tiny little object. Click on it, go to the object actions pane and add the code I gave you, when you debug the movie you will see it output "Up" and "Down" as your mouse moves.
As to how you use it
Where you see _root.mouseDir = "Up", you replace that line with the code (however much you like) for what you want to do when the mouse is going up.
Where you see _root.mouseDir = "Down", you replace that line with the code (however much you like) for what you want to do when the mouse is going down.
It's important, though, that you leave the line old = _root._ymouse in.
OK
A
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|