ActionScript 3.0 :: Rotation Speed On Mouse Position?

Sep 30, 2009

I have a circle wheel i want to rotate and the speed should be based on the mouse position. I also need to have easing in and out.

When the user hovers over the bottom of the circle it will begin to rotate one way and then th top of the circle would make it rotate the other way. The further to the top or bottom they are the quick it spins. It ideally needs to ease in and out when it starts and stops when the user moves the mouse away.

The circle will be the complete movie so 50% top and bottom each for each direction.

View 1 Replies


Similar Posts:


ActionScript 3.0 :: Using A Carousel Script That Rotates Some Images, The Speed Of The Rotation Depends On Where The Mouse Is On The Screen?

Feb 5, 2010

I'm using a carousel script that rotates some images, the speed of the rotation depends on where the mouse is on the screen. The project I put it into is 962 pixels wide, the carousel itself is about 400 pixels wide, I want it positioned on the right half of the project, so I put the code in a blank movie clip and positioned it on the right.

It works fine, but the problem is the rotation gets crazy fast as the mouse moves to the left side of the stage, because there's so much more space on the left then there is on the right. I only want for it to stop gaining speed when the mouse leaves the carousel area.

Code:

//We use 70x70 sized images (change this if different for your images)
const IMAGE_WIDTH:uint = 70;
const IMAGE_HEIGHT:uint = 70;

[code]....

View 6 Replies

Actionscript 3 :: Calculate The Next Position Of A "enemy" If Know The Positions X, Y, Rotation And Speed?

May 4, 2011

How can I calculate the next position of a "enemy" if know the positions x, y, rotation and speed?

View 1 Replies

ActionScript 3.0 :: Slideshow Speed From Mouse Position?

Apr 24, 2011

I've got a slideshow script that I've been using and I wanted to modify it a bit. I wanted to make it so that the further away from the center the mouse cursor is, the slower the slideshow. The closer to the center of the flash document, the faster it goes.Here's the code I've got thus far:

ActionScript Code:
// import tweener
import caurina.transitions.Tweener;

[code].....

View 0 Replies

Actionscript 3.0 :: Start Rotation At Mouse Position?

May 8, 2009

I'm trying to make a movieclip rotate around it's center (this is no problem since the center will never change). The problem that I am having is when I press the movieclip, in let's say the bottomright corner, and move the mouse the movieclip flips to a certain angle depending on my mouseposition. After the weird flip it works fine but it's the initial mouse click that makes the movieclip flip to an angle.I've tried playing around with different values to substract or add the starting angle but eveytime the result is not what i am looking for.Current code:

