ActionScript 3.0 :: Defining Rotation (pivot) Point
Sep 11, 2008I am rotating some objects which their rotation (pivot) point is not at the center. My aim is to rotate from the center of the shape. How can I overcome this?
View 1 RepliesI am rotating some objects which their rotation (pivot) point is not at the center. My aim is to rotate from the center of the shape. How can I overcome this?
View 1 RepliesI am trying to rotate a symbol about the y-axis, 45 degrees one direction, then back to center, then 45 degrees the other direction. Seems like a relatively simple task, except here is what happens.
Here is the object with no rotation:
Here is the object rotated exactly 45 degrees:
And here is the object rotated exactly -45 degrees:
I need the object to rotate the same as it did the first time but in reverse, otherwise "45" and "-45" are generally worthless numbers to refer to. Is it something to do with the pivot point? I made sure the registration point was in the center when I created the symbol. It doesn't seem to be pivoting the object around the center though. How do I rotate about the y-axis using a pivot point that is actually in the center and gives the same (but opposite) effect when rotating it one way versus the other?
I have a problem with Gradient in AS3. There is a scene with Rectangle created with lineTo():
graphics.moveTo(p1.x, p1.y);
graphics.lineTo(p2.x, p2.y);
graphics.lineTo(p3.x, p3.y);
[code]....
I am trying to have a flashlight follow the mouse from it's pivot point. Rotating from its registration point, 180 degree rotation. Also have it move back to place if the mouse is off stage.
View 1 RepliesHow do you change the Pivot point for a graphic on MX 2004? It defaults to the middle and I need it on the end of the graphic.
View 3 RepliesHow do i change the skeleton's pivot point to hip?? "reset Transformation point" doesnt doin it!!
View 6 Repliesi have the follow issue :
I have a point which is setted at the border on a component, with changed transform point to the center of a component in order to match the component rotation.
the important part is when i try to get the point XY after rotation - they remains the same as before rotation.
how to get XY, after rotation ( changeing point.rotation property to specific degrees of rotaion )
Flash knows where the anchor point is in 3D space in order for the symbol to rotate around it, but I can't seem to figure out how to see the coordinates of the anchor point or type in new ones. Please tell me how to do this. I am already very annoyed that Lynda, a pay service, doesn't think this is vital information. Apparently they think we would never want to do anything more visually stimulating than one simple spinning logo! But I digress...
Just to be clear, I know how to move the anchor point visually on the stage, but I want accuracy. I want to be able to give two symbols the exact same coordinates to rotate around.
Im using A
Code:
function enterFrameHandler(event:Event):void
{
[code]........
I am new in action script 3... i am not able to rotate movie clip from center point(movile clip is a containear holding many clips).
View 9 RepliesI have encountered a need to build what amount to classic boardgame spinner.
1. When you click on the spinner it spins clockwise
2. There are several places where it can stop.
When the user clicks the spinner I run a method to determine where (what target) it should stop on.
How can I make the spinner spin a few times, decrease in speed (ease) then stop at a certain angle?
i'm working on a flash game at the moment, and i would like to know if i am able to set the point that the movieclip rotates around using actionscript.
i don't want to do it by simply moving all of the contents of the movieclip closer or nearer. is there any other way of doing it? i couldn't find any simple functions for it. am i just going to have to use some complicated maths?
[edit] rotation point, aka, registration point.[/edit]
I am making a 'simple' template builder in flash which allows the user to add/remove text boxes and images to the stage.
I can rotate any of the movieClips fine but it rotates from the top left and i want it to rotate from midpoint. Is there a way to set the midpoint/rotation point using actionscript?
I have the following problem. I have an MovieClip in a holder MC. I would like to turn the inner MC X with 'rotation' parameter, and still keep it in the holder mc to the right and bottom of the holder MC reference point. So after turning it should look like thatanyone can tell me how to do that? Basically a function that takes any X rotated in any degrees through X.rotation = ... and puts it back in place in the holder MC.
View 3 RepliesHas anyone got a bit of code I can use to change the center point DisplayObjects rotate around in a 3D space? I need it to work with rotationX, rotationY and rotationZ. I know theres a workaround of wrapping every object in aother sprite and offsetting the x & y positions but I'd much prefer a math solution. As an example of the problem, this code should make a star shape:
[Code]...
I'm attempting to write a racing game. I've loaded in my image, I brought it to the stage and now, all I want to do is rotate it from its' center and not upper left corner.
The code:
racer.rotation += 5;
rotates from the upper left corner. How do I rotate from the center of the car/sprite? I've tried putting it into a container but I'm unsure on the coordinates of the container because I tried to set the x,y coordinates to half the sprite image but y'know, it's not doing what I expect it to.
ActionScript Code:
if (arrowLeft) {
var container:Sprite = new Sprite();
[Code]....
I will never sneer at another racing game! I didn't think it would be this hard to do a simple rotate of an image!
greetings, first of all sorry for my english. This question will probably looks more difficult than it is.
I have movieclip which I want to rotate around internal point few angles with click on certain button, and I manage to do it, but I want to see motion, or even put ease not only to immediately pop up in the place.
Code:
import flash.geom.Matrix;
import fl.motion.*;
[Code]...
I am creating a a small site with a spinning menu but I want it to spin only in onedirection ( clockwise) and around the centre of the 3 point cross I am using as a menu.I have this currently to rotate the menu but I want it to only rotate on way and around centre.
Code:
content_mc.draw_btn.addEventListener(MouseEvent.CLICK,drawClick);
function drawClick(e:MouseEvent):void{
[code]....
I want to have arm movement such as the forearm rotating about the arm where the elbow should be the problem is the registration point is at the shoulder for arm. I want the forearms registration to be constantly equal to a simulated registration point where the elbow should be as the arms registration point would be at the shoulder. I need to do it without nesting (a movieclip within another) is it possible. I tried using a constant distant between the two clips but it doesn't work. Don't know I have to use trigonometry or not
I think in brief what I trying to accomplish is
onEnterFrame=function(){
arm._x=shoulder._x
arm._y=shoulder._y
arm._x=simulated_x (where elbow would be)
arm._y=simulated_y (where elbow would be)
}
I have a project on the go which has a compass that I would like to have move randomly around a fixed central point (giving the idea of changing direction).Would anyone be able to help me out with the coding to get this to work?
View 1 RepliesI draw a shape,like follows:
var shape1:Shape;
shape1=draw();
addChild(shape1);
shape1.rotation=50;
[Code]....
Then I want to rotate the shape at it's center point(200,202) by using shape1.rotation=50,but I find the shape don't rotate at the the center of it's shape. How to realize the function which make shape rotate at its center point?
I'm trying to convert a Sprite that I have into BitmapData so I can perform some collision detection. There are a few things about the way the Sprites are used that is making this more difficult than I expected:
The Sprite itself is a container which holds another Sprite that actually has a box drawn in it. The inner Sprite is positioned negative half its width & height so that it can be rotated from the center via the container. The container may be rotated at any angle at any given time
So my approach thus far has been attempting to draw the outer Sprite onto a new BitmapData object with a Matrix to account for the difference. Whilst I can use a Matrix to make this work for one particular rotation angle, I cannot find a way to make it work for any rotation.
Here's what I'm doing to draw onto the new BitmapData:
var p:Product = getProduct(); // Product is the container with the inner sprite
var bounds:Rectangle = p.getBounds(stage);
var bd:BitmapData = new BitmapData(bounds.width, bounds.height, true, 0x00FFFFFF);
[Code]....
Translating by the same amount as the previous example will no longer work here, and the box will still be cut off. I've looked around at some solutions posted before or suggestions from other people but they don't seem to work for me due to my container Sprite and rotation.
As in the figure i have three lines out of which line1 and line2 are fixed. line3 is derived from line1 based on some angle say 70.I try to rotate the line3 but it deviate from the point x1 and x2. I try the code like this
[Code]...
how I can count the B point's coordinates (see attached image... or not as I am a new user...pf!). I know the arrow's rotation - so the angle (let's say it is -120), A's coordinates (0, 0) - A is the middle point of the arrow, and that the distance between A and B is 50 px.
View 1 RepliesHow do you determine the "rotation point" (axis?) of an object?
A sprite/movieclip that has been loaded using a Loader has its rotation point set to the upper-left corner. What I want to know if how I manually (using ActionScript) set it to the center.
am using Flash CS3 Professional and I have a Flash ActionScript 2.0 .fla file, my problem is that I have 2 symbols, on can be controlled by a simple script using arrow keys and the other is stationary but I want to attach the stationary one to the other so that it can pivot on this connection and will move with and pivot like a tail as it moves around the screen
View 4 Replies[URL]..why it's impossible to me to center the pivot of this container? if I do container3D.centerPivot() all my cubes are moved from they're position and still the pivot it's not in the center, but at the center of just ONE cube (the last on the bottom-right corner). How can I center the pivot of the container properly to ITS center?
View 2 RepliesI want to capture the header click event and on click , i want to split the columns ,by adding the AdvancedDatgridColumnGroup dynamicaly at each level. capturing the header click event. I want to explore the advanced datagrid option more.
<mx:AdvancedDataGrid x="6" y="4" id="adg0" designViewDataType="flat" width="947" height="357" click="summaryViewStack.selectedIndex = 1" fontFamily="Verdana" fontSize="10">
[Code].....
Looking for some ideas, strategies, tools, etc. on creating reports from Flash Builder / Flex 4. I have a flex application that allows create/read/update/delete of client information from a back-end database. It uses web services (zend amf -> mongo db or mysql). I already have the client data IN flex via the web service as a collection for example. A user requests the ability to generate a report - to display a list of clients under a certain age in a tabular excel style grid (datagrid most likely).
It will be sorted and subtotaled by a demographic such as "insurance type". Ideally the user would like to be able to select the insurance types allowed on the report (or in the datagrid/pivot table). I know one option would be to present the user with a series of check boxes or a multi-select list to choose the insurance types. Then, present them with a data grid or advanced data grid component to display the 'report'. What other techniques, options or components are available / have people used?
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