Flex - Display Object That Has Been Transformed With A PerspectiveProjection?

Jul 20, 2010

I'm currently transforming some objects to make them appear far away using a PerspectiveTransform. This works well, but I have no way of knowing where on the screen the object is displayed. The x and y coordinates are the coordinates of the object if it were at z=0. How can I compute the display coordinates of my component?

View 1 Replies


Similar Posts:


Flex :: FLASH - User Added/Transformed Text Field

Aug 4, 2011

how I'd go about having a text field a user can change the dimensions of by clicking and dragging in Flash?

i.e. the movie would show a text field with transform handles and depending on how wide or high it changes the word wrap..

View 1 Replies

Flex :: 4 - TouchEvent StageX & StageY Properties Fluctuate Under Transformed Target

Aug 3, 2011

I've written code that enables DisplayObjects to be fully manipulated under two touch points (drag, scale, rotate). The problem I'm having is that as the DisplayObject is being manipulated, it causes fluctuations in the TouchEvent's stageX & stageY properties. These fluctuations are feeding back into the tranformation code and as a result, the object shakes/shivers.

It seems that the stageX & stageY properties are being calculated from the localX & localY properties of the TouchEvent. I've tried adding listening to the stage itself for the TouchMove event, but as soon as I drag my finger over a transformed object, the traced stageX & stageY values change slightly, going from integers to floating-point numbers. This is evidently what's causing the shakey feedback loop.

View 1 Replies

Actionscript 3 :: Get Unrotated Display Object Width/height Of A Rotated Display Object?

Jan 31, 2010

If I create a rectangle with 100px width and 100px height and then rotate it, the size of the element's "box" will have increased.With 45 rotation, the size becomes about 143x143 (from 100x100).Doing sometimes like cos(angleRad) * currentWidth seems to work for 45 rotation, but for other bigger angles it doesn't.At the moment I am doing this:

var currentRotation = object.rotation;
object.rotation = 0;
var normalizedWidth = object.width;

[code].....

View 4 Replies

Flex :: Why Can't Get Sub-children Of Display Object

Oct 13, 2009

I am having problems accessing sub-children of my displayObject. Here is my code:private [code]but it's not working.

View 1 Replies

Flex :: Draw All Elements Of Display Object?

Apr 1, 2011

I am trying to save a component as a JPG file and I can't seem to get the BitmapData.draw() to give me the pixels I'm expecting and instead I am seeing a plain white rectangle when I open the resulting JPG file. I am first creating an object which contains an image and a caption (the MultigraphCanvas below) and when I display the object as a pop up it looks perfect -- however when I try to draw it as a bitmap and then encode and save it as a JPG I don't end up with the same image I can display on the screen. [code]...

View 3 Replies

ActionScript 3.0 :: Using Local3DToGlobal With PerspectiveProjection?

May 8, 2010

I'm using local3DToGlobal with PerspectiveProjection.  My problem is that when I don't use PerspectiveProjection local3DToGlobal works as expected. But when I use PerspectiveProjection local3DToGlobal appears to give a random Point that doesn't make sense to me.  However, if I have the local3DToGlobal in a function that's called with the Event.ENTER_FRAME it works as expected.
 
The red circle is suppose to follow the black circle end of the stick graphic. The red circle is using regular x and y positions, while the stick is using x, y and z (3D). If you call the onEnterFrameMethod directly the red circle wont wrap the circle end of the stick.  If you comment out the PerspectiveProjection code, then the red circle will wrap the circle end of the stick.  If you uncomment the PerspectiveProjection code, and then use an event listener to call the onEnterFrameMethod, the red circle will wrap the circle end of the stick.
 
