Lot to ask from one frame

does anybody know a way to use a the mouse to move a movie clip in one frame without dragging?

what i’m shooting for is moving a map in the opposite direction of the mouse (mouse moves left, map moves right, mouse moves up, map moves down) and continues to move. not just one jump, but real motion.

i’ve thought of initializing a getTimer after the mouse moves past a certain point and of moving the map after the mouse rolls over a hidden mc.

i have only one stopped frame to do it in. it must be action script…

help?

onMouseMove, and then use the _x & _y, compared to initial x&y of the mouse, to move map in opposite direction, reset mousetracker x&y to new values to keep updated, maybe throw in an “updateAfterEvent”…not gonna code that for ya tho’… :wink:

Not sure if this is what your after but there is a tutorial written by Lost In Beta on Kirupa for easing an object TO your mouse when you click on the stage. The link for that is here

I just changed some of the +/- signs around to have the object ease AWAY from the mouse when you click:

[AS]
onClipEvent (load) {
_x = 0;
_y = 0;
speed = 5;
}
onClipEvent (mouseDown) {
endX = _root._xmouse;
endY = _root._ymouse;
}
onClipEvent (enterFrame) {
_x -= (endX+_x)/speed;
_y -= (endY+_y)/speed;
}
[/AS]

Just draw any old thing on the stage (I made a circle) and make it a movie clip (I made the registration point in the center). Then put the above code not on the clip but on the main stage.

Is that sort of what you want?

Dangit! Why am I always too late??? :d:

:stuck_out_tongue:

maybe this wiill help?

thanks for the help, everybody.
but in all fairness, i cheated to solve the problem. i said i couldn’t drag, but that was because i was using onRelease to zoom on the map and coulnd’t use it to do two things (zooming and stopDrag).
i experimented with setInterval and the other suggested things. i couldn’t get them to work and didn’t want to ask for even more help. in the end i came up with what i think is a pretty innovative solution.
i set a variable to _xmouse before click and another after. did a onPress startdrag and a != between the two variables to see if the map had been dragged. if it had, the onRelease was set to stopdrag, if not it was set to zoom in. then i set another variable to check the _xscale before click and another for after. if it had changed, i set the onRelease to stopdrag.
now i have one map that can either zoom or drag all based on one mouse click. no more arrows or magnifying glasses to zoom and navigate.

i’m new to all of this coding so i was pretty pleased it all worked out.

well, if you’re happy, I’m happy! :wink:
congrats!