ActionScript 2.0 :: Rotate Wheel To Specific Position?

Nov 1, 2006

I have searched the forum and could not find anything specific, so if you do, please show me the link. Let me set some theoretic environment for the question. let's take a circle that is like an anolog clock but only has 8 numbers; 12 o'clock, somewhere around 1:30, 3 o'clock, 4:30, 6, and so on.

I want to have each number, a button, and when clicked will rotate to the top of the circle.NOTE this is a static image, so the numbers will upside down, etc...the do not need to stay rightside up, as they will rotate with the circle image.

Every time a number is clicked, it will rotate the circle until that number is at the top, and can move either left or right depending on which number is clicked. I thought of doing this in design time, but there are many combinations, and it would be too weighty.

I do not know how to rotate it in actionscript and then have it stop at a certain position, which I assume I could plan out in degrees, and possibly use flags to tell which had been clicked in which position,

View 3 Replies


Similar Posts:


ActionScript 3.0 :: Rotate Wheel 90 Degrees With Button Click?

Mar 30, 2009

Flash CS3 Actionscript 3.0

Most of them have been random "wheel of fortune" type projects and those get me close, but most of them are in AS 2.0 and don't hit exactly what Im looking for.

So here is what I need:

A wheel with 4 sections and a button.

When you press the button, the Wheel rotates 90 degrees, easing into the rotation and easing out of the rotation.

Sounds simple right? Well, I got the easing part down and the code i have is designed to rotate 180 degrees. However, the trouble is that, my wheel code only works once, and only rotates the wheel once. Im having trouble making the code keep track of the wheel position and rotate from the position that it left off at.

Ultimately what will happen is, each of the 4 sections will trigger a sound loop. So each of the 4 sections will also have a hitTest function, but that is not my concern right now. I just want the rotation mechanism down pat. Here is my messy, overcomplicated code for your consideration (again, designed to rotate 180 degrees for simplicity but I need 90 degrees):

var i:int = .01;
var s:int = 10;
//add event listener for my_btn
my_btn.addEventListener(MouseEvent.CLICK, wheelRotate);

[Code].....

View 11 Replies

ActionScript 2.0 :: Drag / Rotate Functionality For Navigation Wheel?

Jul 19, 2009

I'm trying to create a navigation system that relies on the user dragging on a wheel in order to rotate it into a specific position: [URL]. The problem I have is that whenever a drag is initiated, the wheel jumps to a position where it points the zero-rotation point (indicated in the example by the red dashline) at the mouse direction. Whenever the drag is ended, the wheel stays at the position where the mouse has left it, which is correct.

However, when another drag is initiated, the same thing reoccurs - the dashed red line jumps to point towards the direction of the mouse. In short, I need the wheel to drag/rotate directly from the position where it was previously left or where it is by default. It shouldn't matter from which position the user drags the wheel. The code is located in the script of the wheel-movieClip, and is as follows:

