ActionScript 3.0 :: Rotating Circle In Both Directions Using Buttons

Oct 20, 2010

What I have is a circle image (for this purpose lets say it looks like a clock). For example: when you click 3 o'clock, the whole clock needs to rotate around with the 3 o'clock btn at the 6 o'clock position (with the pivot point in the centre). each of the 'time' positions (2 o'clock, 3 o'clock, 4 o'clock ...etc) needs to be a button and thus be able to rotate around to the 6 o'clock position. This would seem simple enough by just using a .rotate value or using tween movieclips...however the tricky part is:

The actionscript needs to determine which way the clock turns (anti/clockwise), dependant on where the clicked time-btn's position is. it needs to be some sort of if statement that says: If (3'oclock-btn) is positioned between 0 degrees (being original 12'oclock position) and 180 degrees (original 6 o'clock position), then rotate clockwise to the 6 o'clock position. If the (3o'clock btn) is positioned between 180degrees and 259 degrees (12 o'clock position), rotate anti-clockwise to the 6'oclock position.

View 3 Replies


Similar Posts:


ActionScript 3.0 :: Rotating Circle - Controlling Movement Left And Right By Buttons

Aug 3, 2009

I have a big circle with buildings all around the edge. There are two buttons that should control it. One to rotate the circle left, and one to rotate the circle right. I'd like each click of a button to rotate the circle and have it stop on a building, which then would activate an animation of the building.

View 4 Replies

Rotating Images In A Circle?

Jun 22, 2009

I have been given the task to create something similar to the flash navigation on the link below. I have tried googling things such as "flash image rotation", "flash rotation circle", etc?[URL]

View 1 Replies

ActionScript 3.0 :: Rotating Circle By Mouse?

Jan 31, 2010

I have been working on this and thinking about it for days but I just can't seem to get it right. I want to have a circle that I can "pick up" with the mouse and then rotate (with the rotation point in the center). Currently I have done this with the following code:


PHP Code:

 var radians = Math.atan2(mouseY-circle.y, mouseX-circle.x); var degrees = Math.round((radians*180/Math.PI));  circle.rotation = degrees + 90; 

I have added a mouse listener for movement to the circle mc and then checked if a button was down. On button down this code would be executed on enter frame. This code works but the main problem is that I want to be able to "pick the circle up" at any angle and rotate it. If I pick it up with this code the circle automatically rotates to 90 degrees.

View 14 Replies

ActionScript 3.0 :: Rotating Circle From Center With Mouse/

Jan 31, 2010

I have been working on this and thinking about it for days but I just can't seem to get it right. I want to have a circle that I can "pick up" with the mouse and then rotate (with the rotation point in the center). Currently I have done this with the following code:

PHP Code:

var radians = Math.atan2(mouseY-circle.y, mouseX-circle.x);
var degrees = Math.round((radians*180/Math.PI));
circle.rotation = degrees + 90;

I have added a mouse listener for movement to the circle mc and then checked if a button was down. On button down this code would be executed on enter frame. This code works but the main problem is that I want to be able to "pick the circle up" at any angle and rotate it. If I pick it up with this code the circle automatically rotates to 90 degrees.

View 1 Replies

Professional :: Looping A Rotating Circle Without Wobbling

Apr 6, 2011

I try to make a looping rotating circle but I have wobbling during the rotation. It seem that the problem come from Flash. I tried manually on the timeline, by the code... but no results. I would expect a PERFECT circle! Here is an example of my result: [URl] You can download the .fla here:[URL] The circle is 2000px*2000px, center is -1000px*-1000px I believe this one also displays the problem in another way: [URL]

View 8 Replies

ActionScript 2.0 :: Rotating Circle On Clicking Its Part

Feb 19, 2010

I need to make it so that when I click part of a circle, it'll rotate to show that bit at the bottom of the circle. I have managed to make this work for the first time you click, but beyond that it doesn't. My file is attached..

View 2 Replies

ActionScript 3.0 :: Rotating Arrow And Circle Definition

Oct 4, 2010

I'm currently working on a school project, where we have an arrow turning 360 degree around it's own center point. In the background there's a circle, which has been splitted up in 8 parts. The actionscript is as following:

Frame 1:
var vinkel:Number = 0;

Frame 2:
import flash.media.Sound;
stop();
//En timer der opdatere hvert 1/1000 sekund
var timer:Timer = new Timer(1);
omdr_txt.text = "Omdrejninger: " + vinkel;
[Code] .....

So it randomly turns a few rounds (usually between 2 and 3 rounds). Then when it, for instance stops at 15 degrees, or 1,05 rounds, then it will automatically go to a specific frame which has been defined for that interval (radius 0-15 for instance).

View 3 Replies

ActionScript 3.0 :: Circle Menu Not Rotating Properly

Oct 26, 2010

I am trying to create a circle menu like the link below by searching through net I found some of the menus but not the exact one. Am attaching the menu which was created by me. The menu is not rotating properly. Link : [URL]

View 0 Replies

ActionScript 3.0 :: Rotating Multiple Objects And Every Circle Around It

Nov 17, 2011

I have an idea of a game in my head and I wan't to get somekind of functional demo of it done in flash (CS3). I've looked everywhere but couldn't find tutorial for it, as I'm not sure what I'm looking for. I'm not that good in Actionscript. I'm now trying to describe this problem. On screen there's 4 rectangles, 2 in a row. So it's 2 rows with 2 rectangles in each. between all of them theres 4 circles. If I activate a rectangle with mouse and use arrow keys to rotate it smoothly 90 degrees, 2 nearest circles rotate with it. And same thing happens with all of the rectangles.

So I'm looking for somekind of solution where rotating an object also rotates every circle around it. and when circle rotates 90 degrees with rectangle as it's center point, it can be also rotated with another rectangle. I think I can't explain this clearly?

View 3 Replies

ActionScript 3.0 :: Rotating A Circle To A Specific Point

Mar 6, 2009

What I'm trying to do is make a dial-type of interface, where you click on a point on the edge of a circle and that point will rotate to another point at the top of the circle. What I can't figure out is how the make "Point B" rotate to "Point A", where "Point A" is always fixed at the top of the circle and "Point B" (and Point C and Point D, etc...) are located along different points on the edge of the circle. I'm using the tween function to rotate, so what I need to figure out is how to get the difference in the rotation between the two points.

View 7 Replies

ActionScript 3.0 :: Rotating Point Around Center Of Circle

Mar 9, 2009

I am trying to rotate some points around the center of the circle(0,0), however I'm getting weird values from the output. I've commented the problem code..

Code:
var r:Number = 10;//radius
var y:Number;
var x:Number;
var a:Number = 90;//angle of which the semi-circle is facing.. could be a random angle.
var ax:Number;//rotated points
[Code] .....

I am using the semicircle in BitmapData collision checking with getPixel(), with a moving circle...

View 1 Replies

Professional :: Looping A Rotating Circle Without Wobbling?

Aug 27, 2004

I try to make a looping rotating circle but I have wobbling during the rotation. It seem that the problem come from Flash. I tried manually on the timeline, by the code... but no results.I would expect a PERFECT circle ![URL]The circle is 2000px*2000px, center is -1000px*-1000px

View 6 Replies

ActionScript 2.0 :: Rotating Draggable Point About Circumference Of Circle?

Mar 25, 2007

How to make a point rotate about the circumference of a circle upon dragging. How do I go about doing it? Is there something to do with the
startDrag(...); ?
From what I have right now, I can move the point but not on the circumference of the circle.

View 3 Replies

ActionScript 2.0 :: Rotating Circle Around Its Centerpoint Slowly Forth / Back

Aug 29, 2003

I am still quite new to AS. I'd like to rotate a circle (compass_mc) around its centerpoint slowly forth/back with +/- 45 degree...or better with random degree. As file size is important, I can not solve it with MotionTween. Up to this time I applied this code to the MC, which endlessly rotates it:
iranytu_mc.onEnterFrame = function(){
this._rotation+=1;
}
How to apply that sort of random slow forth/back rotation to the circle with AS?

View 4 Replies

ActionScript 2.0 :: Rotating Images Connected To Buttons

Mar 2, 2010

I want to create the same effect that is on this website: [URL]. There are four links below the rotating images. when you mouse over each button the image changes. It changes over top of the previous one. When I create this effect, it seems to jump back to the background and then it fades to the image. I want the image to fade over top of whatever image is already there.

I tried using loadMovie and have each image load on top of the other level but the only problem is that once a movie is loaded on top of another you can't call that previous image up again. It's like once you load level 10 over level 5 then level 5 can't be seen again until you refresh the page. Is there a way to just tell it to loadMovie over the current level without actually calling that level?

View 1 Replies

ActionScript 2.0 :: Rotating Menu Made Up Of A Few Buttons?

Apr 19, 2004

I have a circular rotating menu made up of a few buttons. When the mouse rolls over the a button in the movie clip (rotating menu) it stops. My question is how do I apply easing to it, here is the actionscript I applied to the buttons:

on (rollOver) {
stop();
}
on (rollOut) {[code].....

View 10 Replies

ActionScript 2.0 :: .rotate Circle With Buttons, Change Direction?

Oct 20, 2010

what i have is a circle image (for this purpose lets say it looks like a clock). For example: when you click 3 o'clock, the whole clock needs to rotate around with the 3 o'clock btn at the 6 o'clock position (with the pivot point in the centre). each of the 'time' positions (2 o'clock, 3 o'clock, 4 o'clock ...etc) needs to be a button and thus be able to rotate around to the 6 o'clock position.This would seem simple enough by just using a.rotate value or using tween movieclips...however the tricky part is:the actionscript needs to determine which way the clock turns (anti/clockwise), dependant on where the clicked time-btn's position is. it needs to be some sort of if statement that says:if (3'oclock-btn) is positioned between 0 degrees (being original 12'oclock position) and 180 degrees (original 6 o'clock position), then rotate clockwise to the 6 o'clock position. If the (3o'clock btn) is positioned between 180degrees and 259 degrees (12 o'clock position), rotate anti-clockwise to the 6'oclock position.

View 5 Replies

ActionScript 2.0 :: Tween Distance Of The MCs-buttons Around Resizable Circle

Oct 10, 2005

I am trying to tween distance of the MCs-buttons around resizable circle... Distance should be always the same whatever the circle size is... The circle is also tweening its size... I set up some things, [URL]

View 6 Replies

ActionScript 2.0 :: Buttons Dont Work In Rotating Wheel?

Aug 3, 2009

I am editing an existing application that has three sets of wheels that spin. inside each each wheel are buttons that lead to a second movie layer.this second movie layer is on rollover and on release to show information.after wheel has spun twice the button actions inside the wheel still work but they are the wrong actions for each button symbol..........
prior to the wheel spinning it makes a calculation in a form.would i use movieclips as button symbols? ..

View 2 Replies

Actionscript 3 :: Flex: Rotating Buttons And Changing Focus

Aug 26, 2010

I've got a problem with rotated buttons in Flex. They seem to contaminate other components' focus rectangles. Take the following source code, which couldn't be much simpler:

[Code]....

Now execute it. Click in the text area, the focus rectangle is correct. Press tab twice, the focus rectangle aroung the TextArea is rotated! Is there a fix for this, or should I avoid rotating buttons altogether? I'm using Flex SDK 3.5.

View 2 Replies

ActionScript 2.0 :: Rotating Menu - Buttons To Bring The Content Up

Jan 11, 2009

if u click on all the buttons it will bring the content up but i only want one of the buttons to bring the content up. the experiments buttons should bring the content up... i send you the fla file?

View 4 Replies

ActionScript 3.0 :: Create A Rotating Banner With Buttons And Hyperlinks?

Dec 2, 2009

I'm trying to create a rotating banner with buttons and hyperlinks... I create previous/next buttons for the banners, but I want the "Previous" on the first banner to revert to the last banner... and the "Next" button on the last banner to revert to the first banner.

I uploaded the .FLA : [URL]

View 1 Replies

ActionScript 3.0 :: Create A Rotating Planet - Add Buttons Or Other Interactive Objects?

Jul 26, 2010

I've created a sphere, and used a texture of Earth to create a rotating planet (using movie material). Is it possible to add buttons or other interactive objects to the material itself that will be clickable?Is there any other method for doing this (for example if I want something to happen when the user clicks on Australia...)

View 5 Replies

ActionScript 2.0 :: 3D Flower Interface - Change The Circle To Movie Clips/buttons?

Sep 24, 2005

I've been recently asked to do an interface from this file(view the attached file). The file was from ultrashock, anyway my client wants the interface to appear instead of the circles. Is there any easy way to change the circle to movie clips/buttons? I would also like to have the 3d flower rotated randomly after being selected and the interface will zoom into the selected link and the sublink will pop up from the selected link.I've been told by my friend that it requires XML but I think there's gotta be an easier way.

View 1 Replies

ActionScript 2.0 :: 3D Rotating Menu - Make The MC-s Cklickable=working As A Buttons With Mouseover / Mouseout Effects

Sep 18, 2007

I have downloaded the following code and tried to change it. It works so far, but the attached MC are "pulsating" - if I change them with another MC (with text inside) I can't use them as a Menu links - they are "pulsating" too much and I can't read/see the text properly. where in code I can change(reduce) this "pulsation"? how can I make the MC-s cklickable=working as a buttons with mouseover/mouseout effects (changing color etc.)

View 1 Replies

ActionScript 2.0 :: Calculate The Direction And Speed A Circle Has After Colliding With A Static (non-moving) Circle?

Mar 8, 2005

I'm developing a game atm, and I need some help on the mathematics/coding of colliding circles (and their change in x/y speed). What i need to know is how to calculate the direction and speed a circle has after colliding with a static (non-moving) circle. I know how to detect a collision between the two, but I'm not sure about the maths I need to give the circle the right speed and direction after the collision

If i do know how far away the two circle-points (in the middle of each) are to each other (in both x and y coords) would it be easy for me to find the new speed and direction of the large circle in the example above? I know that I somehow should use the angles to pretend the circle hits a flat "wall" (as it only hits one point), and then calculate the new speed/direction. My only problem is that I'm not sure how to decide the angle of this flat "wall" and how x and y speeds should change when colliding with a wall that is angled. Does anyone here have any insight, links or tips on how I can du this?

View 6 Replies

ActionScript 2.0 :: Make One Circle Follow The Mouse Cursor Inside Another Circle

Sep 30, 2005

i want to make one circle follow the mouse cursor, inside another circle. Similar to an eye looking at the cursor. Ive attached an example.

View 4 Replies

ActionScript 2.0 :: If Statement / Variable - Say If Circle Shows Up Change It To Circle (french)

Nov 5, 2008

I have text in a dynamic field showing up as circle. I want to say if circle shows up change it to cercle (french).

[Code]...

View 1 Replies

ActionScript 2.0 :: Calculate Direction And Speed Circle Has After Colliding With A Static Circle?

Mar 8, 2005

What i need to know is how to calculate the direction and speed a circle has after colliding with a static (non-moving) circle. I know how to detect a collision between the two, but I'm not sure about the maths I need to give the circle the right speed and direction after the collision.If i do know how far away the two circle-points (in the middle of each) are to each other (in both x and y coords) would it be easy for me to find the new speed and direction of the large circle in the example above? I know that I somehow should use the angles to pretend the circle hits a flat "wall" (as it only hits one point), and then calculate the new speed/direction. My only problem is that I'm not sure how to decide the angle of this flat "wall" and how x and y speeds should change when colliding with a wall that is angled.

View 6 Replies







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