Code: Select all
package 
{

[code].....

View 8 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

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 :: Ease Rotation And Position Of MovieClip To Mouse

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

ActionScript 2.0 :: Mouse Position Controls Speed Of Sliding Horiz. Pictures?

Apr 3, 2002

Trying to create (and learn) an effect I see often where a series of photos (side-by-side) will scroll across and when your mouse draws nearer to the centerpoint it slows down enough to be able to click on it.

View 4 Replies

ActionScript 3.0 :: Changing An Objects Diameter Of Rotation Dependant On Position Of Mouse?

Nov 16, 2009

I want the diameter of the 'balls' orbit to change dependant on the position of the mouse but keep the point of rotation exactly the middle of the stage at all times.I.e. if the mouse is hovering over the exact center (both X+Y) of the stage then the 'ball' should have a tiny diameter of rotation (but contstantly follows the orbit in clockwise direction) whilst if you move the mouse towards the edge of the stage then the diameter of the orbit of the ball will increase.Here is the AS which controls a blank movieclip;

var sp:Sprite = new Sprite();
orb1.addChild(sp)
var g: Graphics =sp.graphics

[code]....

View 1 Replies

Actionscript 3 :: Gradually Limit Rotation Of An Object Influenced By Y Position Of Mouse

Nov 23, 2009

I have created a flash app in which there is a circle with circles plotted along it's circumference, it is rotated when the mouse is moved up or down. The rotation is drawn directly from the y position of the mouse pointer. What I would like to do is grade the movement some how so that the further down the mouse pointer goes the less impact on rotation the movement has.

My current code is like this:

myCircle.rotationZ = e.localY;

Is there some form of math formula I could use which would reduce the amount of rotation the greater the y position of the mouse position?

View 4 Replies

ActionScript 3.0 :: Change A Objects Diameter Of Rotation Dependant On Position Of Mouse?

Nov 16, 2009

This is for a personal art project, however I have hit a potential (Actionscript) brick wall! I want the diameter of the 'balls' orbit to change dependant on the position of the mouse but keep the point of rotation exactly the middle of the stage at all times. I.e. if the mouse is hovering over the exact center (both X+Y) of the stage then the 'ball' should have a tiny diameter of rotation (but contstantly follows the orbit in clockwise direction) whilst if you move the mouse towards the edge of the stage then the diameter of the orbit of the ball will increase. Here is the AS which controls a blank movieclip;

[Code]...

View 5 Replies

ActionScript 2.0 :: [FMX] Rotation And Elasticity - The Clip Snaps Directly Back To Its Original Position When The Mouse Leaves The Clip

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

ActionScript 3.0 :: Detecting Mouse Speed And Put Speed Limit?

Sep 20, 2009

How can i detect mouse speed with AS 3.0, and then put speed limit? Also can i use speed var for anything else? *sorry for my bad English, i live in non-english-speaking country*

View 9 Replies

ActionScript 3.0 :: Add The Rotation Speed?

Feb 9, 2011

how i can add the rotation Speed?

my code:

var dx:Number = bs.width-mouseX
var dy:Number = bs.height-mouseY
var dm:Number = Math.atan2(dy,dx)*180/Math.PI

p1.rotation = dm-315 // add 315 i will get the direction i want

but i want my rotation to go faster

View 4 Replies

ActionScript 3.0 :: Rotation And Speed Reaching?

Mar 1, 2011

i have a rectangle named(p1) with w:250 h:400 and a other rectangle named(bs) same width and height , registration point is at the center right. when i click on p1 ,p1 will fellowing my mouse and the p1 rotation is depending on the bs width and height.[code]okise now my intention are , when i release the mouse ,p1 will go move back to the (bs) registration point and on the way to the registration point it will rotation++ to 90 degrees.when reached bs registration point it will become 90 degrees.if my now my p1.rotation is 135, when i release mouse , p1 moved back ,rotation will depend on the distance back and rotation to 90 , like 133 ,125 ,110, 90.

View 6 Replies

ActionScript 3.0 :: Set Random Movement / Rotation And Speed With Array

May 10, 2008

I have a rock movieclip that is in an array and a timed function that places an instance of the rock on the stage every 5 seconds. So every 5 seconds a rock is placed onto the stage. What I want is when a rock is placed onto the stage it rotates either clockwise or anticlockwise. So every 5 seconds a rock appears and it will rotate either clockwise or anitclockwise. I also want the rocks to rotate at a random speed. So every time a rock appears its rotation speed will be different. I also need the rocks to move in a random direction. So every time a rock appears it will travel in a different direction to the previous rock.

View 5 Replies

Professional :: Flash Carousel - Slow The Rotation Speed Down

Mar 1, 2010

I have a flash carousel that works perfectly however it moves too quickly. I am not familiar with flash so I'm curious as to whether or not anyone can tell me how to slow the rotation speed down. If necessary you can download a complete example of my carousel below. Also any of you who want a nice free carousel.

View 4 Replies

ActionScript 3.0 :: Rotation Speed Increases Each Time MOUSE_DOWN

Jul 6, 2009

I'm working on a flash navigation piece for a website that involves a "viewmaster" reel that rotates when you mouse down on a button, and then stops when you mouse up. The problem I'm having is that every succesive time I mouse down, the rotation speed increases. Here is my code:

var timer:Timer = new Timer(30);

paintingRotateBtn.addEventListener(MouseEvent.MOUS E_DOWN, paintingRotate, false, 0, true);
paintingRotateBtn.addEventListener(MouseEvent.MOUS E_UP, paintingRotateStop, false, 0, true);

[Code].....

View 2 Replies

Actionscript 3.0 :: Rotation A Wheel/circle With Mouse (Hold Mouse)?

Apr 19, 2011

i create this code but i cant spinning it with mouse (when i hold it)

Code: Select allmthr.addEventListener(Event.ENTER_FRAME,rotate);

function rotate (e:Event)
{[code]....

View 3 Replies

ActionScript 3.0 :: Calculate Position According To Rotation?

Jun 16, 2011

I have child (1) and I am rotating it by some custom num of degrees. After rotation (2) I want to 'align' this child to left_center side of the parent (should look like 3). Without roration I would set x to 0, but after rotation position of registation point changes.

way to calculate new x/y position based on rotation.

View 6 Replies

ActionScript 2.0 :: MC Movement - Rotation And Position

Apr 24, 2005

I'm having a problem with a little movement script I wrote for a MC I have. I believe it either has to do with variable scoping, or with a coordinate system problem. (If I change the xPos and yPos in the onClipEvent (load) to 0,0...then the MC starts in the middle of the field (MC) I'm trying to move it inside of.) Basically...the ActionScript you see below is a part of the "Player" MC...who is supposed to move around a "field" MC I have.

I was assuming setting xPos and yPos to 0 would have the Player MC starting at the very top left of the entire screen...which instead it starts in the middle of the "field" MC.) Also - When I press the different arrow keys...the Player MC jumps around to different locations...but once at the new location the movement (in a single direction) works okay.

