ActionScript 3.0 :: Updating Rotation For Anti-Clockwise

May 19, 2011

I have a function that lets you click on a handle of a movieClip and rotate it. I recently updated my code to make use of Oscar Trelles DynamicMovie class so I could set a registration point in the center of the movieClip. But that has given me problems with being able to rotate the movieClip incrementally in an anti-clockwise manner.

The following code will let me rotate it clockwise, forever and ever. But I'm having a hard time wrapping my head around how to determine if the user user is dragging the mouse counterclockwise. The property mc.rotAng is set in a previous mouseDown event. It stores the previous mouse position, and the incremental angle of rotation is derived from the current mouse position and the old mouse position.

[Code]...

View 2 Replies


Similar Posts:


ActionScript 3.0 :: Rotating Movieclip Clockwise And Anti Clockwise?

Jul 2, 2009

I have a movieclip called view_mc and a button btn_rotate.

I want when the user click and drag btn_rotate button, he can rotate the view_mc movieclip clockwise and anti-clockwise.

I have written a code, but it only rotates the movieclip in clockwise direction:

stage.addEventListener(MouseEvent.MOUSE_DOWN, on_stage_down);
stage.addEventListener(MouseEvent.MOUSE_UP, on_stage_up);
function on_stage_down(e:MouseEvent):void

[Code]....

View 8 Replies

ActionScript 3.0 :: Rotating Movieclip Clockwise And Anti Clockwise

Jul 2, 2009

I have a movieclip called view_mc and a button btn_rotate.

I want when the user click and drag btn_rotate button, he can rotate the view_mc movieclip clockwise and anti-clockwise.

I have written a code, but it only rotates the movieclip in clockwise direction:

ActionScript Code:
stage.addEventListener(MouseEvent.MOUSE_DOWN, on_stage_down);
stage.addEventListener(MouseEvent.MOUSE_UP, on_stage_up);
function on_stage_down(e:MouseEvent):void

[Code]....

View 1 Replies

ActionScript 3.0 :: Determine Clockwise Or Counter-clockwise Rotation?

Nov 9, 2010

I'm writing a class for an instrment and one of the knobs has "snapping" values at X degrees.I have the code to make the knob snap to the set degrees,but I'm having trouble getting it to determine whether it was rotated clockwise or counter-clockwise.Here is the function that makes it rotate and "snap" The majority of the problem is because of the 0/360 and negative values that Flash has when it rotates..
 
In the function:

the _baseMovieClip is the clip that contains a graphic to rotate and "snap" to the degrees.

the _clipToRotate is a movie clip that actually displays the rotation

the _startAngle is the angle the user clicked on the button that triggers rotation

the _rotateObj is a sprite that is drawn when they click that I make visible to show the actual rotation when I'm debugging

the _snapLock is the degrees the knob shold rotate to (10, 15, 30, etc)

private function calculateRotation(event:Event):void [code]....

View 1 Replies

ActionScript 2.0 :: Detecting Clock Wise And Anti Clock Wise Rotation

Apr 3, 2005

can you tell me if it is possible to detect if an object is rotating anti clockwise or not? at present i get x,y co-ords and use the code below to rotate it which is fine. now i could write an if statement to check if rotation is negative or positive but because rotation can be negative and positive when rotating clockwise and anti clockwise this wouldnt work.

[Code]...

View 2 Replies

ActionScript 2.0 :: Detecting Clock Wise And Anti Clock Wise Rotation?

Apr 3, 2005

at present i get x,y co-ords and use the code below to rotate it which is fine. now i could write an if statement to check if rotation is negative or positive but because rotation can be negative and positive when rotating clockwise and anti clockwise this wouldnt work.

Code:
theAngle = Math.atan2(diffy , diffx);
this._rotation = theAngle*360/(2*Math.PI);

[code].....

View 2 Replies

ActionScript 2.0 :: [FMX] Circle Disappear Clockwise?

Feb 27, 2003

Ok, here is my problem, hard to explain tho, but i will do my best.I would like a circle picture to dissappear (or appear) with like a clockwise motion. So basically from twelve oclock i want the circle picture start going away clockwise until it comes to twelve again and the picture would be all gone by then.

View 5 Replies

Rotate An Item Counter Clockwise 1/2 A Time?

Mar 31, 2009

I am sure this is simple, but cannot remember how it is done. I just need to rotate an item counter clockwise 1/2 a time. The rotate option only accepts integers and when I do a motion tween it goes clockwise.

View 1 Replies

ActionScript 3.0 :: Rotate A Movieclip Clockwise And Counterclockwise

Jun 24, 2009

I have 2 movieclips. ro used for rotating and rect the movie that will be rotated.
 
I want when clicking and draging the ro movieclip clockwise or counterclockwise, the rect movieclip is rotated clockwise or counterclockwise respectively.
 
I allow the rect to be rotated according to mouseX and mouseY.
 
but it dose not work as I need.
 
I'd like you to show me a trick to achieve that as I want.
 
Here is the code:
 
var xPo:Number;
var yPo:Number;
ro.addEventListener(MouseEvent.MOUSE_DOWN, mouse_down)
function mouse_down(e:MouseEvent):void

[Code].....

View 2 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 2.0 :: Drawing Squares In A Clockwise Manner, Using DuplicateMovieClip()?

May 4, 2007

one after the other in a clockwise manner, so that they form one big enclosing square. In my script, I have a square called cell_mc that I would like duplicate instances of cell_mc to enclose to form a bounding box. I would like the duplicate instances to be drawn one by one in a clockwise direction:

ActionScript Code:
// Get depth
var depth:Number = this.getNextHighestDepth();