package
{
import flash.display.Sprite;
import flash.events.Event;
import flash.geom.Point;

[code]....

View 1 Replies

Actionscript 3 :: Measuring Time Taken To Display An Object In Flex?

May 3, 2010

For e.g.
function showIt():void {
something.visible = true;
}
function init():void {

[Code]...

In the above code, I want to measure the time taken to display st on screen.Is it enough to compute time2 - time1? Or should I put an event handler on render? Or some other way?

View 4 Replies

Flex :: Add Mxml Element Once It Has Been Removed From Display Object?

Jul 1, 2010

I have some MXML elements which i would like to remove and add to a parent element. Unfortunately I am constrained to removing the MXML object as this is handled by the custom component. So is there any way to reinstate a removed MXML element back into the display list?

View 1 Replies

Flex :: Rotate / Scale Display Object With Mouse

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

Flex :: What's The Difference Manipulating Display Object Position

Oct 26, 2011

I have 2 possiblities. It looks like these are the same (or I'm wrong). Which is better and why?

var quest1:DisplayObject = FrameCanvas.baseCanvas.addChild(app.questionmark1); //
quest1.x = posX; //
quest1.y = posY; //

or

app.questionmark1.x = posX;
app.questionmark1.y = posY;

View 1 Replies

Transformed Text Can't Show Up In Run Time

Dec 7, 2010

I am having a problem where the text that I transformed (rotated) doesn't show up when I test the movie. I am using Flash CS4.

View 1 Replies

Css :: Flash :: Embedded Videos Be CSS Transformed?

Mar 11, 2011

I'm experimenting with CSS transforms and I noticed that embedded videos (like for instances the ones from youtube) don't behave as expected when a CSS transformation is applied to them.

I've tested this in the latest Chrome, Firefox and IE and none of them was able to display transformed videos.Is this a bug of sort, or are videos not supposed to obey to CSS transformations? Not even using html5 in Chrome solved the issue.

View 1 Replies

ActionScript 3.0 :: ProjectionCenter Does Not Affect PerspectiveProjection?

Dec 28, 2009

I am manually drawing 3D lines on screens. I am NOT using the native X Y Z properties of Sprite.private var displayCoordinates:Vector.<Number> = new Vector.<Number>;

private var displayMatrix:Matrix3D = new Matrix3D();
var pperspectiveProjection = new PerspectiveProjection();
pp.projectionCenter = new Point(sizeX/2,sizeY/2);

[code].....

View 1 Replies

Flex :: Play / Pause Flash Display MC Object And Go To Frame

Nov 10, 2010

I am using swfLoader to load external flash movies in my flex/actionscript code. If the loaded swf was made for the newer flash player versions (I believe 9.0 or more) it loads as a flash.display.MovieClip object which has methods for play/pause and go to frame. However if the loaded swf was made for older flash player (I believe 6.0) then it loads as flash.display.av1movie which doesn't have methods for play/pause. Is there a way I can play / pause the av1movie from my flex code.

View 2 Replies

Actionscript :: Target And Display An Object Of List Control In Flex

Oct 1, 2011

i have made a list control. i want to display the name of the objects in it in a text control box

the code i am using here is

public function add(event:MouseEvent):void
{
var str:String;
str = mylistcontrol.dataProvider.getItemAt(0).toString();

[Code]....

The problem with this code is i am using index value of 0. however i want to display the name of object on which i have clicked or which is highlighted.

View 1 Replies

Flex :: Capture "screenshot" Of Flex Display Object Created With ActionScript But Not Added To Stage?

Oct 20, 2011

Is it possible to create a display object in AS and take a screenshot of it as ByteArray or whatever without adding it to stage?

View 1 Replies

Button Hover - Stroke Enlarges When Transformed?

Dec 7, 2009

I have a button that I use universally to show a hover state, so that the user knows the item is clickable. The hover state is a simple black stroke. Because the buttons with the timeline are of different sizes, I stretch the button to encapsulate the entire area I want to be linked. However, the stoke of the hover state is stretched too, so it's get thicker the bigger I make it. Is there any way to ensure the stroke is always the same weight?

View 4 Replies

ActionScript 3.0 :: RotationY/PerspectiveProjection/width Calculation?

Dec 18, 2009

Basically I have used PerspectiveProjection so I may rotate multiple images about their centre so they don't appear differently rotated because of their x-position on the stage.My problem is calculating the width of the rotated images. When I rotate an image 45 degrees, my width ends up being ~146, but based on the following (my comments from my code), it should be closer to 141:

Code:
// ^C
// / |

[code]......

View 7 Replies

Flex :: 3 Get The Root Display Object Of A MovieClip To Be A MovieClip Object?

Jun 26, 2011

I am trying to build an MXML application with Flash Builder 4.5, and I am integrating an API that requires the root of a display object to be a MovieClip. Personally I think this is bad design but I have to go with it. The root object always seems to end up as the stage, because of course I have to add the object to the stage for it to be added to the display list. Is there some way that I can either change the stage type in an MXML application to a MovieClip or is there some way to force a MovieClip wrapper to become the root of a display object?

View 1 Replies

ActionScript 3.0 :: Correction Applied To The Rotation Y Angle When Using PerspectiveProjection?

Dec 28, 2010

I have a stage with and height of :600x400 On this stage i have 3 squares that have a centerpoint in the middle. The square are 90 (width) and 80 (height)The first square is aligned to the left site and the second one in the middle and the third one on the right  The perspectiveProjection is setup using the middle of the stage as it projectionCenter.When i rotate all squares to 90 degrees (rotationY) than only the middle one is now not visible anymore, at that point i want to switch the image inside the square. But at 90 degrees the left and right squares are not invisible..  For the left square that point wouldbe at 90 - 22, and the right one 90 + 22.   Is there a way to calculate the correction value (22) in this example?
 
What i don't want is to give every square it's own perspectiveProjecten , then it would work but you have a completely different3D rotation.The only thing that goes wrong in my example is that the image from the left and right square are not changed at the right time, because 90 degrees on the left square does not mean it it not visible at that point.
 
And here is the code:
 
import flash.display.MovieClip;import flash.geom.Point;import flash.geom.PerspectiveProjection;import fl.transitions.*;import fl.transitions.easing.*
var squares:Array = [c1, c2, c3];

[code]....

View 13 Replies

ActionScript 3.0 :: RotationX And RotationY And RotationZ And PerspectiveProjection Together Break MouseEvent?

Apr 21, 2009

When I change the rotation of a movie clip, and apply PerspectiveProjection, all mouse events applied to that movie clip and all the movie clips inside that movie clip break.The mouse event bellow will not work for me.
 
a_mc.rotationX = 1;
a_mc.rotationY = 1;
a_mc.rotationZ = 1;[code]........

View 2 Replies

Flex :: Give MS Word Like Interface To User To Expand Or Contract Display Object's Like Canvas, Images

Dec 9, 2009

How to give a ms word like interface to a user so that he can enlarge and contract the display objects like Images, canvas, Hrules etc. at runtime in an web application?

View 1 Replies

ActionScript 3.0 :: Test If A Display Object Has Been Added To Display List

Mar 6, 2008

Is there any way to test if a display object has been added to the display list?

View 9 Replies

ActionScript 3.0 :: Do Not Resize Display Objects In A Display Object Container

Jan 22, 2012

can I resize a display object (container) without its contents (children) are resized?

For example, in the following code when I resize the green square, red is also resized. I wanted to resize only the green.

ActionScript Code:
import flash.display.Sprite;
var sprite:Sprite = new Sprite();
sprite.graphics.beginFill(0xff0000);

[Code].....

View 3 Replies

Actionscript 3 :: Test If A Display Object Is On The Display List Or Not?

Mar 4, 2011

What's a simple way to detect if a display object is currently on the display list?

View 1 Replies

ActionScript 3.0 :: Display 1 Display Object Many Times?

Aug 14, 2009

Can you make one Bitmap Object (I'm using an external jpg) or something similar, and then display it many times simultaneously without creating a separate object each time?

Also, would they be easily removed or hidden?

I've got a little checkmark jpg graphic loaded here, but I'm not sure how to go about using it in many places at once.. I can only display it in the one place at any one time...

I'm thinking there might be a way to load the picture once, then use its bitmapData elsewhere in new display objects somehow, without needing to reload the image over and over?

View 3 Replies

ActionScript 3.0 :: Display Object Cannot Be In The Display List More Than Once?

Feb 9, 2009

It's my understanding that a display object cannot be in the display list more that once.So if I add something to the stage shouldn't a second addition of the same object replace the first? for instance:

[code]...

there should now only be one "myDisplayObject" on the stage.

View 3 Replies

Flex :: Object To Arraycollection - Unable To See Any Data Display In "S" Which Is A Datagrid?

May 14, 2011

linedataColl is an AC that contains 100+ of rows extract from CSV, I wish to add item into SuperDataCollection object by object but the only problem was I'm unable to see any data display in "S" which is a datagrid. What wrong with my code?

var superDataCollection:ArrayCollection = new ArrayCollection();
var dc:ArrayCollection = new ArrayCollection();
var di:Object = new Object();[code]......

View 1 Replies

Flash :: Cast A Display Object To Custom Class Object?

Jun 27, 2011

How can i cast a object to another type? in AS3 i tried putting (objectType) infront of the variable but it doesnt work, below i have added objects of fishes into the child, and i am getting the fishes back out when mouse down is triggered, and then calling the fishes what to do. however i cant call the method of the custom class fish because it is a displayobject.[code]...

View 1 Replies







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