ActionScript 3.0 :: Scale - Rotate Or Translate A Display Object Using Its Transform.matrix
Jun 22, 2011
my problem is that if i scale, rotate or translate a display object using its transform.matrix i am not getting the value in the display object but the transform is happening like displayObject.scaleX or displayObject.scaleY etc. i get this new transform value using the dislayobject? as i am using a matrix transform manager which actually changing the transform matrix of the display object.
View 8 Replies
Similar Posts:
Oct 14, 2010
I found the function:
rotateAroundExternalPoint(m:Matrix, x:Number, y:Number, angleDegrees:Number)
to rotate an object around an external point. The top of the object will always point at the center point which is exactly what I want.
It works fine but its possible to rotate it in an oval instead of in a perfect circle...I think it should be something with the angleDegrees Parameter but im not sure what to do with it. I also tried to set up an own matrix but I failed. Any right direction to orbit an object in an oval, and where the top of the object always point at the rotation center?
View 2 Replies
Mar 25, 2010
I need a very special component written in ActionScript 3. It is a rectangle filled with a bitmap. The bitmap is loaded from an external URL based on some programmed rules. The textured rectangle is then animated using Flash CS. Animation is performed using rotate/translate/scale/skew tools. How to create such a component and add it to Flash CS library?
View 1 Replies
Aug 5, 2010
I am basically trying to create a display object transformation manager which will allow me to scale/rotate objects. I am currently trying to figure out how to rotate an object so its corner follows the current x and y of the mouse. I always get confused on the math of things like this. I know how to listen for the events and everything, I just am unsure of how to calculate the amount of rotation to apply. I will probably be rotating via a Matrix so I can rotate the object around its center, rather than the upper-left corner of it. My question here is: how do I get values when I don't want them constrained, like scaleX and scaleY?
View 1 Replies
Jan 28, 2009
i want to assign a transform matrix to an object, but i want to assign the values myself (as in, no 'rotate, scale etc'), but for example, set a matrix like
[Code]...
which if applied, would have no effect, but would be valid (actually not exactly that matrix, but you get the idea). i want to set the values of the matrix and the object should be affected by those values that i set by myself, no scale rotate or any predefined operations. how can i set my own matrix?
View 4 Replies
Mar 14, 2011
Most often, questions are asked about how to scale a DisplayObject, and the answer is usually to use a Matrix.
My question is, how to you GET the scale of a Matrix (scaleX and scaleY)?
There's a Matrix.scale method to set the scaleX and scaleY, but it doesn't return a value, and no other properties exist to read it back.
The reason I ask, I'm using object burried deep down into a Display list, and each may be transformed. So I use the child object's sprite.transform.concatenatedMatrix getter, but am stuck at this point on how to read the scale from it.
View 2 Replies
Oct 11, 2002
I know it's possible to scale and rotate an object by using some actionscript. Is it also possible to distort an image?
For example; keep the topleft corner and the bottomleft corner of an object at the same position and put the topright and bottomright corner of the same object 25 pixels down.
View 14 Replies
Jan 31, 2010
I am learning AS3 and trying to get an object to be able to move / rotate / scale and drag and drop. I found 2 seperate tutorials one does button clicks to move and rotate code.[code]When I add the second lot of code to the first app (ie add a layer and insert the script ) change myPoint to rocket . I get the following errors:'{' expected
View 1 Replies
Jan 11, 2012
I've been working on an FXG Editor, and I'm using the the senocular transform tool to move, rotate, scale and skew an object.
Is it possible to detect if the the Display object has been skewed just from inspecting the matrix of that DisplayObject? even if said object has been move, scaled and rotated as well.
I want to only serialize the matrix of an object to FXG if has been skewed and not if it has just been rotated, moved, or scaled.
View 1 Replies
Dec 29, 2010
I ran into an issue with an app that I have been working on.The application lets a user draw a rectangle, which base class is UIComponent, on an SVG Canvas. The user can rotate, skew, scale,flip horizontal and flip vertical the rectangle. Then they can drop an image into the rectangle.We just cloned the rectangles matrix and applied it to the image and the image would transform the same as the rectangle. Well now we have changed the way the app works.
Now we don't want the image rotated or flipped on the initial drop, and this is where I'm having trouble.I was wondering if there is a way to always find the true top left of any rectangle no matter what kind of matrix is placed on it. I can find the center of the rectangle but when a user flips the rectangle the center point is outside the rectangle.Instead of finding the center I would like to find the topLeft.I have tried several things. Like transform.pixelBounds, but this gives me big numbers like 2200 instead of 400. I have also looked at senocular.com but not sure that I understand it.I just need a dynamic way to always find the top left.
View 1 Replies
Jul 2, 2009
I have problem when dealing with transform in Flash cs4 ....When I rotate my movieclip and trace the output, my movieclip's width also changed....
View 4 Replies
Aug 13, 2010
I have a class which extends the Sprite object in as3. I need to be able to override the transform.matrix setter in this class but haven't been successful in doing so.
I've tried many things, along with creating my own separate class which extends the Transform class and then overrides its set matrix function, and set my transform = new CustomTransform(). Sadly this didn't work.
In code this is what i tried:
public class MyClass extends Sprite
{
public function MyClass()
{
[Code]....
View 1 Replies
Dec 10, 2009
Im using Daniel Gasienica's Zooming in Flash where he uses the transform matrix to calculate the mouse position so the zooming reference point is the same. Its pretty handy, but i need the zoom to more smooth. I've tried almost everything (mainly the TweenLite engine), but with no luck.
[Code]...
View 3 Replies
Nov 10, 2010
I am having quite a bit of trouble with one of my classes not working with the custom PixelPerfect-Class. Looking into it I found the error occurring in this line:
Code: Select allbM:Matrix = objB.transform.matrix.clone();
It's throwing a 1009. Playing arounf with trace I have come to the point, that the hero in my little game has no transform.matrix (it's null). This is not related to the CollisionClass, i traced it independently of that.
View 2 Replies
Oct 18, 2010
I have a UI component that I wish to relocate and scale, but in a rather complex way. I've figured out the necessary transformations using the transform matrix, to which I applied several translate and scale operations. I can set the new transform matrix for this UI component to be the above calculated matrix, and the results are accurate; but I need to animate the transition. I can't use the Scale/Move effects alone because they aren't as powerful when it comes to calculating the necessary transformation as the matrices are.So how can I animate the transition of an object given a source and a target transform matrix?Figured it outUsing a tweener and its onUpdate event to reassign the matrix with each intermediate value:
var animMatrix : Matrix = gi.transform.matrix;
TweenMax.to(animMatrix, 1, {
a : m.a,
[code]......
View 1 Replies
Jun 29, 2011
I'm working on a project wherein a user can take a snapshot of themselves using their webcam and then edit this image by transforming scale and rotation and save the result.
I've got most of it working, the user can take a snapshot of themselves, transform the object using Senocular's Transform Tool and i'm using .draw() to then save this transformed object. The problem is .draw() is only grabbing data from the top left corner of the stage. It is drawing the transformed object but only from the top left corner.
Why does it only draw from the top left corner and how can i get set the coordinates to only draw from the area where the captured image is set?
You can view the file as is at: [URL]
And i've zipped the FLA and relevant classes at [URL]
import flash.display.Bitmap;
import flash.display.BitmapData;
import flash.display.Sprite;
[Code]....
View 2 Replies
Jul 8, 2011
someone could tell me how I can zoom a Canvas, with transform.matrix, so that the content of the component fits into the parent container (application), either inward or outward
this function is called Zoomfit(), I have this code:
[Code]...
View 1 Replies
Jun 29, 2011
Long time since i've been on here. I'm working on a project wherein a user can take a snapshot of themselves using their webcam and then edit this image by transforming scale and rotation and save the result. I've got most of it working, the user can take a snapshot of themselves, transform the object using Senocular's Transform Tool and i'm using .draw() to then save this transformed object. The problem is .draw() is only grabbing data from the top left corner of the stage. It is drawing the transformed object but only from the top left corner. Why does it only draw from the top left corner and how can i get set the coordinates to only draw from the area where the captured image is set?
[Code]....
View 2 Replies
Apr 14, 2011
I'm having trouble with Matrix Transforms in Flex.
I have a Flex Canvas with nothing but an Image in it, like so.
<mx:Canvas>
<mx:Image id="img" source="/some/Url" />
</mx:Canvas>
[Code].....
View 5 Replies
Mar 4, 2010
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 Replies
Aug 25, 2010
Okay so I have two import pieces of code involved in this. This first tiny bit is what creates an object called OBJECT_arrow. It is located in the main function of my main class[code]...
It isn't really all that important. Now this next bit is the OBJECT_arrow class. What it does is loads an external png image and draws it. [code]...
View 2 Replies
Jul 21, 2009
Unfortunately geometry is not my strong point and I am on a deadline. I am trying to determine if a textfield is larger than a displayObject and that it does not sit outside the x and y of said object. If it is larger, I need to scale it and make sure it is always in the confines of the displayObject space. On a side note, i need to scale the size of the text accordingly.
View 0 Replies
Jan 24, 2010
How can I rotate an Image eg. 180 degrees clockwise using the Matrix. I can use the following code to rotate the image 90 degrees, but it is incremental, meaing
var matrix:Matrix = new Matrix();
matrix.rotate(Math.PI/2);
matrix.tx = imgControl.content.height;
var bitmapData:BitmapData = new BitmapData(imgControl.content.height, imgControl.content.width);
bitmapData.draw(imgControl.content, matrix);
imgControl.source = new Bitmap( bitmapData);
[Code]...
View 1 Replies
Dec 6, 2011
When I try to rotate using Gradient transform tool, I can't rotate my gradient 45 degrees or 90 degrees. nap to objects is enabled and holding shift also doesn't work.
View 5 Replies
Jun 29, 2011
I'm using a transform matrix as part of a bitmap draw to select an area of my target rather than drawing from 0,0:
var bmd:BitmapData = new BitmapData(target.width,target.height,true,0);
var mat:Matrix = new Matrix(1,0,0,1,-target.x,-target.y);
bmd.draw(this,mat);
[code]......
View 1 Replies
Feb 4, 2008
how to scale down flash images using BitmapData and Matrix?? I'm using it for fullscreen so that the images are always perfect. I've been tampering with this, but cannot get it to work properly.
View 3 Replies
May 31, 2011
Im currently building a little 3D particle engine in flash the uses sprites.to set the position of each sprite I am using the projectVector function below. (the viewTransform matrix is the particles world matrix concatenated with a perspective projection matrix)
var projectedPoint:Vector3D = Utils3D.projectVector(viewTransform, point);
sprite.x = projectedPoint.x;
sprite.y = projectedPoint.y;
[code].....
View 1 Replies
Feb 29, 2012
I need to scale numbers. I'm using perlin noise to create a random 2d scrolling map. I'm using Blue channel data with values between 0 and 255 (I believe).Each pixel represent a value of height of a tile. For that reason I have to transform this value into a valid value.For example, If my 2d scrolling map has 20 tiles of maximum height and the pixel in the first position is 100.I have to transform 100 into the scale 1 to 20.
View 2 Replies
Nov 19, 2010
I have an odd problem in CS4/AS3 with one of my flash files where text is incorrectly rendered if the movieclip containing the text has a 3d matrix transform and quality is set to medium or low. It is easy to reproduce:
[Code]...
View 11 Replies
Aug 3, 2010
My Text is visible before rotating it to verticle position using Free Transform Tool. But when once it is rotated to verticle position the text disappears from the Stage. And it is not an animated Text as well?
View 4 Replies