ActionScript 2.0 :: Box To Follow By Mouse + Ease + Restrictions
Feb 25, 2003
I have this box which is a MC and it is called "orangebox". Now I want this box to follow my mouse, but only over a certain region. I put a rectanlge MC over the area I want the box to follow. On that rectange I put this code...
PHP Code:
on (rollOver) {
startDrag("_root.orangebox", true, 60, 362, 742, 362);
}
That works fine and dandy, but I want it to ease when it follows, not stay on the mouse. I think it will give it a cooler look. The code Kirupa has for ease is...
[Code]...
View 4 Replies
Similar Posts:
Apr 21, 2009
i have a script for my project that exactly does what i want but the only thing missing is i want it to follow the path with ease . that i couldn't figure out. here is the code you can copy and past it on the first frame of a flash project and it will work:
var s = _root.createEmptyMovieClip("circle", 10);
s._x = 250;
s._y = 200;
[Code]....
View 2 Replies
Jun 14, 2007
I'm trying to make it ease to the spot but it doens't seem like there is a way.
It is jumpy, i would like to it to slowly smooth to the current mouse location. It's going to be used for a touch screen
Heres my current AS:
Code:
stop()
face.onRollOver = function(){
startDrag("mouseTarget", true);
[Code]....
View 1 Replies
Nov 9, 2005
[URL]I need to modify it slightly so that when the user moves the mouse OUTSIDE the flash movie (i.e. in the HTML bits), the circle returns to a specified x,y coordinate in the flash movie. Lets say for arguments sake (25,25).
View 3 Replies
Feb 28, 2006
I followed the tutorial below to get a great effect.
[URL]
Only problem now is that the image is in the background, and you can see the edges as the image moves too far down!
Is there any way to have the image follow the mouse but only within a certain region, say the image will only follow the mouse if it is within a 100px high area?
The code I'm using is
Code:
onClipEvent (load) {
_y = 0;
speed = 5;
}
[Code]....
I only want the image to move up and down, not all around.
View 3 Replies
Apr 29, 2009
I have a basic question. It seems like it should be simple but I am having a lot of problems resolving this on my own. The following code is what i used for an 'eyeball' on a Teddybear illustration.
[Code]...
View 1 Replies
Oct 26, 2009
I found this tutorial [URL] and is wondering if I could limit the area where the clip can follow? I'm planning to have my cartoon's EYEBALLS follow the mouse move.
View 1 Replies
Jun 28, 2009
I have the following code which works fine but I would like to set a restriction on how far the movie will travel on it's x and y axis. How can this be achieved?
Code:
speed = .99;
setInterval(CursorMovement, 40);
function CursorMovement() {
[Code]....
View 1 Replies
Jan 30, 2009
I have a front menu with about 6 different movieclip 'buttons' that are linked to different scenes. What I want is when the mouse get within a certain range of the menu items they will ease towards it as if it were magnetic, but the menu item is attached with a spring to the back, and it will somewhat follow the mouse around, until the mouse leaves that range and the menu item eases back into place.
Also, these same menu items, I want them to be blurred when the mouse isnt near them, and the closer the mouse gets, the clearer they appear (so if the items are set up as 2 up by 3 across, and the mouse is at the far left, the items will decrease in clarity from the left across, but if the mouse is in the middle, the middle items will be clear, but the side ones will be equally blurred).
View 0 Replies
Jun 23, 2010
I am looking for a quick and simple way of having a movieclip follow the mouse with easing, until it reaches the mouse, at which point I want it to stop. It needs to ease out, so the standard cursorMC.x = mouseX will not do (also because it doesn't update the position of the mouse.
View 1 Replies
Sep 29, 2005
I looked at the 'mouse follow with easing' tutorial. http:[url]....how to restrict it to one axis and set boundaries. I only want it to move along the x-axis.
Code:
onClipEvent (load) {
_x = 0;
_y = 0;
speed = 5;
}
View 7 Replies
Oct 1, 2005
I'm trying to create a nav bar that uses AS easing. For some reason, that I can't figure out, the mouce has a lead on the moving object the further from the center it gets.
[URL]
here is my code:
onClipEvent (load) {
_x = -160;
_y = 16;
speed = 5;
[Code].....
View 9 Replies
Aug 17, 2011
I'm trying to scroll an MC based on X mouse position and ease it into it's final position as it reaches the edges.
View 1 Replies
Feb 12, 2006
i have been trying to figure out how to make an object move when its moused over.
once moused over, i would like for it to move with an ease (penner), but once the mouse is off the object, i would like it to ease into a dock position.
[Code]...
View 4 Replies
Jun 25, 2010
Essentially what I'm trying to do is nearly the same as this: http:[url].......However I'd like to ease/tween the movieclip position and rotation to the mouse position.The main issue I see is trying to get the current movieclip rotation and the target rotation,then tween it cockwise or counterclockwise from current to target.The way a movieclips rotation uses positive and negative numbers throws it off.If you just want to lock the mc rotation to the mouse rotation its fine, but once you try to tween it you run into difficulties. So the end effect would be like if you were to draw imaginary clockwise circles around the object, it should just keep rotating clockwise towards the mouse. Then if you started going counter clockwise it should just keep easing counter clockwise to the mouse.
View 1 Replies
Jun 25, 2010
I'd like to ease/tween the movieclip position and rotation to the mouse position.The main issue I see is trying to get the current movieclip rotation and the target rotation, then tween it cockwise or counterclockwise from current to target. The way a movieclips rotation uses positive and negative numbers throws it off. If you just want to lock the mc rotation to the mouse rotation its fine, but once you try to tween it you run into difficulties. So the end effect im looking for would be like if you were to draw imaginary clockwise circles around the object, it should just keep rotating clockwise towards the mouse. Then if you started going counter clockwise it should just keep easing counter clockwise to the mouse.
View 3 Replies
Aug 27, 2009
I have created a small flash movie where the eyes of the character follow the cursor. Its based on this one here Only problem is, it only works while the mouse is actually over the movie. Is there any way to increase the sensitive area to the whole screen without increasing the actual size of the movie?
View 1 Replies
Jun 11, 2003
I have an MC that contains a menu. Within the menu MC I have a little arrow movie clip that I would like to ease to the mouse position when clicked. I have this code on the little arrow, copied from many easing tutorials:
[Code]....
Also, I want the arrow MC to start at a particular place. But when I put _y = 30 (for example, which is where I would want it to start from) it is still at 0,0 - even when I change _y to this._y. What the heck?
View 12 Replies
Feb 3, 2009
I need to set a mouse-controlled scrolling animation to ease when it starts and when it stops in AS2. Here's my current onEnterFrame script. Might be a little crude, but it succeeds in starting and stopping the animation when the mouse rolls off the movie. Moves left on one side and right on the other. I just want the starting and stopping to be eased a bit.
[Code]....
View 3 Replies
Dec 26, 2009
I am using CS3 and trying to get an object to follow the mouse and having a hard time finding a tutorial on this, because all of the ones i have found want me to add the actionscript to the MC, and my version of flash won't let me do that. Flash expects me to attach it to the frame and so the code doesn't work.
View 11 Replies
Feb 24, 2010
...without using the startDrag method. I know I can use code like this inside of a mouse event listener/function:
Code:
objectMC.x=mouseX;
objectMC.y=mouseY;
This code makes the object move with the mouse, but only if I move the mouse very slowly. When I move the mouse quickly, the mouse leaves the area of the object and thus the MOUSE_OVER listener stops listening, causing the object to stop.
View 1 Replies
Jun 1, 2010
I can't find any info on this so I guess I'll just ask. I'm trying to make moveclips that will follow the mouse pointer on MOUSE_OVER but only up to a certain distance then tween back to its original coordinates (preferably with a bounce or elastic ease).I tried startDrag(); on mouse over and that works quit cool but the problem is stopping the drag...
View 5 Replies
Jan 4, 2011
I'm trying to get a little mc to follow my mouse but stop when it gets to the "walls" (borders).
I first tried to test when the mc itself hit that _x value:
Code:
if (this._x <= 88){
_root.mc_go = false;
} else {
[Code]....
but when the mouse leaves the area, the mc does not continue to follow it all the way to the border, it just stops immediately.
View 1 Replies
Apr 21, 2004
make eyes move and follow a mouse on the _x and _y axis, but the eye needs constrained with in an eye socket.I have used two mc to constrain while mousedown.
// mc_1
onClipEvent (enterFrame) {
bounds = getBounds(this);
[code].....
View 2 Replies
Feb 12, 2009
Using this code:
[Code]...
I have a compass that is rotating depending on the position of the mouse, however it rotates it from the top left of the stage not the movie clip, how to get the AS to recognise the centre of the compass.. Also, I thought a nice touch would be if the compass had a slight "wobble"
View 1 Replies
May 18, 2009
I have this kind of menu structure design (see image attached), and the way It needs to work is when the mouse goes close to a topic it follows it and when the mouse is a certain distance away it springs back to its orginal place?
View 6 Replies
Jun 8, 2009
I am trying to have a flashlight follow the mouse from it's pivot point. Rotating from its registration point, 180 degree rotation. Also have it move back to place if the mouse is off stage.
View 1 Replies
Aug 1, 2009
Im trying to make a object follow the Mouse_x while locked on a Guide line for the Y axis, but in the Test the object doesnt follow the guide.
how to make a object do a Half Circle motion?
View 1 Replies
Oct 9, 2009
I found several tutorials that work great for having movie objects follow the mouse but I haven't been able to find one that restricts it to only a certain area. This is one of the tutorials that I was looking at: http:[url].......What I basically want to do is have this hanging lamp tilt either left or right depending or where the mouse comes from.
View 1 Replies
Jun 19, 2010
I have a graphic replacing the mouse cursor and I'm having it so that when the user goes over a MC (called hitSquare in this case) the cursor graphic moves to a certain location on the stage, then returns to the location of the real mouse position.[code]The problem with this is that during the 0.5 seconds that it takes the graphic to return to the mouse position, the user can still move the mouse, so it actually goes to different co-ordinates and when the user moves the mouse after the 0.5 is over, the cursor just jumps to the new location.How can I make it so that the graphic smoothly follows the mouse, (even if it's being moved and has to update in real time) and then returns to the standard mouse follow code (cursorMC.x = mouseX; etc) once it's met its final destination?I take it this requires some "mouse trail" code that gets removed once it's caught up with the mouse.
View 10 Replies