ActionScript 2.0 :: [Flash CS3] Move A Movieclip Based On Mouse X Position

Feb 11, 2009

I need to move a movieclip based on mouse x position. Like this site [URL] - Which I built using a flashloaded app, but I need more control in this project so I'd like to code it without the app. Basically, I have an image of a boy (left) and a girl (right) and I want to move the boy slightly toward the girl when the mouse goes right and slightly away when the mouse goes left. But only about 25-50 pixels in each direction.

I've cobbled some code together from google searching and rough ideas, and it works in a way, but the boy jumps about 400 pixels to the left on the initial mouse move and then floats a bit too far right and left from there. Here's what I've got on the boyMC:

[Code]...

View 2 Replies


Similar Posts:


Actionscript 3 :: Move Movieclip Position Opposite Of Mouse Coords On Other Movieclip

Jan 26, 2011

Okay I have a script in which I have added an image to the stage. It is absolute centered. I then have another with is on top but much bigger. I would like the big image to move opposite of my mouse position on the smaller image. ie: cursor is on bottom left corner the bottom left corner of the larger image is in the same spot. And the same thing for any other area.

I have tried many different ways but to no avail. I have done research but no one has been able to give me a solid answer. Anyone know of a way to accomplish this. Keep in mind this it needs to work regardless of the image size.

View 1 Replies

ActionScript 3.0 :: Moving Playhead Inside MovieClip Based On Mouse Position

Dec 16, 2009

I am having difficulty with getting the playhead to move inside a movieclip based on the horizontal or vertical position of the mouse on the screen. I can get the horizontal motion to move the playhead, but I can't get the vertical movement to do the same. I have attached the document class .as file for it.

View 2 Replies

Flash :: Javascript - Tracking Mouse Position After Click-and-drag (down-and-move), Even Outside The Stage / Browser?

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

ActionScript 3.0 :: Movieclip To Move To The Position Of Each Of Buttons From Any Position?

May 13, 2010

I'm hoping someone can solve this headache. Basically, I want a movieclip to move to the position of each of my buttons from any position along my x axis. Therefore, the movieclip needs to 'flip' to face the way it is traveling.At the moment I have the movieclip moving to the mouse x axis when I ROLLOVER the button and stop following the mouse when I ROLLOUT but the code won't flip the movieclip so I must have something wrong...

btn.addEventListener(MouseEvent.ROLL_OVER,followCa t);
btn.addEventListener(MouseEvent.ROLL_OUT,stopCat);
btn02.addEventListener(MouseEvent.ROLL_OVER,follow Cat);
btn02.addEventListener(MouseEvent.ROLL_OUT,stopCat );

[code]....

View 0 Replies

Sprite Y Based On Mouse Position?

Jul 20, 2011

So I'm working on my portfolio and I got this problem. The code posted scrolls the sprite "cellContainer" based on the position of stage.mouseY. Perfect.Problem is that I want stage.mouseY to equal the entire cellContainer height. Kind of like how a small tablet equals a huge monitor. So when stage.mouseY = 0,cellContainer.y = 0 and when stage.mouseY = stage.stageHeight, cellContainer.y = stage.stageHeight - cellContainer.height. Right now, it scrolls, but it takes a while to scroll throught the entire height of cellContainer. I want it to be proportional to stage.mouseY.

Actionscript Code:
private function scrollStart(e:Event)[code]....

View 4 Replies

ActionScript 2.0 :: Seek Flv Based On Mouse Position

Oct 10, 2010

I'm doing an online advertising format (728x90 leaderboard). I have embedded a video into the flash file which covers 1/3 of the format (242x90).What i need to do is seek this video from 0% to 100% based on the mouse position over this area (242x90). I'm guessing it would be easier if i created a button over the video which is 242x90 but i would still be looking for the code that seeks the video based on the mouse position over the button.

View 7 Replies

ActionScript 2.0 :: Scrolling Based On Mouse Position

Jun 18, 2005

check out: [URL] - great site

Does anyone know how this scrolling based on mouse position works?

View 8 Replies

IDE :: CS3 - Possible To Move The Mouse To A Certain Position?

Jan 27, 2009

I have a panning background with buttons in it. It would be nice if when the button is pressed i could move the position of the mouse so that the movie pans and catches up with the new position. Is this possible?

View 4 Replies

IDE :: Way To Get 'MovieClip' To Move From Position A In Keyframe 1 To Position B

Feb 3, 2010

