Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    Flash


Actionscript 2.0 :: Rotate Object To Certain Degree Then Stop?

I want to smooth rotate thing_mc a certain amount when home_btn is pressed. Not sure how to do this. Obviously the below doesn't work.

Code: Select allhome_btn.onRelease = function(){
onEnterFrame = function (){
thing_mc._rotation += 5;


View 4 Replies (Posted: Fri Apr 24, 2009 3:55 pm)

Sponsored Links:

Related Forum Messages For Flash category:
Actionscript 3 :: Rotate An Object 360 Degree?
how to rotate an object 360 degree in as3

Posted: Mar 5 10 at 11:32

View 2 Replies!   View Related
Professional :: Rotate In 3D By 360 Degree Both On X And Y Axis
I've got a 3D model at hand, which I have imported as a movie and an image sequence of each frame depending on which is necessary. I basically would want to rotate it by 360 degree both on the x and y axis on a canvas as well as having that done manually, such as having to drag my mouse to control which direction the model rotates in. Can I do this in Flash?

Posted: Feb 8, 2011 3:12 PM

View 5 Replies!   View Related
ActionScript 2.0 :: Rotate MC 1 Degree At A Time For 360 Degrees?
I have a cross shape that on button release I need to rotate clockwise 1 degree at a time for 360 degrees, stopping at each 90 degree point. Then continuing from that point when the button is released again, when the button has been clicked 4 times the cross will have made a complete circle. This needs to be available at all times

The catch is, I also need it to do the exact same thing counter clockwise from the release of another button at all times.

So for example imagine a stopwatch with 60 seconds, when one button is released the second hand starts counting clockwise 1 second at a time til it reaches 15 seconds then it stops.

Then when the same button is clicked again it starts from 15 seconds and goes to 30 seconds and stops, then on to 45 when the button is clicked and so on back to its original state at the 0 second point. Then there is another button that makes it go backwards from wherever it currently is for 15 seconds back.

Posted: July 6th, 2005

View 5 Replies!   View Related
ActionScript 2.0 :: Rotate A Symbol In A Continuous Full 360 Degree At One Position?
i'm trying to create an actionscript where i can rotate a symbol in a continuous full 360 degree at one position. i know it has to do with degree/pi, but i can't come up with the correct formula for it. if i can try to remember, is it 2(pi) for a full rotate? how to put it in the actionscript?

Posted: September 5th, 2002

View 8 Replies!   View Related
ActionScript 3.0 :: Rotate And Stop Rotating An Object
I want to rotate an object using the arrows on the keyboard when the mouse is over the object and it should not be possible to rotate the object when the mouse is not on the object. I know how to rotate the object, when the mouse is over the object, but when I put the mouse outside the object I can still rotate the object. How do I make the rotation stop?


Posted: Oct 4, 2010 7:53 PM

View 4 Replies!   View Related
ActionScript 1/2 :: Rotate On Button Press Or Button Hold 180 Degree
here is my code,


This is running on Enterframe but I want to ratate 180 degree and on button press and hold button

Posted: May 14, 2010 5:04 AM

View 1 Replies!   View Related
ActionScript 3.0 :: Enemy Animation Sequence - Rotate + Move, Then Stop Then Shoot Then Rotate Back And Move Off Screen
I am having some dificulty making a path for this enemy i'm trying to create... cause i want him to rotate + move, then stop, then shoot, then rotate back and move off screen... Its easier if you see it.. you can download the swf file in the zipped archive to demonstrate what i mean. I did it there with tweens. Anyway.. i tried and make it but i'm a little stuck on the stopping part... you can also see what i did in the fla file attatched...

Posted: 08-10-2009, 11:39 AM

View 1 Replies!   View Related
Flash CS5 - Moving Object Around In Circle One Degree At A Time
I have an object called point that I can move around the screen with my mouse. This object has a vector mapped through it (_v1) using the center of the stage and "point"s x,y location in order to draw the vector (note all of this is working fine). My problem is occurring when I set up was a button that simply sets a value to true if you press it. The idea behind this button is that when pressed, whatever location "point" is at, it will move 1 degree clockwise in a circle around the center of the stage (this is all happening in the frameHandler so I can keep clicking the button to make it continue around the stage).

The code I am using is based in an if statement listed below:
if(clockwisePressed) {
var v1angle:Number = _v1.angle;
v1angle++; //increase the angle by 1 degree
if(v1angle>180) {
v1angle -= 360; }
[Code] .....

So what is happening here is that clockwisePressed has been set to true so this fires off. My vector (_v1) is set up to tell me the angle (already converted from radians to degrees) but it's a read-only value. So I assign it (_v1.angle) to v1angle so I can mess with it and increase it by 1 so I'm moving clockwise around the center of the stage. Then I just check to make sure that it falls into a range between -180 and 180 (if I trace _v1.angle around the stage, 0 degrees is to the left, 90 degrees is straight up, 180 degrees is to the right, and -90 is straight down). Now using the formula I derived from this thread but converted to work with 0 degrees pointing to the left and the value for Y going up the further down the stage you go, I came up with

x = centerX - radius * cos(angle)
y = centerY - radius * sin(angle)

Now when I make a sample chart on paper and use these values on my calculator, this works like a charm. If I plug in an angle, the radius, and center I get a point right on my circle I draw on a sheet of graph paper. However, when I actually try this in flash, the "point" jumps all over the stage. (Note that _v1.m is just the magnitude of the vector between the center of the stage and "point" which is the same as the radius). So I trace everything and the values for cos and sin don't seem to be coming out right. For example, if my angle is -1.9581 and I take the cos of that on my calculator I get something along the lines of 0.9994 but flash traces Math.cos(angle) to be -0.3777. Isn't using Math.cos(-1.9581) the same as putting -1.9581 into your calculator and hitting cos?

Below is the corrected code that works:
if(clockwisePressed) {
var v1RadAngle:Number = Math.atan2(_v1.vy, _v1.vx); //get angle in radians
v1RadAngle += 0.0174; //increase the angle by ~1 degree more or less
//Now just move the crosshair and get it ready to be redrawn
point.x = centerX - _v1.m * Math.cos(v1RadAngle); //_v1.m = radius
point.y = centerY - _v1.m * Math.sin(v1RadAngle);
clockwisePressed = false; //remove button pressed boolean

Posted: Aug 2 11 at 7:54

View 1 Replies!   View Related
ActionScript 2.0 :: Grab An Object And Rotate It With An Object Which Is On It Rotating?
how can i grab an object and rotate it with an object which is on it rotating [meaning that the second object is on the same possition on the first object?] can i make it being horizontal all the time?

Posted: October 29th, 2003

View 14 Replies!   View Related
Flash - Slowly Rotate An Object Towards Another Object?
I have an object that points in the direction of another object (i.e. it rotates to the direction that the second objects x and y coordinates are at) below is the code I use.

var distx = target.x - x;
var disty = target.y - y;
var angle:Number = Math.atan2(disty, distx);


as you can see. Not only does it rotate towards the target object, but it also moves towards it too. When I play the movie, the object instantly points to the targeted object and moves towards it. I would like for it to slowly turn towards the object instead of instantly turning towards it.

Posted: Jan 27 10 at 20:48

View 3 Replies!   View Related
ActionScript 3.0 :: How To Rotate An Object
botonDerecho.addEventListener(InteractiveScene3DEvent.OBJECT_PRESS, giraDerecha);
private function giraDerecha(e:InteractiveScene3DEvent):void


Posted: Mar 6, 2011 6:37 AM

View 7 Replies!   View Related
ActionScript 2.0 :: Rotate Object With It?
I am working on a car game in flash where you see the car from a top view and you go straight ahead all the time on an endless road.

The game so far is built in the way that I have a image of a car that's the main car and the road is a image itself that keep switching with another image of the road and when you play it it looks like the car is moving very fast. But actually the car is not moving at all except for when you move it yourself by going right or left.

When turning right I do not want the car to simply move to the right, but I also want it to rotate a bit so it looks more realistic when turning.[code]...

Posted: 10-06-2010, 01:04 PM

View 1 Replies!   View Related
ActionScript 2.0 :: Rotate An Object Using It?
Rotate an object using AS and also control the speed it rotats at?

Posted: September 23rd, 2004

View 4 Replies!   View Related
ActionScript 2.0 :: How To Rotate An Object
I have a project I'm working on that requires a box to be rotated aropund an offset axis by dragging a button in one corner of the box. Most of the scripting for this works great, but there are a few things I can't work out. The box is limited to an up and down position (0 degrees and 90 degrees respectively). This is what I want to happen � when the user drags the box from the up position and releases somewhere between 10 and 80 degrees, the box continues down to the end down position on its own. If it begins on the down position and is released midway, it continues up. For some mathematical reason, my version likes to orient around 50 degrees.

Posted: November 7th, 2002

View 4 Replies!   View Related
Button To Rotate Object In Scene?
i have this code on a button inside a mc:

on (press) {
rotateCWscreen1.onPress = function() {
screen1.onEnterFrame = function() {


Posted: 04-13-2009, 11:36 AM

View 11 Replies!   View Related
Rotate Object Around Center Axis?
I'm using CS3 with ActionScript 3.0. What I want is simple, and I've done some searching but nothing that can get me the right results.I'm going to post a link that does exactly what I want: http:[url]......This rotates the circular object around a center point in a way that you can distort the object yet is still remains turning in a circular motion. A simple motion tween rotating the image will only work if the object is perfectly round, so distorting the object to make it more straight or curved won't work with a simple tween. I want to do exactly what is happening here (with my own object), is there some AS3 behind the scenes here making this turn on a center point?

Posted: 10-04-2010, 03:06 PM

View 3 Replies!   View Related
ActionScript 2.0 :: Code To Rotate An Object?
I have an object that I want to rotate in 3D (letter "Y"). I have some code that I gathered and edited a bit, but right now it rotates at the top left as it's anchor. I'm trying to get it to rotate at the "crux" of the Y (absolute center), so it basically rotates in place.

My second problem is the speed. Ideally it needs to rotate very fast then slow down and stop. Any thoughts on how to either clean up this code to make it work? I could try it with just transforming the shape, but I'm trying to see if it can be cleaner with Actionscript.


Posted: 02-21-2012, 03:38 PM

View 3 Replies!   View Related
Actionscript :: Rotate Object On Drag?
I have an object I need to rotate by clicking and dragging. Following some AS2 code I got the object to rotate a bit every time the mouse is clicked, but can't get it to work with drag.

needle.addEventListener(MouseEvent.MOUSE_DOWN, fl_ClickToDrag_2);
stage.addEventListener(MouseEvent.MOUSE_UP, fl_ReleaseToDrop_2);
function fl_ClickToDrag_2(event:MouseEvent):void


Posted: May 26 11 at 20:46

View 1 Replies!   View Related
ActionScript 2.0 :: Click And Rotate Object?
I have a color wheel with a triangle inside. I want the user to click and drag the triangle on its center axis. This way, the triangle shows the user the correct color triad.

I can't even rotate anything.

Posted: 02-12-2009, 05:03 PM

View 3 Replies!   View Related
ActionScript 2.0 :: User To Rotate A 2d Object?
I've done the drag and drop part, The only script left is the furniture rotation like you see on this page:[edited URL to my link]This one uses a rotation this the best way to do it?

Posted: December 11th, 2002

View 14 Replies!   View Related
ActionScript 2.0 :: Make An Object Rotate?
How do i make an object rotate?

Posted: May 21st, 2003

View 2 Replies!   View Related
ActionScript 3.0 :: How To Rotate Isometric Object
I need rotate an isometric object by actionscript.

Posted: April 9th, 2010

View 3 Replies!   View Related
ActionScript 2.0 :: Scale And Rotate An Object?
I know it's possible to scale and rotate an object by using some actionscript. Is it also possible to distort an image?

For example; keep the topleft corner and the bottomleft corner of an object at the same position and put the topright and bottomright corner of the same object 25 pixels down.

Posted: October 11th, 2002

View 14 Replies!   View Related
Have Object Move From Point A To B And Also It Rotate At Certain Points?
When motion tweening is it possible to have an object move from point A to B and also have it rotate at certain points?

Posted: Dec 13, 2009 3:37 PM

View 2 Replies!   View Related
Copyright 2005-08, All rights reserved