Flex :: Unable To Set Width/height On FlexSprite?
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
Similar Posts:
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
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
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
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
Aug 29, 2010
Is it possible to dynamically (not in the project's options) change the dimensions of the stage by using ActionScript 3? I'd want to create a 400x300px loader, but I also want it to load animations that have bigger or smaller dimensions. I would then change the width and height of the loader to make the loaded animations fit well. Is there any way to do that?
View 1 Replies
Dec 2, 2010
I have objects placed on the screen using x/y coordinates. I want a way to update that based on changes in Screen Width/Height. So if used re-sized browser window x/y should change. How do I cick off a function every time the screen is re-sized.
View 3 Replies
Jun 13, 2011
I have the follow declaration :[code]How can i determine "img6" width and height ?
View 1 Replies
Jul 22, 2011
Using Flex 4 AIR, what is the maximum widtha and height I can set for line and the bordercontainer?
bc:borderContainer = new borderContainer();
bc.width = 80000;
bc.height = 80000;
View 1 Replies
Jan 20, 2012
I'm new to flex and I have a question concerning bitmapData and its width and height. Normally you set up bitmapData like this in AS3:
Code:
var bd:BitmapData = new BitmapData(100, 100, true, 0x00000000);
var bm:Bitmap = new Bitmap(bd);
But in Flex embedding an an image works like this:
Code:
[Embed(source="../../../../../assets/sprites/asteroids/asteroid_32_full.gif")]
public static const Asteroid1:Class;
var imageBM:Bitmap = new Library.Asteroid1();
When using the bitmapData (e.g. imageBM.bitmapData) I don't have to set up width and height any more. Does the Flash player know the width and height of a bitmapData automatically even when NOT setting up the bitmapData's width and height? I'm totally unaware about this topic because I don't know whether the Flash player always knows the dimensions of a bitmapData. Could this cause problems when not setting up the dimensions of a bitmapData?
View 2 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 3 Replies
Jul 28, 2009
i use cs4 make as3 loader from SharedObject.getLocal, load flex make swf file, so width/height is not Ok
load cs4 make swf file is Ok,
as3code:
// copy right china summer xiatian qq 11602011
package{
import flash.net.SharedObject;
import flash.utils.ByteArray;
[Code].....
View 2 Replies
Aug 9, 2010
I use a fileReference.browse() to select an image file from the harddrive.
How can I check the Width and Height of the selected image file?
View 3 Replies
Apr 28, 2011
I have been given the seemingly simply task of resizing a Group container by setting width and height explicitly in response to user interaction. However, changing these values have no effect on the size of the container at all. Changing scaleX and/or scaleY will change the size of the container just fine, but this is not the behavior I am after.I have tried overriding updateDisplayList() to set a specific width and height, but this has not yielded the desired results.
<?xml version="1.0" encoding="utf-8"?>
<s:Group xmlns:fx="ns.adobe.com/mxml/2009" ;
xmlns:s="library://ns.adobe.com/flex/spark"
[code]......
View 2 Replies
Aug 31, 2011
Am working in flex 4 the sample mxml is
<?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx"
[code]....
on the perpendicular clicks it shows as like the second click. does the scaleX scaleY affects the width height?
View 2 Replies
Sep 1, 2011
I am working on a Flex mobile project and am using a TileLayout to layout a bunch of groups. The problem is, if any text in one of the groups spans several lines, ALL tiles get resized to the same height. I need the tile width to be the same for all tiles, but I want the tile height to be the tallest only on each row.
View 1 Replies
Sep 30, 2011
I have a ViewStack which is dataProvider for a TabBar. There are two VBoxs as children for this ViewStack. It works fine with absolute values for width and height for these VBoxs, but when specified in percentages, the VBox uses all the available space (100%) for any percentage value. find the code and screen shots below.
how can children of a ViewStack be aligned to center? There is no horizontalAlign property for ViewStack and it is not working with horizontalCenter= "0".
Code:
<mx:ViewStack id="viewStack" width="100%" height="100%" selectedIndex="0" horizontalCenter="0" textAlign="center">
<mx:VBox label="Tab 1" width="25%" height="10%" borderThickness="2" borderColor="red"
[Code]....
View 2 Replies
Nov 30, 2011
I have the following:
var win:Window = new Window();
PopUpManager.addPopUp(win,this,true);
PopUpManager.centerPopUp(win);
What about if I want the popup window to be stretched and be 80% width and height from the parent? How do I achieve that?
View 1 Replies
Apr 18, 2011
In my Flex 4 app I would like all my alert boxes to be a specific width and height, how do I specify that in the CSS? I want to avoid having to specify the width and height every time I want to show an alert, that's why I'd like to set it in the CSS, but does not look like there's a way to.. Something like this does not work:
mx|Alert
{
height: 100;
width: 300;
}
View 3 Replies