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


Similar Posts:


ActionScript 3.0 :: Mouse Drag Frame Rotate?

Apr 2, 2009

I have a 40 frame animation that in sequence rotates an image. That I need to add a mouse drag function so I can scrub through the images like here

http:[url].....

View 1 Replies

ActionScript 2.0 :: Rotate Movieclip According To Mouse Direction, Drag

Nov 8, 2007

Is it possible to rotate movieclip, while dragging, according to mouse direction and mouse x, y on that clip.

on the picture the 0, 0 of the mc containing red box is where the lines cross, the mouse point is indicated with cursor and around it is the circle where clip's x and y should be constrained and movieclip should rotate according to mouse movement direction for example: when mouse is moving straight down then the clip's x, y rotates up and stops when its 12 o'clock...

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

Flash :: Javascript - Tracking Mouse Position After Click-and-drag (down-and-move), Even Outside The Stage / Browser?

Feb 17, 2011

What's the correct way to track mouse position, from Adobe Flash, when someone has: Started a drag within the Flash application (a MOUSE_DOWN event), Dragged the mouse outside the app or even the browser window (a MOUSE_MOVE event), and Released the mouse button (a MOUSE_UP event)? For example (imagine Stack Overflow is a Flash application):

Within the app, I'm able to track the mouse X and Y positions with a MOUSE_MOVE event listener, but I lose it when it goes outside of the browser... So, how do I track the position of the mouse no matter where it goes? For a good example, try Google Finance. Try dragging the chart around; it'll still drag around if you move your mouse out of the browser window, and the mouse will be outside of the browser when you release it.

Also, check out KOKO KAKA; If you click on the scrollbar (make the browser window really small) and move outside of the browser window, the scroll bar moves just like a real one would. I believe both only work because the MOUSE_DOWN event "captures" the mouse, allowing the Flash application to track the position of the mouse even when it is outside of the browser.

View 2 Replies

ActionScript 2.0 :: Create An Infinite Menu BUT Navigating Menu From Left To Right Using Drag Rather Than The Position Of The Mouse

Apr 1, 2011

I'm looking to create an infinate menu BUT navigating my menu from left to right using drag rather than the position of the mouse. If there's any links or tutorials around Pleeeeese let me know.

[Code]....

View 4 Replies

ActionScript 2.0 :: [FMX]Drag-to-rotate MC?

Apr 21, 2011

I am having problems with this Flash movie of an draggable, rotatable XML blog. I have got the XML stuff working OK. I'm just having problems making the drag-to-rotate thing work. I want it to be able to be moved around the page like a piece of paper and rotated such.

View 1 Replies

Actionscript :: Rotate Object On Drag?

May 26, 2011

I have an object I need to rotate by clicking and dragging. Following some AS2 code I got the object to rotate a bit every time the mouse is clicked, but can't get it to work with drag.

needle.addEventListener(MouseEvent.MOUSE_DOWN, fl_ClickToDrag_2);
stage.addEventListener(MouseEvent.MOUSE_UP, fl_ReleaseToDrop_2);
function fl_ClickToDrag_2(event:MouseEvent):void

[Code].....

View 1 Replies

ActionScript 3.0 :: Drag And Rotate To MovieClip

Mar 29, 2012

I want functionality of Drag and Rotate to my MovieClip just like this example [URL] Or

View 2 Replies

ActionScript 3.0 :: Drag And Drop - Click On The Image ,one Can Hold Down The Mouse And Drag A Copy?

Nov 13, 2010

I want to have an image and when I click on the image ,one can hold down the mouse and drag a copy to where ever on the stage and when one lets go, one can drag another and another with each copy still being able to be dragged after released.this is what i have but its pretty simple and doesn't work....

stage.addEventListener(MouseEvent.MOUSE_DOWN,makeA Box);
var i:Number = 1; //i will be the total number of boxes
var newBox:myMC = new myMC();[code]....

View 3 Replies

ActionScript 3.0 :: Drag & Rotate & Throw Multiple MCs?

Nov 3, 2010

I am trying to create a drag and throw effect I have most of the effect working correctly but I am wondering how to only move one item at a time and have that thrown unaffected til the friction brings the item to a stop. what happens currently is if an mc is moving and you select another it moves both items.