[Code]...

View 11 Replies

ActionScript 2.0 :: MovieClip Movement / Rotation And Position

Apr 24, 2005

I'm having a problem with a little movement script I wrote for a MC I have. I believe it either has to do with variable scoping, or with a coordinate system problem. (If I change the xPos and yPos in the onClipEvent (load) to 0,0...then the MC starts in the middle of the field (MC) I'm trying to move it inside of.) Basically...the ActionScript you see below is a part of the "Player" MC...who is supposed to move around a "field" MC I have.

(I was assuming setting xPos and yPos to 0 would have the Player MC starting at the very top left of the entire screen...which instead it starts in the middle of the "field" MC.) Also - When I press the different arrow keys...the Player MC jumps around to different locations...but once at the new location the movement (in a single direction) works okay. I've attached the .swf.

onClipEvent (load) {
speed = 2;
xPos = 0;
yPos = 0;
this._x = xPos;
this._y = yPos;
[Code] .....

View 11 Replies

ActionScript 2.0 :: Mouse X Position To Control Movie Position?

Feb 1, 2006

Basically the x position of the mouse should control the play position of a movie. Do I need something like an event handler (I'm not sure exactly what these do, but I've seen similar scripts that seem to use them).

View 2 Replies

IDE :: Cursor Position Not Mouse Position In Input Text Box

Nov 12, 2009

I have an Input Text area that users can edit and then submit. I need to be able to show, on screen, the cursor's current position as they type. I don't need to know where the mouse is but all work-arounds I've found so far can only tell me the mouse position. The font for the text is 'courier' or 'courier new' and the Input Text area is scrollable.

View 8 Replies

ActionScript 2.0 :: Tween From One Position To Mouse Position?

Mar 28, 2010

tween from one position to mouse position

View 1 Replies

Actionscript 3 :: Flash: Moving A Movieclip From A Container To Another While Keeping Same Position And Rotation

Feb 22, 2012

I have 2 container MovieClips (mc1, mc2), each of them has a separate x,y, rotation. I want to take a child from mc1 and addChild() it to mc2 while keeping the same x, y, and rotation on the screen so you see the added child mc as if it didnt change position or rotation, just moved to the other MC.

View 3 Replies

ActionScript 1/2 :: Focus On Mouse Position When Zooming Movie Clip Using Mouse Wheel?

Oct 29, 2009

I have a map application that when I use the mouse wheel the map will scale up or scale down. The next thing I want to do is to focus on the mouse pointer while zooming on the part of the map.

I have this code...

function focusMousePosition(){    onMouseMove = function (){        Stage.width = _root._xmouse;        Stage.height = _root._ymouse;        updateAfterEvent();    }}
var mouseWheelListener = new Object();var wheelNum:Number;
mouseWheelListener.onMouseWheel = function(wheelNum){    focusMousePosition();    if (wheelNum > 0){        map._xscale *= 0.9;        map._yscale *= 0.9;    }else{        map._xscale *= 1.1;        map._yscale *= 1.1;    }}Mouse.addListener(mouseWheelListener);

View 3 Replies

Rotation Controlled By Mouse?

Apr 17, 2009

i was wondering if theres a way to link the amount and direction of an objects rotation to the mouse position. I want it so if you move the mouse far to the left the object spins fast anticlockwise but if you move it to the center it stops.

View 2 Replies

ActionScript 3.0 :: Gun Rotation According To Mouse?

Aug 15, 2009

I have done the rotation bit, but now i want to limit the rotation but i can't do it
this is my code -

PHP Code:
stage.addEventListener(Event.ENTER_FRAME, moveArm)
function moveArm(e:Event):void

[code].....

View 2 Replies







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