Actionscript :: Rotate Rectangle Around An Axis In Flex
Feb 3, 2012I was trying to rotate a group(rectangle) on the bottom right coordinates using flex..
See the image
how to achieve this rotation ?
I was trying to rotate a group(rectangle) on the bottom right coordinates using flex..
See the image
how to achieve this rotation ?
Here s the link what I m trying to achieve
[URL]
I wrote the following code for drawing a rotate rectangle
var s:UIComponent = new UIComponent();
s.graphics.lineStyle(1, 0x0000FF);
s.graphics.drawRect(50, 50, 200, 200);
s.rotation = 30;
template.addChild(s);
Where template is a canvas. Its rotate nicely but the problem is the position is not in right place. i.e. it is not in (50,50) after rotate.
make some kind of Compass and I want to know how I could make the needle spin around its own axis with one of the ends following the mouse pointer. how could I do that?
View 4 RepliesI'm using CS3 with ActionScript 3.0. What I want is simple, and I've done some searching but nothing that can get me the right results.I'm going to post a link that does exactly what I want: http:[url]......This rotates the circular object around a center point in a way that you can distort the object yet is still remains turning in a circular motion. A simple motion tween rotating the image will only work if the object is perfectly round, so distorting the object to make it more straight or curved won't work with a simple tween. I want to do exactly what is happening here (with my own object), is there some AS3 behind the scenes here making this turn on a center point?
View 3 RepliesI've got a 3D model at hand, which I have imported as a movie and an image sequence of each frame depending on which is necessary. I basically would want to rotate it by 360 degree both on the x and y axis on a canvas as well as having that done manually, such as having to drag my mouse to control which direction the model rotates in. Can I do this in Flash?
View 5 RepliesTHere are 3d carousels in Web Sites for displaying image galleries which require that images are rotated in the z axis. My requirement is to do the same but for a complete flash animation so that the flash animation is displayed slightly tilted in the z-axis
The kind of tilt I am talking about is similar to the tilted images in [url]...
My requirement is to play a flash animation inside the image of a mobile phone which is tilted hence to fit the animation inside the screen of the mobile phone image, the animation also needs to be tilted
In the following, the slider sets the rotation angle of a simple Sprite around the Y axis. But the Sprite has a z coordinate set to 200, meaning the sprite is 200px behind the Stage plane. As you rotate it, it seems to rotate around it's own Y axis, not he Stage's y axis 200px in front of it.I would have expected the rectangle at 90 degrees rotation to be edge-on and 200px off to one side of it's original center.
Code:
import fl.controls.Slider;
import fl.events.SliderEvent;
var slider = new Slider();[code].........
I am trying to have a button and text rotate on the 3d X axis. Only when the mouse hovers over the actual button.I also want it to rotate on the center right now it is rotating from the top, I think I picked top left registration, and I'm not sure how to change that if that is the cause.Here is what I have do far:
home_mc.addEventListener(MouseEvent.MOUSE_OVER, rotate3d);
function rotate3d(evt:MouseEvent):void {
home_mc.rotationX += 10
}
I'm not too good with for loops yet and I am guessing that is what I need to mimic the rotation.
i've been working with Senocular's tutorial for 3D scripting : [URL] //great work, by the way I made a drag function for it .. My question is how to change the code to actualy rotate on the z axis of the cube... In his tutorial the cube rotates around the z axis of the stage no matter how other axis are rotated. I think the part of the code that needs to be changed in order to simulate a more realistic rotation on z axis is :
[Code]....
I have the starting point of a rectangle, and the rotation of the line that I would like this rectangle to be parallel to. My initial thought was to create a Rectangle() then rotate it, but there doesn't seem to be an easy method rotate a rectangle. From this rectangle I create I can obviously get the four points, but I need these to be adjusted based on an angle of rotation that I pass it.
View 1 RepliesI am trying to rotate a sphere with the mouse on the x and y axis but the sphere keeps 'roll'ing and flipping it all around.
package {
import flash.display.Sprite;
import flash.events.Event;
import flash.events.MouseEvent;
[code]....
Is it possible at all to have a cube rotate on its Y axis using the Tween class? transitionManager only seems to allow rotation around the z axis.. Is Papervision 3D the only way to achieve this? It seems awfully difficult for a newbie such as myself.
View 1 RepliesI'm using CS3 with ActionScript 3.0. What I want is simple, and I've done some searching but nothing that can get me the right results. I'm going to post a link that does exactly what I want:This rotates the circular object around a center point in a way that you can distort the object yet is still remains turning in a circular motion A simple motion tween rotating the image will only work if the object is perfectly round, so distorting the object to make it more straight or curved won't work with a simple tween. I want to do exactly what is happening here (with my own object), is there some AS3 behind the scenes here making this turn on a center point??
View 5 RepliesI have a mc that I want to continously rotate, I want it to rotate in whatever direction the mouse is from the center of the mc. If the user pulls the mouse out I would like for it to speed up and slow down accordingly.If this is not possible, I wouldnt cry. Any way when the user goes over a desiginated area I would like for the motion to stop until they pull away again.How would I go about doing this.I've seen this thread but don't understand where to attach the script, and I also need the stopping script
View 1 RepliesI want to rotate two images on the y axis. For instance I got two cards, front and back. On EnterFrame I want the rotating movieclip to exchange the front and back cards. I believe I got everything setup I just need help with getting the images to rotate once at that 90 degree angle (you know the angle where we can't see any side of the image/thing rotating?
Thus I'm trying to do something like this but on ENTERFRAME instead of a button click:
[code]...
using CS3 with ActionScript 3.0. What I want is simple, and I've done some searching but nothing that can get me the right results. I'm going to post a link that does exactly what I want:This rotates the circular object around a center point in a way that you can distort the object yet is still remains turning in a circular motion. A simple motion tween rotating the image will only work if the object is perfectly round, so distorting the object to make it more straight or curved won't work with a simple tween. I want to do exactly what is happening here (with my own object), is there some AS3 behind the scenes here making this turn on a center point?
View 3 RepliesI'm trying to make a 3d cube rotate only in the x-axis 90 degrees when you press a button and 90 degrees the other way when you hit another. I have this code to get the 3D:
Code:
// formation of 3D Cube2 starts here
container.getChildAt(0).rotationY = 90;
container.getChildAt(0).x = -75; // move the on of side panel to 75px right;
container.getChildAt(1).rotationY = -90;
container.getChildAt(1).x = 75; // move the on of side panel to 75px left;
[Code] .....
And the cube rotate to one side or to another. But it rotate only a little each time I clicked some of the buttons and I want that the cube rotate 90 degrees with an animated movement. How can I get this?
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?
I am trying to rotate a image using rotationY but it always rotates based off of the left side of the image is there a way to change the rotation point to be the center of the image? Is seems like you should be able to use the transformAround() method but I am having problems finding a example of the transformAround that has to do with images. Does anyone have any examples of how do this or am a going about this the wrong way? What i am trying to do is build a slide show that rotates around and you tap on the images to enlarge.
View 1 RepliesI would like to use a movie clip such as a rim from a car and rotate it on its x axis centered and then move it along the screen according to how much of the screen has loaded.here is what I have so far sorry it may be a little messy:
stop();
//rotate the rim
rim_mc.addEventListener(Event.ENTER_FRAME, rotateRim);
[code]....
NOTES: the function rotateRim works correctly rotating the rim the var xpos provides me with the correct position i would like my X position to be and traces it out perfect upon test if trace is coded for it.
I am trying to rotate a symbol on the x axis mulitple times for an animation I am doing. The problem is everytime I try to do a complete rotation, the symbol rotates fine until I hit 180 degrees, but once I go past that mark, the symbol just starts rotating backwards. Is there a certain way I have to do this in order to get a complete rotation in one direction?
View 1 RepliesThe idea is I have 3x3 containers(Sprites) - each one holds 2 tiles of 2 two images (shown one and unvisible - laying behind) . So there are 9containers and 18 tiles. When I click on the image I get rotation of the containers, and when every container is about 90 degrees, its childs swap each oher. So in result I get second image shown. But unfortunely then, shown image is rotated by 180 degrees, that means its left side is on the right. Pre rotating containers ( of tiles gives total mess, as middle tiles seem to be right, but left side of the image and right doesnt match to rest.So I need to rotate tiles, which are bitmapData - parts of Bitmap. But I can not rotate them - there is no property .rotationY for bitmapData, and I can not use matrix's rotate() method as it traits only angle rotation and not axis rotation.If I rotate by Y axis the bitmap before slicing it to tiles nothing happens, so I guess draw method relies on default Bitmap.
So Q : How can I rotate on Y axis a bitmap to have mirror reflection of the image and then apply it reflected to the as a .bitmapData property and slice it to small pieces.
I have proper code to make objects rotate on an axis adjacent to the mouse. I also have proper code on how to make objects elastically bounce towards a specific x,y coordinate.
So far the code I have is for the object to follow the mouse when clicked. when the mouse is up, the objects (on a rotational axis) wind back to original position.
What I would like to do, is combine the formulas for rotation with the elastic formulas to bounce these objects back into place with rotational movement.
[Code]...
I want to make a dynamically (using Drawing API) drawn ellipse rotate around its axis. It involves a lot of trigonometry which I'm not very good in .
View 7 RepliesI want to make a dynamically (using Drawing API) drawn ellipse rotate around its axis. It involves a lot of trigonometry which I'm not very good in .
View 7 RepliesI'm trying to make a MC rotate on it's axis (registration point)...I want it to rotate both clockwise and counter-clockwise at random speeds and random degrees of rotation. For example...CW fast 90 degrees...then CCW slower for 150 degrees...then CW really fast for 270 degrees...etc..etc..
View 9 RepliesWhen I try to rotate a movie clip along the x-axis on the default stage size (I'm using a basic rectangle right now), the rotation appears just as I expect it to. It "rolls over" with the perspective even on both sides of the rectangle.
When I try to duplicate this in a movie with different dimensions (320x480) and apply the 3D Rotation Tool, the rectangle skews to the left for some reason. (See attached .fla files)
I've tried changing the registration points on the movie clips, I've tried making new files with the "Adjust 3D Perspective Angle to preserve current stage projection" box checked both on and off, and I've tried repositioning the actual Rotation Tool, but I can't figure out what's wrong. Could it have something to do with the stage resizing?!
I'm making a chart where the x-axis needs to have dates and y-axis names. The lenght of the bar is longer when the date is later. But I want to stack multiple bars on eachother. for example This is the code I have so far
<fx:Script>
<![CDATA[
import mx.collections.ArrayCollection;
[code].....
Based on this Adobe multiple axis chart example: [URL]
Then I changed some data values to negative and my axis became not aligned anymore.
how to align vertical axis? Is this another Adobe bug or there is some property that aligns axis?
<?xml version="1.0" encoding="utf-8"?>
<s:Application
minHeight="600"
[Code]...