Code:
var mx0; // Previous Mouse X Position
var my0; // Previous Mouse Y Position
var velocityX = 0; // Velocity in X Direction[code]...................

View 2 Replies

Professional :: Drag Drop And Rotate Object?

Feb 6, 2010

Would like to develop simple (in browser) puzzle games where shapes (such as a puzzle piece shape) can be simultaneously dragged and rotated, then dropped on the screen or canvas. The game mode would be to click and drag the shape or object, while simultaneously rotating the piece using arrow keys  Is this possible in Flash? This simple general activity of simultaneous drag and rotate, then drop, is my intended overallweb site game basis. I'm new to Flash but have developed Windows executables for many years. I'm trying to decide whether to purchase and learn Flash as platform for interactive educational puzzle games running in browser windows.

View 4 Replies

ActionScript 3.0 :: Photo Gallery With Drag And Rotate?

Jul 9, 2009

I've recently downloaded a great gallery from FFILES.COM. Here's the link: [URL]

I want to add in a menu bar at the bottom of the gallery. Meaning to say, all the photos that load up from the XML will be behind the menu bar. I tried with creating a new layer on top of every other things (inserted a rectangle box for testing), but the photos for the gallery comes infront of my rectangle box.

View 5 Replies

ActionScript 3.0 :: Drag And Rotate MovieClip On Click?

Nov 5, 2009

Basically what I am trying to do is have my movie clip rotate/pivot when I press on it, same as the arm on the record player of this [URL]. At the moment, the movie clip rotates according to mouse follow, but I would like to click, drag and rotate so it pivots from one point.

Code:
const TO_DEGREE:Number = 180/Math.PI;
addEventListener(Event.ENTER_FRAME, rotateObject);
var maxRotSpeed:Number = 5;
var rotScale:Number = 0.2;
function rotateObject(e:Event):void {
[Code] .....

View 0 Replies

ActionScript 3.0 :: Drag & Rotate Movieclip From Centre?

Jan 5, 2012

I'm trying to drag & rotate a planet so it spins around with the mouse -instance name: PlayerThe code works really well but it doesn't seem to rotate around the centre, instead it rotates from the top left corner.I'm quite a noob at as3 so I'm not quite sure where I've gone wrong with my code to be able to fix this. Do I need to specify the dimensions of the stage or the planet? I have altered the Stage from the the default 550 x 400 (if this could be the problem).

ActionScript Code:
import flash.events.MouseEvent;
import flash.events.Event;

[code].....

View 2 Replies

ActionScript 2.0 :: Realistic Drag + Rotate MC Around The Stage?

Jun 29, 2007

Been working on this for days and can't quite get it. Place a standard playing card or something similar on your desk in front of you. Lightly press your finger onto a random point on that card and drag it around your desk. See how it rotates towards the direction you are moving and such? I want to simulate that behavior.

View 8 Replies

ActionScript 2.0 :: Photo Gallery With Drag And Rotate

Jul 9, 2009

I want to add in a menu bar at the bottom of the gallery. Meaning to say, all the photos that load up from the XML will be behind the menu bar. I tried with creating a new layer on top of every other things (inserted a rectangle box for testing), but the photos for the gallery comes infront of my rectangle box.

View 2 Replies

IDE :: Drag - Drop And Rotate Selected MovieClip

Oct 14, 2009

Im building a game, where the user has several images as movieclips. He can drag them to an area of the stage, and selecting them, he could rotate it. Does anybody knows some tutorials on hoe to start?

View 2 Replies

ActionScript 3.0 :: Drag And Rotate Function On Mousedown

Mar 15, 2010

I'm trying to create a script that would imitate an old rotary phone dial. I have this script, but need it to function on MOUSE_DOWN:

Code:
handle.addEventListener(MouseEvent.ENTER_FRAME, startRotate);
function startRotate(e:Event):void {
var dx:Number=mouseX-handle.x;
var dy:Number=mouseY-handle.y;
// presupposes position of object to be facing to the right.
var radians:Number=Math.atan2(dy,dx);
handle.rotation=radians*180/Math.PI;
var hR:Number = Math.round(handle.rotation);
rotationA.text = String(hR);
}

Changing the event handler doesn't work. Somehow the MouseDown function should be working like an EnterFrame event, I guess. The condition I want to check is whether or not the handle is at a certain degree angle to stop the dial from rotating.
if (handle.rotation >= 30) {
handle.rotation = ?;
}
Not sure what I need to put in there to stop it from rotating.

View 1 Replies

ActionScript 2.0 :: Drag And Rotate Clock Hands?

Oct 3, 2002

I am stuck at the mo trying to create an interactive clock. I have got it to do everything, I would like the user to be able to drag and rotate the clocks hands clockwise 360 degrees.. ive got the hands to rotate by themselves what do i need to do?

View 5 Replies

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

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

ActionScript 3.0 :: Rotate Parent Mc Without Messing Up Drag Of Child Mc's

Dec 9, 2009

I have built this, drag the various dots.[URL]...%20parent.html I did not use the flash startDrag because it had all sorts of issues. I wanted the dots to be restricted to the stage when dragged. That is any dot CAN leave the stage when it is not the one being dragged. For example make the kite big and drag the red dot, the blue dots are free to leave the stage (marked by outline in the online example) The code I have uses mousemove, and some globalToLocal conversion to keep the dots from leaving the stage area All was well so far.

Now I find out the kite has to be able to rotate! when I simply rotate the kite all of my dragging rules break down. Click the big blue button, each click rotates the kite 5 degrees. Looks OK at first, rotate 30 or 40 degrees and everything breaks down. I know its the globalToLocal limiting, is there a better way? Seems people here have a lot of experience with dragging and rotating in flash. Does anyone see a way to fix what happens, or a whole new way to do the drag.

[Code]......

View 0 Replies

ActionScript 3.0 :: Press And Drag Movieclip To Rotate It Around It's Center

Oct 23, 2010

I have a round movieclip ( like a ring or clock ) and i want to press and drag it to rotate it around it's center ( AS3 ). I tried hundreds of ways but none of them works perfectly. I think i miss something in trigonometry and flash's rotation concept.

View 8 Replies

ActionScript 2.0 :: Drag To Rotate Circle And Ring Independently?

Jun 5, 2005

I have this problem...no worries it is only about ActionScript! I have created two movieclips: one is called "sun_mc" (with a nice smile) and a ring of sunrays (short and long ones) called "ring_mc".the ring is situated around the sun.

The user clicks the sun and drags to rotate it.The user can click the ring to rotate that too.When the sun is rotating...the ring should not be...and vice versa.

I have three problems...

1) I can't get the two mc's to move independently 2) When rotating the mouse position always jumps to a certain point on the movieclip...not the point where you clicked it first 3) The ring is also rotating when the mouse is outside the ring...

