ActionScript 3.0 :: Rotation For MovieClip Always Off?

Dec 23, 2010

So I've found numerous tutorials on rotating to face the mouse, and none of the rotation equations work properly for me. I made my own that worked but then it just over complicated things such as bullet direction.
Code:
var radians:Number =Math.atan2(mouseY-ME.y,mouseX-ME.x)
var degrees:Number = (radians/Math.PI)*180;
ME.rotation=degrees;
That is the only code that changes the rotation of my movieclip. and it always seems to be about 45 degrees behind my mouse?

View 3 Replies


Similar Posts:


ActionScript 2.0 :: Pause Rotation On Rollover Of A Movieclip And Restart Rotation On Rollout Of The Movieclip

Oct 3, 2006

I'm trying to pause my rotation on rollover of a movieclip and restart rotation on rollout of the movieclip. Here is my current code,

[Code]...

View 1 Replies

ActionScript 3.0 :: Move A Movieclip Towards Its Rotation?

Dec 10, 2010

Basically, what I'm trying to accomplish is moving a movieclip towards the direction it's facing.I've been scoping around the net for different ideas on how to do it, but I've only found AS2 tuts.

What I've done already is making the movieclip rotate around it's own center when the user presses either the left or the right arrow-key.What I'm now trying to accomplish is to make the movieclip move forward to the direction it is currently facing when the user presses up and vice versa for pressing down.

View 5 Replies

ActionScript 2.0 :: MovieClip Rotation With Acceleration

Apr 12, 2010

How to MovieClip rotation with acceleration?

View 2 Replies

ActionScript 2.0 :: Put Rotation Handles To A Movieclip?

May 22, 2004

I need to put rotation handles to a movieclip. The same way it happens when you rotate an element in editing mode but in the final movie.

View 3 Replies

ActionScript 2.0 :: MovieClip Rotation Point?

Nov 14, 2007

I am making a 'simple' template builder in flash which allows the user to add/remove text boxes and images to the stage.
I can rotate any of the movieClips fine but it rotates from the top left and i want it to rotate from midpoint. Is there a way to set the midpoint/rotation point using actionscript?

View 1 Replies

ActionScript 3.0 :: Moving A Movieclip Towards Its Rotation?

Dec 10, 2010

Basically, what I'm trying to accomplish is moving a movieclip towards the direction it's facing.I've been scoping around the net for different ideas on how to do it, but I've only found AS2 tuts.What I've done already is making the movieclip rotate around it's own center when the user presses either the left or the right arrow-key.What I'm now trying to accomplish is to make the movieclip move forward to the direction it is currently facing when the user presses up and vice versa for pressing down.

View 1 Replies

ActionScript 2.0 :: How To Get Rotation Handles For MovieClip

May 22, 2004

I need to put rotation handles to a movieclip. The same way it happens when you rotate an element in editing mode but in the final movie. How to do that?

View 3 Replies

ActionScript 3 :: Calculating Degrees For MovieClip Rotation

Sep 6, 2011

I've a movieclip representing an arrow (with registration point in its middle). When I click a button, the arrow must point to a certain movieclip on stage. I use this code to execute the Tween:
TweenLite.to(arrow_clip,1,{rotation:degrees});
But I can't understand how to calculate the degrees. I tried the following with no luck:
var degrees =Math.atan2((clip.y-arrow_clip.y),(clip.x-arrow_clip.x))*(180/Math.PI);
I found the following is working but I can't completely understand why:
var degrees = -(Math.atan2(arrow_clip.x-clip.x, arrow_clip.y-clip.y))*(180/Math.PI);

View 3 Replies

Actionscript 3 :: Attaching Movieclip Along A Path With Rotation?

Feb 22, 2012

How could I do: To attach a movieclip (e.g. 'footsteps'), along a path (other movieclip).

That would be within a interval for attaching one movieclip at a time.

I would need rotation, i.e, the footsteps, should rotate according with the path direction.

View 2 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 :: 3D Image Rotation Effect For MovieClip?

Sep 1, 2006

I'm trying to kind of create an effect of 3d with a movie clip that rotates round its centre on all three axis. Is there any way of using just xscale, yscale, and _rotation properties of an image to give this effect (once you know rotation round z axis, y axis and x axis). I know it can be done I just can't get my head round the flipping over. Its ok when its at only one angle like imagine a photo spinning like some spinning doors but as soon as the angle changes is where I'm having problems. This is as far as I've got but its clearly wrong, it shrinks to zero size. Use right up and down arrow keys [URL].

View 4 Replies

ActionScript 3.0 :: Having A Fixed 3d Rotation Center For A Movieclip?

Feb 5, 2011

Is it possible that I can have a fixed 3d rotation center for a movieclip.So if I have two movieclips spaced apart and I have rotated them, they rotate in their own axis rather than based on a single axis.

View 6 Replies

ActionScript 3.0 :: Make A Movieclip Follow Mouse In Rotation?

Apr 29, 2010

I have this code is AS3

Code:
var xMouse = mouseX;
var yMouse = mouseY;

[Code]...

But unfortunately, the ship does not follow mouse rotation. The ship only rotates with respect to the mouse when you move the ship, not when you move the mouse.

View 1 Replies

Professional :: MovieClip Smooth Rotation And Direction Change

May 19, 2010

I want to make a movieclip moves smoothly and when it changes the direction, it can turn smoothly but not a sudden turn, I try out the code below. and the truning is odd:
this.rotation = (Math.atan2(targetY-this.y, targetX-this.x )/Math.PI)*180;

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 :: MovieClip -ve Rotation-Height Is Not Assigning In Flash 8?

Nov 3, 2010

Here i ve create 2 movieClips outer,inner (outer.inner) .Am rotating outer movieClip to 90 degree. and am giving -ve rotation to inner movieclip.Then am loading images.jpg to inner movieclip ans setting width,height. Here height is not changed.ie .,value not taken to assign 4.If i trace am getting Wid:4 Hei:42.5

Code:
outer._rotation += 90;
outer.inner._rotation = -90;

[code].....

View 3 Replies

ActionScript 2.0 :: Load Different MovieClips At Different Points In The Rotation, Instead Of Having The Same MovieClip For All?

Feb 15, 2006

"Rotation Around A Common Center" Tutorial Posted at the following link [URL]I was wondering if there was a way to load different movieClips at Different Points in the rotation, instead of having the same movieClip for all; and if so how?

View 1 Replies

ActionScript 2.0 :: How To Apply Motion Blur To Rotation Of MovieClip

Aug 2, 2006

I want to apply a motion blur to the rotation of a movie clip. I am currently rotating the movie clip 540 degrees via actionscript using the tween class below:
Code:
import mx.transitions.Tween;
import mx.transitions.easing.*;
var targetRotate:Tween = new Tween(_root.target_mc, "_rotation", Regular.easeInOut, 0, 540, 3, true);
[Code] .....
This seems to be a good start, but I need to change it to apply to the _rotation of my movie clip. Lets say for the sake of argument, my movie clip has an instance name of target_mc as well.

View 1 Replies

ActionScript 2.0 :: Determining A Nested Movieclip's Global Rotation?

Feb 25, 2007

Is there a simple way of determining a nested movieclip's global rotation?I have several nested movieclips that need to know what their rotation is to the main stage.

View 1 Replies

ActionScript 2.0 :: Drag And Drop Rotation - Plank MovieClip

Mar 10, 2009

I've been making a drag and drop by using the following code:
Code:
plank0_mc.onPress = function() {
startDrag(this);
this.gotoAndStop(2);
//this._rotation = 33;
};
plank0_mc.onRelease = plank0_mc.onReleaseOutside=function () {
StopDrag(this);
}

It works fine apart from the rotation - when it rotates the movieclip the mouse can technically no longer be on the plank anymore. And the mouse is dragging the plank but is not actually on the graphic. Is there any way of snapping the mouse to the centre of the movieclip no matter where they click?

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 3.0 :: Rotation Center Is In Left Of The Image - Aren't 3D Rotation From Transform Panel

Jan 7, 2010

I have a movieclip and when I do 3D rotation from Transform panel, It rotates perfect, center is in the middle of image, and when I apply mc.rotationY, rotation center is in left of the image, aren't 3D rotation from Transform panel and mc.rotationY from AS same? what's up?