[code]....

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

Adobe Flash CS4 - Making A Circular Arrow Spin Clockwise?

Aug 25, 2009

Adobe Flash CS4 - making a circular arrow spin clockwise

View 6 Replies

ActionScript 3.0 :: Generate A Random Point Moving Clockwise Within A Radius?

Jan 16, 2012

I wish to have a function that will take as input a radius value and a magnitude value.

It will return firstly a point (x,y) and also secondly a direction, (vx,vy) which will have a certain magnitude(speed).

The point returned will be a random point within the radius value and the direction will be a a (vx,xy) that moves the point perpendicular to the line segment (x,y) ->(centrepoint).

View 9 Replies

Flash :: Make A Counter Clockwise Circle Using Senocular's Path Class?

Feb 20, 2011

how to make a counter clockwise circle using Senocular's Path class?

For example, if I start a half-circle on the left (9 o'clock) it will go to 6 o'clock then 3 o'clock. Right now it goes for 9 o'clock to 12 then 3.

Works great clockwise... but I can't get it to draw in the other direction. I tried messing with the math inside the class and it exploded!

Here is a link to his source file: [URL]

View 1 Replies

ActionScript 3.0 :: Rotate An Object (mc) Clockwise Or Anticlockwise Depending On The Value Of A Variable Called 'angle'?

Aug 31, 2009

Essentially I'm just trying to rotate an object (mc) clockwise or anticlockwise depending on the value of a variable called 'angle'.If 'angle' is positive it should go anticlockwise.If 'angle' is negative it should go clockwise.

Option 1

PHP Code:

if(angle > 0) {
mc.rotation += rotateIncrement;
}

[code]....

View 3 Replies

ActionScript 2.0 :: Spin An Object In Clockwise And Anticlockwise Direction With Ease Via Press Of A Button?

Jul 16, 2009

i would like spin an object in clockwise and anticlockwise direction with ease via press of a button.tried using,

on (press) {
this.testmovieclip._rotation += 45;
}

just to get the object to turn... What i wanna do is have 4 buttons, 1st button turns the object 45 degrees, then 2nd button turns it next 45 degrees and so on... Have attached .fla of what im trying to achieve.

View 5 Replies

Actionscript 3.0 :: Rotation X Rotation Y Don't Show?

Oct 8, 2009

I am watching the tutorial on the motion editor and when he opens the motion editor to edit the Rotation X and Rotation Y values I'm in trouble.My motion editor now only shows Rotation Z but, no Rotation X or Rotation Y. What am I doing wrong?

View 1 Replies

ActionScript 3.0 :: 3D - Rotation Via MatrixTransformer - Do A "pseudo 3D" Rotation Of A Movie Clip

Dec 2, 2008

I am trying to do a simple "pseudo 3D" rotation of a movie clip. The clip would "flip" on to the screen. I have created the effect using PaperVision3D, however, the final SWF is about 64k and my project requires a smaller file size. I tried to create the flip effect manually by creating skewed versions of the clip and tweening between them, except this doesn't work because the shape is not tweaked along the vanishing point as it should be. It looks like perhaps I could accomplish what I want to do using the MatrixTransformer but I've not had much luck so far.

View 3 Replies

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

Anti-Aliased HTMLText And Styling With CSS

Jun 23, 2010

I basically have the same question as bder on the actionscript forums, namely if I can have my text anti-aliased if it is using an embedded font (Myriad Pro) to assign it to the htmlText property of a TextField and styling that with CSS. Everything works fine with the text embedding and styling (the font is the one I want, and all its variations - bold, italic - are shown correctly), except that it looks bad, i.e. not anti-aliased. Of course, I have tried setting the antyAliasType and gridFitType properties to all possible combinations.

View 2 Replies

Flex :: Anti-alias An Image In It?

Jun 7, 2009

I have a Flex component with a background image. The image is sharp in the beginning, but is jagged whenever I scale the component using scaleX and scaleY. How would I make the image anti-alias so that, it it's scaled to 0.75, the lines are smooth, not jaggedy?

View 2 Replies

ActionScript 3.0 :: Get Text To Be Anti-aliased

Oct 8, 2009

I am loading an external HTML file that is being styled with a css = new StyleSheet() in Flash. The only problem is that the text is not crisp, it is aliased. How can I get the text to be anti-aliased. Since I cannot use AntiAliasType.ADVANCED or shapness for more control, since I am using an external css styleSheet, I am stumped. What the heck can I do?

View 4 Replies

ActionScript 3.0 :: If I Rotate An Image 10 Deg Then That Moves An Image 10 Deg Clockwise From 0?

Apr 19, 2011

I have rotated an image around 0,0 using the code below. I need the new coordinates of the corners of the rotated image.

bitmap.rotation=_angle;

UPDATE: if i rotate an image 10 deg then that moves an image 10 deg clockwise from 0,0

the bottom left corner was 0,20 and so i need to change the point (0,20) 10 deg clockwise using trig?

View 1 Replies

Professional :: Anti-alias For Readability On A Component?

Mar 3, 2007

I have a font embedded for a List component. It displays the text anti-aliased, but I would really like to have Flash display the text in the component as "anti-alias for readability," .

View 6 Replies

Use Embedded Font Anti Aliasing In A Movie

Aug 7, 2009

i am trying to use an embed font in a movie. while editing, everything looks great but when i publish to swf, the text displays pixelized and rough, as no the anti-aliasing is not applied. any tips on how to correct this? i imported the font properly to my working library and set the linkage to "export to actionscript". I also noticed that when i do not import the font to library, the font displays just fine..

View 5 Replies







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