What should I do?I tried to obscure a part of the ring_mc with some masking...That didn't work.Should I try hitTest? And how should I do that? That only works with squares doesn't it?

[Code]...

View 2 Replies

ActionScript 2.0 :: Prototype For Drag And Rotate - Double Click?

Dec 7, 2005

okay, so i have a prototype for drag and rotate:

Code:
MovieClip.prototype.drag = function() {
this.i = 0;
this.ease = 10;
this.onPress = function() {

[Code...

now my problems. 1) without the doubleclicking, i need to click once on the movie clip to "activate" it or something, and then click again to drag it. shouldn't it work right away on the onPress event? and 2) i would like to add some doubleclick functionality, but when i try and add a double click, i can trace it, but if i try to do anything with it, the doubleclick functionality seems to be overridden by two single clicks ... logically, because i didn't check for the doubleclick at all in the drag script. i'm not sure where i should add the doubleclick stuff... i've tried putting it a few different places and either i get two single clicks, or my scope is way wrong and i wreck the drag stuff.

View 3 Replies

ActionScript 2.0 :: Rotate A Drag And Drop Object 360 Degrees?

May 16, 2002

I need to rotate a drag and drop object 360 degrees. I've got the drag and drop working fine, but I could only figure out how to rotate it 4 times using the set property and arrow keys on the key board. Is there another action I can use to rotate it 8 times at 45 degree angles, or will I have to use the go to action and make 8 frames for the object? I would like to be able to rotate it by pressing just one key on the key board.

View 2 Replies

ActionScript 2.0 :: Mouse X Position To Control Movie Position?

Feb 1, 2006

Basically the x position of the mouse should control the play position of a movie. Do I need something like an event handler (I'm not sure exactly what these do, but I've seen similar scripts that seem to use them).

View 2 Replies







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