Code:
onClipEvent (enterFrame){
this.onPress = function(){
// when the mouse presses on the wheel
this.onMouseMove = function(){
// get an angle to the mouse using atan2 (gets radians)
var angle = Math.atan2(this._parent._ymouse-this._y,this._parent._xmouse-this._x);
[Code] .....

How to implement it so that the wheel rotation is independent from the position of mouse, while it is dragged.

View 2 Replies

ActionScript 2.0 :: Drag/rotate Functionality For A Navigation Wheel?

Jul 19, 2009

I'm trying to create a navigation system that relies on the user dragging on a wheel in order to rotate it into a specific position:

[URL]

The problem I have is that whenever a drag is initiated, the wheel jumps to a position where it points the zero-rotation point (indicated in the example by the red dashline) at the mouse direction. Whenever the drag is ended, the wheel stays at the position where the mouse has left it, which is correct. However, when another drag is initiated, the same thing reoccurs - the dashed red line jumps to point towards the direction of the mouse. In short, I need the wheel to drag/rotate directly from the position where it was previously left or where it is by default. It shouldn't matter from which position the user drags the wheel.

The code is located in the script of the wheel-movieClip, and is as follows:

ActionScript Code:
onClipEvent (enterFrame){
this.onPress = function(){
// when the mouse presses on the wheel

[code]....

I can see how lacking the code is, and I can see why it does what it does. I just can't figure out how to implement it so that the wheel rotation is independent from the position of mouse, while it is dragged.

View 5 Replies

Flex :: Rotate MXML Component Round Its Center Like A Wheel Respectfully To Mouse?

Jun 16, 2010

So I have that panel or any other mxml component. I want somehow to rotate it around like a wheel of a car with which you drive it... loke a Racing wheel... sow like when mousebutton is down it captures pont of component... when you move mouse component rotates (not moves) according to new mouse position... How to rotate MXML component round its center like a wheel respectfully to mouse?

View 2 Replies

ActionScript 2.0 :: Make A Wheel Graphic Rotate A Certain Number Of Degrees To Loop The Animation?

Nov 12, 2002

I 'm a Flash novice trying to make a wheel graphic rotate a certain number of degrees using Actionscript to loop the animation, and use an if/else statement to check if the rotation is true. I cannot get it to work.

View 11 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 2.0 :: Position Of Rotating Wheel Starts Mc?

Oct 25, 2010

I have a wheel with info on it in pie shaped areas, the user can turn the wheel to any position. What I need to do is have movie clips play when the wheel is at a certain rotation, depending on where the wheel is turned different clips would play off to the side

View 2 Replies

Rotate An "angled" Wheel/circle In Flash?

May 16, 2011

Is there an easy way to rotate an "angled" wheel/circle in flash? I played around with the 3D Rotate tool and nothing seemed to do what i wanted.

Attached is an image below that shows a quick mockup of the type of wheel I am going to use. I want to show the lines rotating around the circle.

[URL]

View 3 Replies

ActionScript 3.0 :: Rotate On Drag Not Mouse Position?

Feb 24, 2009

i have some script that creates a rotating video wall/carousel effect that rotates left and right depending on where the mouse is.I want the carousel to only rotate when the mouse is down and dragging - but just can't seem to work out what i need to change.how do I define the drag action instead of the current +x & -x co-ordinates?here is the full script for the entire carousel

Code:
*/
import org.papervision3d.scenes.*;
import org.papervision3d.cameras.*;

[code]....

View 4 Replies

ActionScript 3.0 :: Rotate From Current Position - Papervision 3D

Dec 9, 2011

So what I'm trying to do is rotate from the current position the model is in.

I know the basic stuff like this:

[Code]....

But now the model jumps to the rotationY according to the mouseX (which is obvious because you can read it in the code ) But I don't know how to change this to use currentYRotation.

View 11 Replies

Actionscript 3 :: Rotate Movieclip On Different Axis On Mouse Position?

Mar 27, 2011

I am looking for direction to this old UFC effect - [URL] that appears on the main page. It is movieclips rotating on different axis based on the mouse position. So far I have found this script:

stage.addEventListener(MouseEvent.MOUSE_MOVE,EnterFrame);
function EnterFrame(e:Event)
{
mc.rotation = (180*Math.atan2(mouseY-mc.y,mouseX-mc.x))/Math.PI + 90;
}

But this only rotates on x and y. What's a way to approach this effect?

View 1 Replies

ActionScript 2.0 :: Controlling Movie Clip Like Sclae , Rotate, Position?

May 22, 2007

I have started a project for a t-shirt store with a similar featurescan any one tell me how he is controlling the designs and text rotation and scaling inside the target area

View 2 Replies

ActionScript 2.0 :: Having A Movie Clip Rotate Back To Its Original Position

Feb 27, 2010

I created a movie clip, an aircraft compass which rotates till the button is pressed but I would like it to return back to its original position in opposite direction of smooth rotation and stop. I already have the following script on the clip.

onClipEvent(enterframe) {
if(spin) {
_rotation -= 2;

[Code]....

View 2 Replies

ActionScript 2.0 :: Rotate A Symbol In A Continuous Full 360 Degree At One Position?

Sep 5, 2002

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?

View 8 Replies

ActionScript 1/2 :: Focus On Mouse Position When Zooming Movie Clip Using Mouse Wheel?

Oct 29, 2009

I have a map application that when I use the mouse wheel the map will scale up or scale down. The next thing I want to do is to focus on the mouse pointer while zooming on the part of the map.

I have this code...

function focusMousePosition(){    onMouseMove = function (){        Stage.width = _root._xmouse;        Stage.height = _root._ymouse;        updateAfterEvent();    }}
var mouseWheelListener = new Object();var wheelNum:Number;
mouseWheelListener.onMouseWheel = function(wheelNum){    focusMousePosition();    if (wheelNum > 0){        map._xscale *= 0.9;        map._yscale *= 0.9;    }else{        map._xscale *= 1.1;        map._yscale *= 1.1;    }}Mouse.addListener(mouseWheelListener);

View 3 Replies

ActionScript 3.0 :: Zoom To Mouse Position Using Mouse Wheel?

Mar 9, 2010

Code:

addEventListener(MouseEvent.MOUSE_WHEEL,mouseWheel);
function mouseWheel(event:MouseEvent) {
Map.scaleX = Map.scaleX + event.delta*.01;
Map.scaleY = Map.scaleX;
}

The problem with this code is that it scales from the registration point (0,0). Due to the other transformations I'm doing to this image at various times, it isn't possible to move the registration point. The image is larger than the stage and the user is able to drag it around. I want the mouse wheel to zoom in on the place the mouse is hovering over (or at a minimum...the center of the "view" they have...aka the stage)I tried doing this:

Code:
internalPoint = new Point(Map.mouseX, Map.mouseY);
externalPoint = new Point(stage.mouseX, stage.mouseY);
var matrix:Matrix = Map.transform.matrix;

[code]....

Which, incidentally, I'm using that whole portion of code to zoom into the state they will be in when they use the mouse wheel.

View 1 Replies

ActionScript 3.0 :: Wheel Of Fortune Wheel With Momentum

Feb 13, 2012

I have been designing at a professional level for about 5 years now but I am new to flash. I've been tasked with creative a wheel of fortune game in flash, and I am trying to create a script that will make my wheel spin with a blur and then slowly decelerate to a random tile.

[Code]...

View 2 Replies

ActionScript 3.0 :: Load SWF To Specific Y Position?

Jun 25, 2009

I have a SWF loading in right now, however it loads to the stages x:0 and y:0. Here's my code:

function craDone(e:Event):void {
trace("LOAD");
TweenLite.to (portfolioBucket_mc, 0.5, {x:-831, alpha:0, ease:Back.easeIn});
addChild(l);
}

How do I tell it to load to a certain Y position. The x doesn't really matter because x:0 is good.

View 1 Replies

ActionScript 1/2 :: Load An External Swf At A Specific X & Y Position?

Sep 26, 2009

I am trying to load an external swf at a specific x& y pos. from a button. This is the code I am using :

on (release) {gotoAndPlay(4);loadMovie("gallery.swf",1); xpos="7", ypos="119"; 
}

The movie loads fine if I remove xpos="7", ypos="119";How do I get it to load at that specific position?

View 3 Replies

ActionScript 3.0 :: Refer To MovieClip At Specific Position

Apr 1, 2010

How can I refer to an MC that is at a specific position (using frame label) to start playing based on a current event?

View 6 Replies

Flex :: Insert One Vector Into Another At Specific Position?

Sep 21, 2010

What is the most efficient way to insert one Vector into another at specific position?

For example:

var aa:Vector.<int> = Vector.<int>([1, 2, 3]);
var bb:Vector.<int> = Vector.<int>([9, 8, 7]);

This doesn't seems to work:

bb.splice(1, 0, aa);
The result is [9, 0, 8, 7].

View 2 Replies

ActionScript 3.0 :: Tweening Objects To Specific Position?

May 10, 2011

Right now I'm working on a website that has movie clips that I want to tween back and forth across the stage when a button is pressed.

Here's the idea:

When 2_btn is pressed, I want 1_mc, 2_mc, and 3_mc to move from right to left and then stop when 2_mc is positioned on the stage, stop moving and play

Then if 3_btn is pressed I want all three to be animated from right to left until 3_mc is positioned on the stage, stop moving and play

Then if 1_btn is pressed I want all three to move from right to left until 1_mc is positioned on the stage, then stop moving and play

Basically I have no idea how to accomplish this, or how to word it into Google.

What I have right now, which obviously isn't accomplishing what I want is:

Tween from left to right across the timeline, and then using a gotoAndPlay, and then stop(); on the frame..

View 2 Replies

ActionScript 2.0 :: When You Take Your Mouse Away From The File It Returns To A Specific Position?

Jan 15, 2009

I'm doing a flash menu for a site and am stuck with a bit of action script. Below is a link to the swf file. http:[url].........What I am after is for the white bar to follow the mouse when you are over the flash file y axis only (this works on the file), then when you take your mouse away from the file it returns to a specific position.The action I have so far is attached bellow.

onClipEvent (load) {
_y = 20;
speed = 3;[code]...

View 4 Replies

Actionscript 3 :: AddChildAt() To Add Item At Specific Index Position?

May 16, 2011

I have a textBox and I am using it as a mail address input field where the user can type in several addresses, a bit same as in hotmail. Each address is rendered into a clickable button. Thus upon double-clicking on a specific address I want the item to be editable. After having edited the address when the user taps enter, the item is added to the list of mail adds.I am adding it using the code below:

flowBox.addChildAt( myItem, myindex);

However addChildAt seems to add the item as the last item in the list. But I want it to add the item the position where it was originally. Say the item was at position 2 in the mail list, after editing adn tapping enter, it should add at position 2 itself and not at the end of the list.

View 2 Replies

ActionScript 2.0 :: Load Movie When Move To Specific Position

Nov 15, 2009

I'm working on this scroll from tweener [URL]. I've made a button that lets me reach the position I want on the scroll
Code:
this.bout.onRelease = function() {
this._parent.gotoPosition(4);
};

Now I'd like to load a movie when I move to this or that position. Maybe with if?
Code:
this.bout.onRelease = function() {
this._parent.gotoPosition(4);
if (_root.Position=4) {
loadMovieNum("test.swf", 1);
}};
but this doesn't work (it loads the movie alright but not because of the position).

View 1 Replies

ActionScript 3.0 :: Auto-scroll Text To A Specific Position?

Jun 6, 2010

I have a text document which is several pages long and will use scrolling capabilities. This text document will be contained in an external swf. There will be 6 buttons on the main timeline which will all load the external swf with the text document but I would like the text to autoscroll to a specific postion/part of document that relates to that topic/button. Also, i would like the scrollbar to move in relation to position/part of document in case the user stays in the external swf and reads and scrolls through the document. Is this possible? I have searched for a tutorial on this but have found nothing. I have tried different things but nothing has worked.

View 0 Replies

ActionScript 3.0 :: AddChildAt() To Add Item At Specific Index Position?

May 16, 2011

I have a textBox and I am using it as a mail address input field where the user can type in several addresses, a bit same as in hotmail. Each address is rendered into a clickable button. Thus upon double-clicking on a specific address I want the item to be editable. After having edited the address when the user taps enter, the item is added to the list of mail adds.I am adding it using the code below:flowBox.addChildAt( myItem, myindex);However addChildAt seems to add the item as the last item in the list. But I want it to add the item the position where it was originally. Say the item was at position 2 in the mail list, after editing adn tapping enter,

View 2 Replies

ActionScript 2.0 :: Make MC Snap To Specific Position Once Dragged?

Jun 2, 2011

I am creating an exercise to teach the meaning of the word "take". I want draggable objects (MC's) which will automatically snap to a different position when they are dragged a little way.

This is the code I am trying (not mine I'm afraid). I have it on the same frame as the MC in "Actions - movie clip". The MC is draggable but doesn't snap.[code]...

View 3 Replies

Actionscript 3 :: Flex: Move One Object To Specific Position With Animation?

Jul 14, 2011

how to make one object move to a specific point with animation in Actionscript ( not MXML code ) ? ( Flex 4.5 )

View 4 Replies







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