ActionScript 3.0 :: Flash Mouse Drag On One Clip To Move Another Clip
May 13, 2011
I trying to create an animation that will demonstrate the basics of steering a sailboat. There will be a movieclip top view of the boat hull. Another movie clip will be the boat tiller. One end of the the tiller will have a grip that the user will drag with the mouse. Dragging the grip will turn the tiller turn right or left on its axis. When the user drags the tiller to the left, the boat hull turns to the right, and vice versa. I can get the tiller to rotate in a circle around its axis. However, making the tiller turn no more than 15 to 20 degrees left or right, and creating an event listener that will test when the tiller is turned left or right, then turn the hull the opposite direction as a sailboat would react.
View 2 Replies
Similar Posts:
Jul 2, 2007
how to drag a move clip but only change the x value, so dragging left and right. Obviously the startDrag() allows you to drag all over. I had tried
map_mc.onPress = function(){
this.startDrag()
this.onEnterFrame = function(){
[code]....
which "kinda" works but is far far from perfect. This is more or less makes the movieclip slide from side to side, but like i said, its not perfect.
View 1 Replies
Aug 29, 2003
i have 2 movieclips: i want to move both of them but the second movie clip will only move if the first clip reach his final destination how do i do that?
View 2 Replies
Sep 10, 2010
I want to move my movie clip when mouse over. The rectangles position is 275x200, so I want to place it at 275x170 when mouse is over.
Here's my code.
import fl.transitions.Tween;
import fl.transitions.easing.*;
import flash.events.MouseEvent;
import flash.events.Event;
[code]....
It doesn't work. How to fix it? That scrolls up, but how to put it down at the earlist when the position is y170 and mouse out?
View 21 Replies
Dec 17, 2009
I am trying to make a flash game for a website. In the game, there is a large interactive map which I created. The map is supposed to scroll just by moving the mouse.
As a placeholder for the map, an ex-coworker created a gradient background, which moves along with the mouse. Here is the AS.
// Width and height of image
var w = Stage.width * 2;
var h = Stage.height * 2;
// Mock up graphic that will be the image
[Code].....
how to make the MC move and pan along with the mouse? Even if it is a completely different code?
View 1 Replies
Aug 23, 2011
I have done the research a lot but failed I need to give the effect in flash like this any one know how to do that please send me any hint or peace of code so i will get
View 3 Replies
Feb 4, 2004
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....
View 6 Replies
Feb 4, 2004
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.
View 6 Replies
Nov 15, 2004
[URL] i assume it's a series of frames with slightly different photos of the razor. when you play the movie it looks like it is spinning. my question is, how do they get the movie clip it to play forward when you move the mouse in one direction, and backward in the other? is it something like mouse over to the right and left (i'm bad with the direction code)??
right now i have a version that will play the movie clip (it's a button w/ only a hotspot) on mouse over and it will stop when the mouse os off the hotspot, but i can't get it to work like the headblade example. because i don't know the right code to play forward and back etc on mouse moves.
View 2 Replies
Mar 6, 2011
I was browsing through the AS3 help in CS3 and came across good ole Delta. I've been playing around with it and it zooms things just fine but I had an idea for a birthday card for my niece and now would like a way to have the mouse wheel do something perhaps outside of what Delta will permit. I want to move a nested movie clip to next and previous frames with the mouse wheel and until using it with delta for zooming only used it for scrolling. I got it to work but not how I'd like. Using this code I got it to go to next frame which is 1/3rd the battle:
[Code]...
View 9 Replies
Dec 7, 2004
I have been playing about with the "Changing colors with Actionscript" FLA found on this site. Basically, when you move your mouse over a coloured box the movie clip changes to the corresponding color. This is the AS
[Code]...
View 1 Replies
Nov 22, 2004
how I can create a working scrollbar for a movie clip? I've managed to get as far as inserting two buttons that allow you to move the movie clip up and down, it's just getting the scrollbar to be able to move the clip within a certain ratio that I'm finding hard to do.
View 4 Replies
Aug 7, 2007
What do I do to make this rotate the line_mc move clip in a counterclockwise rotation when I scroll the mouse wheel up instead of down. Currently it rotates the movie clip in a clockwise fashion regardless of which way I scrool the mouse wheel.
[Code]...
ps. is there anyway to get this thing to ease when it rotates... instead of the jerky rotation it does now.
View 7 Replies
Jun 24, 2010
I am pretty new to ActionScript 3 and Flash. I don't want my movie clip to play unless the person's mouse curser is on the movie clip for more than a second. If the person just runs their curser over the movie clips really quickly, then it should do nothing. It must be more than a second. How do I code that?
[Code]...
View 17 Replies
May 6, 2010
i have a problem with hitTest, i want when my mouse is on the leaf movie clip the movies clip disappear. or away any where
[Code]...
View 0 Replies
Jun 23, 2010
I have multiple movie clips on my piece. Each clip is of an an image, and when the mouse curser goes over the image, the movie clip begins (making it bigger).If you run your mouse curser all over the screen, they all activate at once.I want the clip to only activate after the mouse is on the specific clip for more than a few seconds. I know I need a timer. How do I do this? What is the code and where does it go in mine (below)?
Frame 1:
stop();
image10.addEventListener(MouseEvent.MOUSE_OVER, image10overFunc);
function image10overFunc(e:MouseEvent)
{
[code]....
View 2 Replies
Sep 9, 2003
I have a clip that rotates to orient itself towards the mouse when the mouse is over a given area. When the mouse leaves the area, the clip snaps back to its original position.
1) the clip snaps directly towards the mouse at the moment the mouse enters the clip; I would like it to actually rotate;
2) the clip snaps directly back to its original position when the mouse leaves the clip; I would like it to ease back into position.
[Code]...
View 3 Replies
Feb 17, 2011
What's the correct way to track mouse position, from Adobe Flash, when someone has: Started a drag within the Flash application (a MOUSE_DOWN event), Dragged the mouse outside the app or even the browser window (a MOUSE_MOVE event), and Released the mouse button (a MOUSE_UP event)? For example (imagine Stack Overflow is a Flash application):
Within the app, I'm able to track the mouse X and Y positions with a MOUSE_MOVE event listener, but I lose it when it goes outside of the browser... So, how do I track the position of the mouse no matter where it goes? For a good example, try Google Finance. Try dragging the chart around; it'll still drag around if you move your mouse out of the browser window, and the mouse will be outside of the browser when you release it.
Also, check out KOKO KAKA; If you click on the scrollbar (make the browser window really small) and move outside of the browser window, the scroll bar moves just like a real one would. I believe both only work because the MOUSE_DOWN event "captures" the mouse, allowing the Flash application to track the position of the mouse even when it is outside of the browser.
View 2 Replies
Oct 23, 2010
it seems simple enough but i have no idea on how i could get a movie clip to slowly move to the coordinates of another existing movie clip
View 5 Replies
Feb 12, 2010
how to attach a movie clip to another movie clip after drag and drop .I mean to say that is it possible to make a new movie clip with the target movie clip and dropped movie clip.
View 2 Replies
Jun 30, 2009
it isn't such a big problem bur for a beginner like me it is.I have a movie clip called "Lion_beginning_mc", inside of it I have 3 Key Frames and Inside each and one of them I have different shapes.For example:Key Frame number 01 - DogKey Frame number 02 - CatKey Frame number 03 - MouseI want to move this movie clip "Lion Beginning_mc" form Key frame number 1 to Key frame number 20.I want the Dog,Cat and a mouse to change between each other only once while moving from Key Frame number 1 to 20.And then when the movie clip "Lion Beginning_mc" reaches his goal another movie clip or a frame (with a shape) will start.
View 5 Replies
May 20, 2011
Im trying to do a drag and drop system where the user can drag a movie clip into an area. Although i would like to make it snap to a target instead of just sitting wherever it lands in the area. Problem Two:
The next thing i am trying to do is when the user has a movie clip on a target already, and trys to put another movie clip in that target area, it will replace the one thats in there and go back to its current position. Here is the script of what i have done so far:
[Code]...
View 14 Replies
Mar 23, 2010
I have some movie clips. i want to drag all clips when i drag single movie clip. Ex. I have movie clips "A1", "A2", "A3", "A4", "A5" . Randomly visible some of them. Suppose "A1", "A3", "A4" has visible. When i will drag "A1" movie clip all these "A3", "A4" also move with "A1".
View 6 Replies
Aug 16, 2010
I tried to translate this old code into actionscript 3, but unfortunately the new code doesn't work anymore.The mouse events of the old code are general, not linked to a movieclip (which I did in the new code with the addEventListeners). How can you do this with as3? Something like Stage.addEventListener? (but then I got an error feedback from flash, so it must be done differently).I also don't know how to translate the onMouseUp part. Maybe with a removeListener?
old code:
Actionscript Code:
import com.flashcreations.utils.MathExtra;onMouseDown = function() { // define this
[code].....
View 2 Replies
Nov 27, 2009
I have two buttons one button is calling in a movie clip with tween and then a second button that is also calling in a movie clip into the same spot. I want to make it so that when ever you are calling a movie clip in is that it moves the other movie clip away or that it lands on top of the old one. Here is the code.
import fl.transitions.Tween;
import fl.transitions.TweenEvent;
import fl.transitions.easing.*;
[Code]....
the problem is that it the second movie clip is always on top even though thay are on the same layer.
View 4 Replies
Sep 15, 2009
For a project I am am working on I need a pan effect like the one in URL...Now I was just wondering how to do this. There are various ways I can think off to make the background move according to mouse movement, but nothing I have done comes close to the smoothness in URL...More specifically, I can trigger an event when mouse in moved left/right/up/down in the pressed down stage - this event can tween the background in any direction required. But how do I stop the tween movement when the mouse is released. Since I have asked the background to tween from one its central value to say its rightmost/leftmost value, how do I make it stop in the middle of the tween when the mouse is released.
View 3 Replies
Sep 10, 2006
how to drag a movie clip that is larger than the flash document and have it stop dragging at the edges of the movie clip? I have an 300x300 (just for example) flash movie. i have an image that is 500x650 placed a x/y of 0. i want people to be able to drag the large image so they can see the whole image, even though its larger than the movie dimensions. but i dont want it to keep dragging so say they drag it left 600 pixels, you see past the edges of the images to the background. i guess if you do the math, say at x/y = 0, they can only max drag it left 250 pixels but not farther left so you wont see past the edge of the image's right side. i have some diagrams to illustrate.
View 6 Replies
Nov 17, 2011
i want a button in a mvie clip which moves the main movie clip to certain frames. THIS I CAN DO.
However when i add drag and drop code to the main movie clip (of which this button is inside) the button no loger moves to the frames but the drag and dropworks.
i want to drag and drop a movie clip with a button inside this which changes the main movie clip. what do i need to add?
View 4 Replies
Mar 29, 2012
Im having some trouble getting the syntax right. I have a movie clip that adds sounds to an array when it is touching other movie clips. I have a stop button than i want to remove the event listener of the bar and send back to the original position. My code is:
[Code]...
View 1 Replies
Apr 5, 2010
I am looking to drag a movie clip onto another movie clip. Both movie clips are within a movie clip. I have tried the following and the drag part works but it doesn't stay on the target:
[Code]....
View 13 Replies