What i'd like to do is have a menu/site map that adjusts when you click on a certain icon. For example, I have a AS3.0 flash file with, say, 5 keyframes with 5 buttons that are in different positions on each key frame. The buttons are set to gotoAndPlay the various keyframes. I can set up a tween that links frame 1 to 2, 2 to 3 etc. but what I would like is a tween from, say, 1 to 3, then 3 to 5, then 5 to 1 - basically in a random order rather than sequentially through the key frames. I could set each of these tweens up individually but the site is for a portfolio that I would like to keep adding to and to do this individually would mean an ever increasing amount of tweens.Basically, is there a way to get a 'MovieClip' to move from Position A in keyframe 1 to Position B in another keyframe without a set of tween frames? I'm sure this is simpler than I am making it sound but I don't seem to be able to work it out.

View 1 Replies

ActionScript 2.0 :: [CS3] Playing Sound Based On Mouse Position?

Jan 10, 2009

I have created a document 600x300 filled with buttons for a rollover effect. I want to be able to play sounds dependant on the x and y position of the mouse without having to use objects that interfere with the buttons.

View 2 Replies

ActionScript 3.0 :: Timeline Controls Based On Mouse Position?

May 25, 2009

I'm trying to make a faux 3D rotation animation where if the user mouses to the right the object rotates right and if the user mouses to the left the object rotates left. Depending on how far they move the mouse the rotation should speed up or slow down.I spent a lot of time making an object in 3d studio max and importing the animation of rotation as JPEGs onto the timeline. I figured the most efficient way to go about this would be to make the mouse control the timeline instead of the object itself.

View 4 Replies

ActionScript 3.0 :: Set Current Frame Based On Mouse X Position?

Mar 26, 2009

I am attempting to create 360 degree spin-around product viewer. So far I have a movie clip with 24 frames, each one with a different 15 degree angle shot of the product. Upon playback of the movie, the product appears 3D, spinning 360 degrees.

That was the easy part. Now what I need is to be able to click and drag the product to change which view you are seeing (or which frame in the mc you are on) thus producing a spinning effect. How can you code, in AS3.0, that when the mouse is clicked and drug, go to a certain frame based on the current X position of the mouse?

View 21 Replies

ActionScript 2.0 :: Scrolling Background Based On Mouse Position?

Dec 19, 2005

where i can find a script to attach to a movie/background image so that i can make the movie clip pan left or right based on the mouse position (with easing too!)? Example http:[url].... make sure you enter the site thats where you will see what i mean. I've been wanting to create a page like this for some time using png files and transperency and multiple layers.

View 9 Replies

ActionScript 3.0 :: Quick Calculation Based On The Mouse Position?

Jun 16, 2009

I have am wanting to do a quick calculation based on the mouse position.here is what I am trying to do.I have an item the site on the stage

stage.width = 400;
object.width = 900;
object.x needs to be at its most -900 and at its least -225.

and based on the mouse position on the stage object will scroll within these bounds.I have all the functional done but just need to know the basic equation to find these points.

View 3 Replies

IDE :: Ball - Globe Rotation Based On Mouse Position

Nov 30, 2009

I have created a globe that rotates with no problem, but what I am trying to do is to control the direction of the rotation based on the mouse position. For example, if the mouse is to the right of the globe, it rotates towards the right and if the mouse in on the left, the globe rotates left. When the mouse is over the globe, it should stop.

View 1 Replies

ActionScript 3.0 :: Control A MC Position Based On Mouse Point?

Jan 20, 2011

I am trying to make an animation where the user can mouse over a small MC at the top of the stage, which controls the movement of another larger MC at the bottom of the stage.I am thinking that 'points' (which I know nothing about) might be the way to go. The other thing is that it needs to be fluid motion. Am I at least on the right track with points and mouse_move or is there a better approach for this?

View 2 Replies

Thumbnail(S) Move On Mouse Position?

Jun 10, 2010

i want to make my thumbnails move opposite of where the mouse is.so for example, if i move the mouse up the thumbnail moves down, if i move the mouse left, the thumbnail goes right etc...im trying to google this but i dont even know what its called so im not getting good results, or rather TOO many varied results lol. i was told on another forum that its called parallax menu or something like that but when i research it, i get millions of pages refering to this type of effect (they have other that move vert/horiz too)

View 5 Replies

ActionScript 2.0 :: Moving Movie Clip Based On Mouse Position?

Aug 11, 2009

I'm creating a slideshow gallery in flash and am basically there now except for one bit...

have a look here [URL]

The slider at the bottom for the thumbnails moves ok but I want it to stop at the last slide. I

I can manage to code it based on the mc's _x value

