ActionScript 3.0 :: Custom Rotation Around MouseX/mouseY?

Aug 1, 2009

I have a rectangle on stage with the registration point in the top left and a custom rotation applied.Would it be possible when I click on it that it changes its rotation to 0 but with a rotation center point around mouseX and mouseY ?

View 4 Replies


Similar Posts:


ActionScript 3.0 :: Zoom In On Map Using MouseX And MouseY?

Mar 3, 2010

I am making a map of the united states where I would like the map to pan to that state and then zoom into that state when that state is clicked. I have looked over a lot of tutorials, but they all seem to do a little more then I need. I would have thought it was a simple math equation using the mouseX and mouseY with the stage.stageWidth and stage.stageHeight, but I have no been able to figure out the math.

View 3 Replies

MouseX And MouseY Tracing Multiple Coordinates?

Jul 12, 2010

What I am trying to do here is control a movie clip with the mouse by setting the coordinates of one equal to those of the other. This is the code I have for that movie clip:

Code:
package {
import flash.display.*;
import flash.display.MovieClip;

[Code].....

I get no errors whatsoever from this, but when I test it, I see the movie clip that I'm trying to control move with the general direction of my mouse movements, but completely offset from the mouse. Additionally, the movie clip flashes between four different positions constantly, and the output window traces the following four sets of coordinates even when I keep the mouse in one place:

Mouse Coordinates: 160,-110
Mouse Coordinates: 229,112
Mouse Coordinates: 237,368
Mouse Coordinates: 168,146

I'd like to know why there would be several sets of coordinates even when the mouse is stationary, and what I can do to fix this issue..

View 3 Replies

ActionScript 3.0 :: DisplayObject MouseX, MouseY, ... MouseDown?

Jan 21, 2009

DisplayObject's have MouseX and MouseY getters. This is very helpful sometimes.Is there a way to easily query input state variables such as MouseDown or KeyDown?If not, I suppose I need to add listeners for these events, which is fine.

I am just wondering:why MouseX and MouseY get special treatment without a listener; if there are other getters for input data without listeners that I don't know about in other parts of as3.

View 4 Replies

Actionscript 3 :: MouseX/mouseY Function Equivalent In Cocos2D?

Mar 9, 2012

This might be irritating simple. I am trying to convert some code from actionscript to cocos2d. I am quite new to actionscript and would like to know if there is a cocos2d function for mouseX/mouseY. If not, what would be the equivalent.

View 1 Replies

ActionScript 3.0 :: Offset Value To The MouseX, MouseY Coordinates As Intended, And The Drawing Automatically Stops?

Jan 21, 2011

I need help with this drawing example. The problems I'm having are that the coordinate of the line being drawn always have an offset value to the mouseX, mouseY coordinates as intended, and the drawing automatically stops after a while for no reasons at all. I don't know what's wrong.

Code inside Frame 1 in main FLA:

ActionScript Code:
import flash.display.Sprite;import flash.display.MovieClip;import flash.events.MouseEvent;var art:Sprite;art = new Sprite();var drawing:Boolean;container_mc.addEventListener(MouseEvent.MOUSE_DOWN, prepDraw);container_mc.addEventListener(MouseEvent.MOUSE_MOVE, startDraw);container_mc.addEventListener(MouseEvent.MOUSE_UP,

[Code]...

View 7 Replies

Custom Mouse Pointer Rotation Is Erratic

Nov 8, 2009

I'm not really replacing the mouse cursor exactly. Just placing a custom image of a pointer below it so it will follow the mouse cursor as it moves around the screen. I want this pointer image to move with the mouse and to rotate and point in the direction the mouse is traveling. Simple stuff. The problem is that the rotation of the pointer graphic is not smooth at all. It is jumpy and somewhat erratic particularly at slower mouse speeds. When the mouse is moving quickly the problem seems to go away.

PHP Code:
package {
import flash.display.Sprite;
import flash.events.*;
public class MouseFollower extends Sprite {
private var pointer:Pointer = new Pointer(); // ...a simple triangle mc
[Code] .....

View 2 Replies

ActionScript 3.0 :: MouseY Detection Beyond Stage Boundry?

Jan 21, 2009

I've just started dabbling with AS3 coming from Director. Is there a way to detect the mouse x , y values beyond the edge of the stage? When tracing mouseX, mouseY on enterframe event the values stick at the last position within the stage when the mouse roams beyond the stage boundry.

An vague example of usage would be if you had a big movie clip as a custom cursor, and wanted it to smoothly disappear beyond the stage edge.

View 3 Replies

Flash :: Vertical Scroll Based On MouseY?

Jul 5, 2010

i've to write a simple method, wich allow me to move a movieclip inside another one, like in [URL] (i've to move it in vertical, instead of horizontal).

i've write this simple code but it seems to not work properly..

public function factor():void
{
thumbs.addEventListener(MouseEvent.MOUSE_MOVE, moveSlide);

[Code].....

View 1 Replies

ActionScript 3.0 :: Making A Little Gamewhere On A Certain Point The Comand Mc.y=mouseY?

Mar 21, 2012

I have the problem that i am making a little gamewhere on a certain point the comand mc.y=mouseY is used but further in the program this need to be disabled how can i do that because everything i try the movieclip wil keep following my mouse.

View 2 Replies

ActionScript 3.0 :: Make A Movie Clip Only Visible When The MouseY Is .25 StageY?

Mar 19, 2010

I really need the code to make a movieclip visible only if the mouse is near the bottom of stage.[code]...

View 9 Replies

ActionScript 3.0 :: Make A Movie Clip Play When The MouseY Is Less Than A Percentage Of StageY?

Feb 20, 2010

I have a listener which traces the Y value of mouse:
 
stage.addEventListener(MouseEvent.MOUSE_MOVE,f);
function f(e:MouseEvent){
trace(e.localY);
}
 
I need to make a movie clip play when the localY value is less than .25 of stageY, or even less than 150 would work. 

View 7 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 3.0 :: Multiplying MouseX Value?

May 13, 2011

I have this mc that responds to mouseX , only the mc is very short in frames, it's only 25 frames long. This way the mouseX is only the first 25 pixels of my stage, so it only responds to that. Is there any way I can multiply this value to, let's say, 20 times?

View 1 Replies

Flash :: MouseX Value Changes When Cursor Is Still

Feb 1, 2012

Here is my code:

public function update()
{
//making the character follow the mouse

[Code].....

mouseX isn't being changed by me (and can't be since it's read-only), there isn't any other code in this object since I've only just started with this project.

View 1 Replies

ActionScript 3.0 :: Get Touchpoints Aka MouseX?

Sep 20, 2011

Is it possible to find all touch points that are pressed down, and its x/y properties, like we can with mouseX and mouseY?

View 0 Replies

ActionScript 3.0 :: MouseX In A Class

Sep 10, 2009

[Code]...

if I want to use mouseX and mouseY in my class whats the most effective way to do this?
I know if I extend a class to Sprite for example I get this feature but could I get it with less... I know I could say this also and then I wouldnt need to extend Sprite but I dont know if this is a good idea....

[Code]...

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

ActionScript 3.0 :: Setting Bounderies For Mc Using MouseX?

Jan 12, 2010

I am trying to get a MC to stay within certain boundaries of the stage. I want it to appear as if it was in a rectangle. It moves along the x axis. Think of a paddle in a basic pong game.What this code does is moves the paddleMC to the left coordinate when the mouse is moved, then gets stuck there.Is there any way to set the boundaries for mc on the x axis when controlled by the mouse?here is my code.mcPaddle is the movieclip I'm trying to set the boundaries for.

ActionScript Code:
stage.addEventListener(MouseEvent.MOUSE_MOVE, movePaddle);
function movePaddle(event:MouseEvent):void

[code].....

View 4 Replies

ActionScript 3.0 :: Character In 3D Space Following MouseX

May 27, 2011

I'm a non-3D guy with a 3D problem to solve. I have a character moving around in 3D space (his Z value is fixed, like a 2D side-scroller with 3D graphics). He's supposed to follow the mouse. But because the mouse's Z is not the same as the character's, I obviously can't just set his Z to that of the mouse. I'm pretty sure I need to use the distance between the character and the camera when calculating the character's new X position. But I'm not the mathiest person around, and the wiki article on 3D projection ([URL]) made me a little dizzy. All I know is I need to do the inverse of what that article describes.

I'm not using any 3D engines. I've found posts about certain versions of PaperVision that actually have a method built into the Camera class to do exactly this (Camera.unproject()). I'm going to attempt to dig into that to see if I can pull out the formula that I need. But in the meantime I thought I would pick the brains of you brilliant Kirupians.

View 1 Replies

ActionScript 3.0 :: Moving An Object To MouseX/Y With Delay?

Feb 4, 2011

I have an object that I want to go to the mouse's pointer location when it clicks on a button, but instead of it being instant I want it to have some sort of a delay, like a walking motion. I've got pretty far but I can't get the logic out of it.

ActionScript Code:
game_area.addEventListener(MouseEvent.CLICK, moveCharacter);
// moves the character to the specified click point in a delay

[code]....

View 9 Replies

ActionScript 3.0 :: Flash MouseX When Width Changed

Aug 1, 2011

Not sure if I'm missing sth or is it just a bug. I have a movieclip on stage, it's a simple rectangle drawn with a rect tool (no stroke) I add an event listener to trace out the mouseX, works OK so far. When I increase its width the mouseX traces wrong values. Here's a sample code:

[Code]...

View 3 Replies

ActionScript 3.0 :: CurveTo() With From Mousedown To The MouseX, Mouse Y

Oct 24, 2011

Anybody got a method of drawing a line from the mouse down point to the mouses current position.

But taking into account the direction the mouse is moving in to make the curve look more natural and directional.

This is what i have currently which is basic and rubbish:

catapultLine.graphics.moveTo(startX, startY);
catapultLine.graphics.curveTo(Main.gameStage.mouse X/3, Main.gameStage.mouseY/3,Main.gameStage.mouseX, Main.gameStage.mouseY);

View 14 Replies

Actionscript 3 :: MouseX/Y Confusion When Dragging A Child Of A Container?

May 25, 2011

I've got a grid of images which are added to a imagecontainer(Sprite) in a class. When I click a button, the imagecontainer gets tweened(scaled) to 0.2 Now I would like to start dragging around the images. on mouse-down I add an enterFrame Event:

[Code]...

Unfortunately the image is never on the mouseposition but has a increasing/decreasing offset to the mouse pointer.The alternative, startDrag/stopDrag works perfectly, but I stll need the mouseX/mouseY for placing the image on a grid.I tried also parent.mouseX, no luck with that.Why is this happening? I thought mouseX/mouseY is always depending on the stage-dimension.

View 2 Replies

ActionScript 3.0 :: Change Image Based On MouseX Position?

Apr 13, 2009

Code:
package
{

[code].....

View 3 Replies

ActionScript 3.0 :: Events Handling - Overriding Default MouseX?

Dec 4, 2009

I need to do something and I don't know if it's possible... in a proper way.

1 - I have an FULLSCREEN application that extends to two monitors in a Windows system.
2 - The graphic card is extending the single desktop to the two monitors, so the fullscreen fits everything correctly.
3 - Only one monitor is interactivity-enabled, with an interactive touch-sensitive foil on it, which works great.
4 - The second monitor is interactivity-disabled, it just displays stuff depending on what happens on the first monitor.

The Problem: The interactive foil on the interactivity-enabled monitor responds as if it is the *whole monitor*. But it only covers one monitor!! The *whole monitor*, are the two screens put together. I obviously can't cut the interactive foil in 2, and then stretch the two parts to fill a monitor each... So if one touches beyond 50% of the foil's width, the touch event will actually occur in the second monitor!

A fact for the solution is - if all Mouse Events occur with mouseX divided by 2, everything will work fine! How to make all Mouse Events's mouseX be divided by 2? Is there a way to do that in the core of the actionscript MouseEvents handling?

View 4 Replies







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