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
Similar Posts:
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
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
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
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
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
Jun 28, 2011
I have been making a game and have recently found out about the Combo Box component, I love it and it works really well, except for one thing.You play the game using the arrow keys, and when you press the arrow keys the character moves, AND it changes the value in the Combo Box, I do not want it to affect the combo box.Please do not say use the WASD keys or another set of keys as this will not affect it, because this is not an option, they are already being used!
View 9 Replies
Jan 20, 2012
I'm confused by a tip in Adobe's own documentation that says:Avoid using gradients, because they require many colors and calculations to be processed, which is more difficult for a computer processor to render.I understand how this would be true in a vector shape fill, but they aren't specifying vector. It seems to be implied they include bitmaps too, since the next couple tips are bitmap related.If they do in fact include bitmaps in this tip, can someone explain to me how this is possibly true? In a bitmap a pixel is a pixel. I don't see how it matter that the pixels form a gradiated color or not, the software still has to read and write each pixel regardless.
View 1 Replies
Jun 2, 2009
When I first learned Flash (oh, so long ago) I was taught that unused items in your library would affect your swf's file size. Is this true?
View 3 Replies
Jun 26, 2011
I have an array I am using to hold movie clips, and I'd like to be able to change all of them at once using the array. Now, I can do it using array[0,1,2,3,4,5,6,7,8...].changestuff but with 60 or so movieclips, it gets unwieldy. Is there a simpler way to go through the entire array and apply the changes to each movieclip stored within?
View 3 Replies
Aug 22, 2007
I have a series of buttons that when rolled over I want some text to highlight.First, I need to know if the text has to be a symbol with an instance name to get this done.Second I can't find the code to even begin making my buttons change another symbol
View 1 Replies
Oct 28, 2009
Is there any reason why a MouseEvent.CLICK would affect only 1 of 5 items, whereas a MouseEvent.ROLL_OVER and MouseEvent.ROLL_OUT affect 5 of 5 items when each event listener is applied exactly the same way?For some reason, of the 5 images I've imported, only the last image is able to be clicked and have click actions applied, yet it is able to receive the ROLL_OVER and ROLL_OUT messages. So that leaves me thoroughly confused.
Here is the code I'm using, I'd greatly appreciate your help ---
Code:
import XMLManager;
import caurina.transitions.Tweener;
import MakeHand;
[code]...
View 1 Replies
Oct 28, 2009
Is there any reason why a MouseEvent.CLICK would affect only 1 of 5 items, whereas a MouseEvent.ROLL_OVER and MouseEvent.ROLL_OUT affect 5 of 5 items when each event listener is applied exactly the same way? For some reason, of the 5 images I've imported, only the last image is able to be clicked and have click actions applied, yet it is able to receive the ROLL_OVER and ROLL_OUT messages. So that leaves me thoroughly confused.
[Code]....
View 6 Replies
Jun 4, 2011
I want to use a button to affect multiple objects with a similar name, such as [code]I want to be able to use something like an array to affect them with a single line, rather than having to write every single object into a piece of code, such as [code]Where X equals any number. Sorry if this description is vague, I can't seem to get my head around arrays.
View 1 Replies
Feb 3, 2010
Recording an f4v file to FMS3.5, capturing video from a local camera through the Flash Player i'm getting poor quality and small video size - using:
cam.setMode(320, 240, 10);cam.setQuality(0,99);
Doesn't seem to have any affect on the recorded video, is this due to the cameras native resolution?
View 1 Replies
Jan 15, 2011
I wrote a function within a function to control 2 Tweens.(the 2nd one isnt in the function, it's called)My problem is... is that it works for the first time.. the button is hovered over and all the other buttons show themselves and then disappear again, except the one you're over. Then I do it a 2nd time and it doesn't work. why is it only working right one time? and why isn't the if statement I put in the local function affecting the for loop? The 2nd time it takes the button you're hovering over with it and fades it out. (even though the if statement registers according to trace)this is the code
import fl.transitions.Tween;
import fl.transitions.easing.*;
var shortInst:Array = [btn1, btn2, btn3, exit];
[code].....
View 6 Replies
Jun 3, 2011
I have loaded a .swf into my main timeline, but it's quite large. I am trying to get it to fit in the constraints of my current movie. I have read that by putting it into a movie clip, it will constrain to that dimension. How do I accomplish this?
View 3 Replies
May 27, 2011
I have a lot of the following warnings:Duplicate variable definition.variable 'elem' has no type declaration.Illogical comparison with null. Variables of type Boolean cannot be null.Will they affect the performance of my flash application? Will they affect the compiling time?
View 1 Replies
Nov 20, 2006
I have 10,000 movieclips, but all are _visible = false , everyone of them is hidden. I want to know, the fact that they're hidden, in terms of the processor usage, is as if they don't even exist? Or are they causing some burden on the processor, and hence affecting the speed of the movie?
View 10 Replies
Apr 21, 2009
I have an image with a translucent rectangle sitting over it (white rectangle with alpha = 0.5) I'd like to apply a filter to the rectangle and have it affect the image below it. For example, apply a blur to the rectangle and see the part of the image below the rectangle get blurred.
View 2 Replies
Jan 22, 2010
From what I hear, getting/setting dynamic properties is a lot slower than regular properties.
But does allowing a class to be dynamic slow down the entire class for regular property getting/setting?
For instance, let's say I have this class (pretend those properties have setters as well):
Code:
public dynamic class Hero
{
public function get endurance():int
{ return _endurance; }
[Code].....
Obviously, calling and setting the "magic" property will be a lot slower, but will all properties become slower to get/set just because the entire class is set to dynamic?
Is it better to not set the entire class to dynamic, and instead create a new dynamic object, "additionalStats" where properties can be get/set to instead?
View 1 Replies
Jul 11, 2009
I have a project in mind in which I would like 3 sets of interlinked images that are displayed on the same stage. While the mouse is over one set the wheel button allows for scrolling through that set of images and so on for the other two sets of images.
How do I separate the three sets of images, so that scrolling through one set doesn't affect the other sets on the stage? Each set has about 30 images each.
View 4 Replies
Nov 27, 2009
In my flash scene, I want to put several items off screen (to make things easier) which are going to rush through the scene (they are very big in size) but I worry that they might slow down the movie as it's playing.
But if I have things off the scene (out of view upon playback), do they affect the speed of the movie (affecting the memory and slowing things down)? To give you a better idea here is the scene: There is a vehicle moving quickly and the camera is facing the right side of the vehicle, so we can see the moving landscape behind the vehicle. I can either create a very very long landscape and movie it all one time (if having the long landscape off the screen does not affect the movie's speed), or I can create certain points of the movie where I ad and take away from the landscape.
View 1 Replies
Aug 1, 2010
I've checked the document:But still don't find info on how to control the visual affect(like lightness, saturation and so on) of my pc camera.
View 9 Replies
Feb 8, 2011
Does the getTimer function affect the output time? so it's seen different in each country? I've created adigital clock using the time received from a php. Customers see a different time than mine. (php file works perfectly and output the time in my timezone).
View 3 Replies
Jun 6, 2011
my preloader music now fades out as the progress bar completes (the preloader code is below with the new code in bold). However, the new code added to the preloader seems to be affecting the sound in the main swf (the bigger swf that the preloader loads - 'lesson.swf' - which is a series of exercises).
The exercises in the main swf have sound cues for right and wrong answers. The first time the main swf loads, there is no sound at all in the exercises. If I navigate to another page of the website and come back to the exercises, the sound is normal. But if I navigate to another page and come back a third time, the sound is audible, but reduced in volume. If I keep switching off the page and back to the page, the sound varies from no sound to full sound to about half the full volume.
Is it possible that the code on frame 2 of the preloader, the code that sets the volume for the preloader music, is also applying to the main swf, so that whatever point the preloader progress bar gets to before the main swf loads becomes the volume of the main swf? The first time the preloader runs, the progress bar goes all the way from left to right and the sound volume fades to zero. Then the volume in the main swf is zero. The next time the preloader runs, it only gets a little way across before the exercises come up, and the sound in the exercises is full volume. Is there a way to fix this? I should add that if I comment out the new code that fades out the preloader music, all the sound works normally.
[Code]....
View 3 Replies
Jul 13, 2010
I thought I had a handle on AS3, DisplayObjectContainers, etc. but this basic thing is really confusing me: changing the width/height of a sprite does not affect it's visual contents - either graphics drawn within it or any children it may have.[code]...
View 2 Replies
Aug 1, 2010
I've checked the document: [URL] But still don't find info on how to control the visual affect (like lightness, saturation and so on) of my pc camera. Is that kind of job possible with actionscript?
View 2 Replies
May 26, 2011
I've got a container(sprite) with children(sprites) added to it. When I scale the container, I would like to get the new width of a child, but when I trace the children's width I always get the original dimensions, even though everything gets visually scaled as it should. How do I overwrite the children-width ?
Update: I just found out that the children.graphics-"dimensions" could have caused the problem. When I leave the graphics, everything seems ok. Is it possible to scale the graphics at same time as the child-sprite?
View 3 Replies
Aug 30, 2011
I have many buttons in HBox. Instead of disabling each button, I've disabled HBox. But I am able to click buttons even though the HBox is disabled. Disabling parent component will not make difference on its child? it shows like disabled but mouse events will generate.
View 1 Replies