i.e if (mc._x < -200){ //do nothing }

but this creates a dead stop and I want a gently slow down like if you were to navigate from thumb 8 back to 1.

all of my coding at the moment uses the mc's x value in relation to the mouse's distance.

The code I have currently set on the slider is:

Code:
onClipEvent (enterFrame) {
if((_root.slidesQTY>6)&&(_root._ymouse>460)){
if(this._x<0){

[Code]....

how I could add another if statement that doesn't halt the animation as it hits the last slide but creates a smooth slow down?

View 0 Replies

ActionScript 2.0 :: Animated Links That Activate Based On Mouse Position

Feb 27, 2010

I have been racking my brain trying to figure this out for some time. I have some animated links that activate based on mouse position. The problem is when you whip the mouse over them quickly and it leaves the dimensions of the project, flash thinks the mouse is still there and the links continue their animation. IT IS EXTREMELY FRUSTRATING!! I have a feeling its a simple fix but i cant figure it out. here is the site - [URL] the actionscript is below...probably the most round about way ever devised.

[CODE].....

View 0 Replies

ActionScript 2.0 :: Move Stage With Mouse Position?

May 27, 2010

I can't get his to work like it works on this site...http:[url].....

View 9 Replies

ActionScript 2.0 :: Move Stage With Mouse Position

Jun 6, 2010

I want to move the bg with mouse movement and use this code.

Code:
leftMouse = mask_mc._x;
rightMouse = mask_mc._x + mask_mc._width;
topMouse = mask_mc._y;

[Code].....

There are two movie clip one is mc and another one is mask_mc. I made the Registration point for both the movie clips to the left and tested locally and it seems OK when I am in the left edge, top edge or any edge the background is not visible and after that I uploaded to look how it goes. But I can see the background when the mouse is at the edges. How can i adjust the same?

My mask has a size of 1024 x 768 and the mc has a size of 1250 x 940.

View 8 Replies

ActionScript 3.0 :: Item Move On Mouse Position?

Jun 2, 2010

i want to make my thumbnails move opposite of where the mouse is. so for example, if i move the mouse up the thumbnail moves down, if i move the mouse left, the thumbnail goes right etc...

im trying to google this but i dont even know what its called so im not getting good results, or rather TOO many varied results lol.

what this function is called?

View 14 Replies

Flash :: Center Movieclip At Mouse Position

Oct 22, 2011

I am using Action Script 3.0 to animate an instance (MovieClip class) to follow the mouse positron the thing is, the left corner of the instance follows the mouse courser. Now there is a cross on the to left corner and my guess would be that the mouse follows that cross, but i can not change the position of the cross within the instance/ original object. Does anyone know how to make the center of that instance follow the mouse cursor?

View 2 Replies

Flash :: Center Movieclip At Mouse Position?

Oct 9, 2008

am using Action Script 3.0 to animate an instance (MovieClip class) to follow the mouse positron the thing is, the left corner of the instance follows the mouse courser. Now there is a cross on the to left corner and my guess would be that the mouse follows that cross,but i can not change the position of the cross within the instance/ original object.Does anyone know how to make the center of that instance follow the mouse cursor?

View 2 Replies

ActionScript 3.0 :: Draw Motion Guide/path For A Mouse Position Based Movement?

Mar 22, 2011

Is it possible to draw motion guide/path for a mouse position based movement?

For example if I have path the is like letter H. I would need to write many clauses/conditions for the borders of the movement. It would be a LOT easier if there would be some solution that makes the object always to stay on the defined path when moving..

View 2 Replies

Flash :: Ease Rotation And Position Of MovieClip To Mouse?

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

ActionScript 2.0 :: Make A Movieclip In Flash That Makes Buttons Spin Around A Point Depending On The Mouse Position?

Oct 9, 2007

I have recently followed a tutorial to make a movieclip in flash that makes buttons spin around a point depending on the mouse position. I have made my own version off this and would like to use it in a full flash website that i am making at the moment.

The only problem that i am having is with aligning this clip and as it is made up of script i cant physicly drag it to were i want it. I understand how to alighn this with x/y positioning but when i preview the flash in a web browser it is positioned correctly but then when i 'full screen' the browser this clip jumps about 4 inches down the page.

View 1 Replies

ActionScript 3.0 :: Move MovieClip Position When Button Clicked

May 22, 2010

I have a simple arrangement where a movieclip moves to a new x y position when a button is clicked. I want the movieclip to slowly move or 'glide' there instead of jumping straight to the new position.

Heres the code..
btn_up.addEventListener(MouseEvent.CLICK, moveUp) ;
function moveUp(event:MouseEvent):void {{
allcontent.x += 200;
allcontent.y += 200;
}}

View 1 Replies

ActionScript 2.0 :: Script That Makes A Movieclip Move To A Certain X Position?

Nov 9, 2005

I'm looking for a script that makes a movieclip move to a certain x position (_x = -563) and when it reach that x position it should jump back to its original position (_x = 0 and start moving again to _x = -563

View 2 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved