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


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

Flash :: Move A Displayobject Based On Another Objects Rotation?

Jan 17, 2010

Ive probably ran into some code like this before. just cant remember where. I have 2 display objects on my stage. One is rotating and the other is positioned 90 degrees from the rotating object. As the object rotates, the other object adjusts its x and y positioning from the rotating object..

If this doesnt make sense, then let me explain what I am trying to do. I have a spaceship in my flash game. this ship has 2 torrets siting on the left and right wing. as the ship turns, the torrets need to remain on the wings.

View 2 Replies

Flex :: Move Efficient Rotation Function Which Can Be Stopped On Demand?

Feb 12, 2011

I have an mxml pie chart, which I would like to rotate slowly prior to a button click, however on click it needs to stop immediately (or at least reasonably quickly) and then the callout labels are introduced with a fade.

I have experiemented with both a timer function to achieve this:

[Code]...

View 1 Replies

ActionScript 2.0 :: Rotate The Line Mc Move Clip In A Counterclockwise Rotation When Scroll The Mouse Wheel Up Instead Of Down .... CCW?

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

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

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 :: 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 :: 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 :: Move The Externally Loaded Content Of A MovieClip To Another MovieClip?

Jul 25, 2011

I load an image into a MovieClip. At a second time I want to move this image to another MovieClip.

View 1 Replies

ActionScript 2.0 :: MC - Make A Movieclip Move Slower At A Certain Place In Movieclip

Mar 13, 2004

I'm trying to make a movieclip move slower at a certent place in my movieclip. This means, that the speed needs to be lowered when e.g. showing af picture. Here is the situation. I have a movieclip running different pictures. E.g. the first runs for 115frames and fades out. Instead of runing 115 frames i want the movieclip to run 5 frames (picture fading in) and the stops or delays for 10sek and then goes to frame 6 from where the picture fades out. Where in the movieclip should i place this Action Script?

View 1 Replies







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