View 2 Replies

Actionscript 3 :: Augmented Reality Flartoolkit Rotation - Trace The Rotation Of The Marker

Mar 23, 2011

I'm trying to do some augmented reality projects with flartoolkit . I can now put simple 3d objects on my marker and it works fine , but I wanna give my project some events that the user can interact with. I'm trying to trace the rotation of the marker. there's a container:DisplayObject3D which my application uses to add the 3d objects , I traced this :"trace(container.rotationZ)" but it's just returning 0 . I studied another AR application's source code and it was using the rotation of it's container object without problem .and I think I should mention that I'm using the exercise file of seb lee delisle papervision3d course from [URL]. anyone has any experience with flartoolkit? the main functions of my my code is as below:

[Code]...

View 1 Replies

ActionScript 3.0 :: 3D Rotation Of Nested Movieclips, Separate Of Parent Rotation?

Aug 11, 2010

Is it possible to have the child movieclip rotate separate of the  rotation  properties assigned to the parent? so ultimately giving the  child  element it's own axis?I've customized Lee Brimelows (gotoandlearn.com) 3D carousel to spin  on  the x axis to make it a vertical carousel. I've also rotated that by 45 degrees on the y axis to see all the items, and wrote a snippet of   code to hide the left portion of the carousel. The entire  carousel is contained within the 'container' movieclip, and  inside of  that are my carousel items (as seen below), with the larger  item being  the item in focus.

On rollover of the item in focus, I want to rotate it so it faces the   viewer (as seen below),basically removing the 45 degree rotation   applied to the container.The problem i'm running into is when you rotate the container (changing   the rotationX of the container), the axis basically rotates with it, so   when i rollover the next item 'in focus', the following happens..(in  the  example where it appears how it want it to, the carousel is at a   rotationX of 0, so it works fine)

View 2 Replies

ActionScript 3.0 :: Motion Editor Not Showing Rotation X Or Y For MovieClip Symbol In CS4

Nov 30, 2009

I'm just now trying the Motion Editor for the first time in CS4 Professional. I've created a shape, converted it to a symbol, done an Insert Motion Tween, and brought up the Motion Editor. I'm looking for Rotation X and Rotation Y, but only see Rotation Z. My Publish Settings are Flash Player 10, ActionScript 3.

View 2 Replies

ActionScript 3.0 :: Stop Rotation Of Text Inside Child MovieClip

Oct 1, 2009

I have a movieclip (parent).inside that there are many buttons(movieclips). If click on any button the whole movieclip(parent) should rotate and stop at a point. For each button inside parent movieclip there is textbox. While the parent is rotating the text is also rotating, I don't want that effect. I even converted the textbox to movieclip and tried to make that movieclips rotation=0 but not working.

View 2 Replies

ActionScript 1/2 :: Inconsistent Rotation - 270 Degrees Of Rotation Disappear?

Apr 21, 2009

Program A has a cannon that aims to line up with where-ever the mouse is pointing, in 360 degrees, and fires when the mouse is is clicked. Program B has an eye instead of a cannon that should in theory do similar functions when the capslock key is toggled, but instead only has a 90 degree range of motion from the Right of the eye toward the bottom (quadrant 4 only). Where did the ther 270 degrees of rotation disappear to?

[Code]...

View 4 Replies

ActionScript 2.0 :: Create A 3d Rotation Much Like The Widely Used Carousel Only The Rotation?

Aug 11, 2006

i.m trying to create a 3d rotation much like the widely used carousel only the rotation i desire consist of four upright(90 degrees) movieclips resting on a slanted, 30 degree plane which rotate onEnterFrame or following a tween on a oval like path - then pause for a given number of seconds at the four movieclips positions equal in distance on the plane

function around() {
this._x = Math.cos(this.angle) * radiusX + centerX;
this._y = Math.sin(this.angle) * radiusY + centerY;
var s = this._y /(centerY+radiusY);

[code]....

View 7 Replies

IDE :: Z - Rotation X And Rotation Y Missing In Motion Editor Panel

Feb 23, 2009

Why isn't there the Z, rotation X and rotation Y fields in my motion editor panel?

View 1 Replies







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