Flex :: AS3 - Random Swapping Of Height And Width When Rotating Bitmap Object
Dec 30, 2010
Project : Game in Flex builder 4 (Actionscript Project) Language : Actionscript 3
This code
trace ("--before-- "+sprite.width + "," + sprite.height);
this.sprite.rotation = obj.rotation;
trace ("--after-- "+sprite.width + "," + sprite.height);
[Code].....
Obviously there are 9 instances. So 18 lines output. note that the width and height getting swapped randomly for some only.
View 1 Replies
Similar Posts:
Dec 14, 2005
I'm doing an xml image gallery. The bitmaps are loaded using a loader and loadClip. What's the easiest way to read the bitmap width and height? Is it worth trying BitmapData? PS I'm tracing the _width and _height of the container mc on onLoadComplete, but it's giving me 0, 0.
View 3 Replies
Nov 8, 2003
I am trying to tile a 5x5 bitmap 160 times in height which will come to 800 and 120 in width which is 600.Here is the code that doesn't work:
gridx=5;
for (var i=0;i < 160;i++)
{
background.duplicateMovieClip("background"+i,i);
mc=this["background"+i];
[code]....
View 5 Replies
Sep 21, 2010
I'm trying to import a huge game race track 8000 x 7000, and I'm having problems.
View 7 Replies
May 18, 2010
I have a 50x50 fixed rectangle in the center of the stage. I am using this rectangle as a "hit area" to copy pixels of a bitmap that is draged by the user to line up an area of the image he/she would like to crop.I have preview of the hit area displayed while the bm is being dragged which works well. However, once the bitmap is scaled using the slider component the preview area no longer reflects what is in the hit area.
Code below:
function mouseDownHandler(e:MouseEvent):void
{
// Contraint #8 - Define drag bounds[code].....
View 1 Replies
Jul 29, 2010
I am trying to reference to top level (stage) width and height of the main stage for the placement of something located inside a movieclip on the stage.
My code is:
Code:
my_loader.x = (stage.stageWidth - my_loader.width)/2;
my_loader.y = (stage.stageHeight - my_loader.height)/2;
But this seems to just relate to the width/height of the mc that my_loader is nested in...
I have tried the following and had no luck:
stage.stage.stageWidth
root.stage.stageWidth
parent.stage.stageWidth
MovieClip(root).stage.stageWidth
View 8 Replies
Jun 12, 2009
i want to load external images of different height and width into same height and width.
View 3 Replies
Feb 24, 2010
i want to load external images of different height and width into same height and width.
View 0 Replies
Aug 27, 2009
how to attach two objects (movieclips), with different width and height properties into the stage, with random positions,without visual colliding.
View 6 Replies
Feb 22, 2010
package
{
import flash.display.*;
[code].....
View 3 Replies
Nov 27, 2011
I thought this would be straight forward but I'm having trouble repositioning my content. I have a button instance named rollOne, When I roll over the button I want to load an swf object but not on top of the button so I want to find out what the button's width is so I can reposition the dynamically loaded content. I thought rollOne.width would return the width, but it only returns 0 the same goes for height.
rollOne.addEventListener(MouseEvent.MOUSE_OVER, fetchQty);
function fetchQty(event:MouseEvent):void {
myContainer.x = (rollOne.x + rollOne.width);
myContainer.y = (rollOne.y + rollOne.height);
var img1Request:URLRequest = new URLRequest("8032697883620.swf");
var img1Loader:Loader = new Loader();
img1Loader.load(img1Request);
myContainer.addChild(img1Loader);
trace(rollOne.width);
}
View 2 Replies
Jan 24, 2009
Im trying to access the width and height of a dae/collada object.myDAE.width does not work. If you have any ideas as to which class this info is contained it would be a massive help!
View 1 Replies
Mar 25, 2011
I would like to use a movieclip to load a flv video. The problem I have is that I want to change the video dimensions. I've tried several software to change the video dimensions but as far as it seems all of them keep the same height-width ratio than in the original video. Is there any software that would allow me to change the height and width without keeping the same height/width ratio as in the original video file?
View 1 Replies
Jul 31, 2009
I am tweeing a bunch of rectangles randomly on stage.
Code:
TweenLite.to(thumbArr[i],1,{
x:Math.random () * (stage.stageWidth - thumbArr[i].width),
y:Math.random () * (stage.stageHeight - thumbArr[i].height),
rotation: Math.random () * (60) - 30});
the problem is that after I added random rotation (between -30 and 30 degrees), the corners of my rectangles are still sticking out of the stage at the end of the tween.
If I trace objects width and height after the rotation I get the new values but this still doesnt help me because I am tweening to that rotation.
Code:
mc.rotation = 20;
trace(mc.width);
trace(mc.height);
View 5 Replies
Nov 24, 2009
Is there any way to read the width and height of a flash object using jQuery?
View 1 Replies
Jul 30, 2009
I am tweeing a bunch of rectangular shaped objects randomly on stage.
Code:
TweenLite.to(thumbArr[i],1,{
x:Math.random () * (stage.stageWidth - thumbArr[i].width),
y:Math.random () * (stage.stageHeight - thumbArr[i].height),
rotation: Math.random () * (60) - 30});
the problem is that after I added a random rotation between -30 & 30 degrees they still stick out of the stage a little.how could I calculate width & height of the these objects based on their final rotation so they dont stick out of the stage?
View 6 Replies
Aug 12, 2010
In the documentation for DisplayObject, it states that the width and height of the DisplayObject can not be changed if it is empty. Why is this restriction necessary? In every other framework I have used, you can resize containers that are empty.
View 2 Replies
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
May 17, 2011
I'm looking to print my view to an A5-printer but when I test the print functionality to pdf, I always get a narrow and long printout.
Is there a way to set the pageheight and width? According to adobe help it's read-only.
View 3 Replies
May 7, 2010
I wahnt to place a container (alpha red) on top of my chart like on the image.How to get the x, y (point A), width, height of this area?
View 1 Replies
Jul 30, 2010
I have an actionscript, which makes a dynamic image wall. It gets parameters from FlashVar and changes the width and height dynamically.
When I use
[SWF(width="584",height="290")]
It's fully centered, but when I remove it, it's appear ~+50px from left. How can I set dynamically the SWF metadata or what I need to set for the correct view?
Top of the picture with SWF tag and the bottom is without SWF tag.
View 1 Replies
Feb 21, 2011
How can I make an application with the same ratio width/height? I have an application with width = 800 height = 600. Its width = 1.33*height and when I change the width to 1024 I want the height to change to 768 automatically.
View 1 Replies
May 3, 2011
I'm trying to set width/height of a FlexSprite object in ActionScript but it doesn't seem to work at all. I'm still a rookie when it comes to ActionScript and I don't understand why I can't set the dimensions of that object. I know I could use a UIComponent but I need something more lightweight since I'm going to add hundreds of them.
public class MyComp extends UIComponent
{
public function MyComp()
{
[Code].....
I plan to add other objects inside the FlexSprite and I need to set their dimensions explicitly as well so I really need to figure out how to do that.
View 1 Replies
Dec 14, 2011
I am loading an external swf using the SWFLoader component. The swf that is being loaded is masked so that only a portion is being shown. However, when it's loaded the actual size of the swf (loader.content.width/loader.content.height) is the complete swf including the masked area. Therefore, the loaded swf does not display properly in the itemrenderer Is there a way to to grab the size of the just the masked area as opposed to getting the size of the entire swf's contents? also i need to re size the masked area
View 1 Replies
May 12, 2005
I have an actionscript, which makes a dynamic image wall. It gets parameters from FlashVar and changes the width and height dynamically.When I use [SWF(width="584",height="290")]It's fully centered, but when I remove it, it's appear ~+50px from left.How can I set dynamically the SWF metadata or what I need to set for the correct view
View 4 Replies
Oct 23, 2009
Given this code:
[Code]...
Why does changing the width and height of uiComp not affect the Sprite? Wouldn't UIComponent provide Sprite with a Graphics object, which limits that area where Sprite can draw?
View 1 Replies
Nov 16, 2009
In my Flex application, I've got a component that extends UIComponent where I'm loading images at runtime and try to display them. I've tried lots of different approaches (using beginBitmapFill(), using different containers), but I can't get things to work as I want. The problem seems to be related to the width and height properties of the image, which aren't updated correctly.The idea is:
var sprite:Sprite = new Sprite();
addChild(sprite);
var im:Image = new Image();[code].....
The image's width and height doesn't seem to be correct when it's loaded. I get width==0 (and nothing is displayed), but the property $width seems to be correct. How can I assure that width and height of the loaded image is updated?
View 2 Replies
Nov 18, 2009
I want to create a text box with a fixed width that will fit itself to its current text. So I went ahead and wrote this simple application[code]...
View 2 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
Jul 25, 2010
I'm playing around with code like this:
<s:Button id="test" label="test" transformX="{Math.floor(test.width/2)}" rotationY="20" x="20" y="20" />
The button is rotated on the Y axis and the rotate pivot is in the middle of the button.
This will create a button that looks something like this[code]...
I put together a sample to show off the various approaches for calculating this that people are suggesting. The source code is also available. Nothing is quite working like I'd expect. For example, turn the rotationSlider to 85. The button is effectively invisible, yet all approaches are still giving it height and width.
View 3 Replies