ActionScript 2.0 :: How To Get Image Size
Oct 26, 2010I have xml file with images, and they appear in gallery one by one. Is there anyway to trace the width/heigth of each image?
View 1 RepliesI have xml file with images, and they appear in gallery one by one. Is there anyway to trace the width/heigth of each image?
View 1 RepliesI have three images and I want change the images size based on the scene size (default size is 1024x768). After each image has completely loaded I call bindableUtils.setter to set width/height when scene size changes but I don't know how to make a pointer or something like that. I'm using a public var img, but it only works with the last complete image.
Here is my code:
<?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
[code].......
I've done quite a bit of digging but it's surprisingly difficult to find informed answers to these questions. I'm making a Flash game with a friend; as far as we can tell, the code is fine, but there are some serious framerate problems that seem entirely related to the graphics.
Is there a performance difference between Movieclips as JPGs and PNGs? Most of our graphics are imported as PNGs because they have transparent sections, but I don't know whether there is a performance difference between setting image compression to JPG or PNG within Flash itselfDoes turning on "Smoothing" for an image affect performance?Obviously larger graphics have more of a performance hit, but is there any benefit to splitting a large image into pieces? Example, changing a 2000*1000 background into two 1000*1000 pieces? One thing is most of our graphics are as much as twice the size in the library as they are displayed onscreen, then scaled in the code. We had wanted to make the game still look good when zoomed in/fullscreened but that doesn't seem practical so I'm planning on resizing all of the image files to their final size in the game and removing the scaling code. Hopefully that's the major part of the problem.
I am making a sort of portfolio gallery inside my flash project. Every image I try from large to small still shows up very jagged. What is the best size to fit in my 1024 by 768 stage taking up about 80% of it?
View 5 RepliesI am using flash 8. and i have one .Jpg image (1024 x 768px - Its vary) now i want to load this image to my Movieclip. But my movieclip size is 130 x 140px. how is it possible to load and fix this movieclip size.
View 1 RepliesI have a background image at 720x576px. My flash document is also set to the same. When I import my graphic and drag it onto the stage it is a completely different size?
This means I have to re-size using the free transform tool, and as I have to re-size many images for different movies that have to be exact, what is the best way to re-size them? Should my imported image not fit the stage size exactly without re-sizing at all?
I have been trying to figure this out for the longest. I had got it fixed but flash suddenly crashed and everything was lost. Now here is the as code, I want to know how I resize the _loc5, which is the image that is being called.
Actionscript Code:
var _loc2 = _loc6.attachMovie("galleryThumb", "thumb" + _loc3, _loc3);var _loc5 = swfRoot + dataObject.path + dataObject.id + "_" + _loc3 + ".jpg";var _loc4 = _loc2.createEmptyMovieClip("imageHolder", 1);_loc2.id = _loc3;_loc4.loadMovie(_loc5);
I am importing layers from my Photoshop file to Flash to create a Flash Banner ad using CS5. My Banner size is set-up in PS as 160x600 72DPI. Are there any tricks to getting my file size down without losing anymore resolution when importing to the flash Stage?
View 1 RepliesCan I get the height of an image from its URL information in ActionScript 3? I have the image URL. I want to draw the image in my UI and I want to set the height of the drawing area dynamically upon getting the image.
View 2 Repliesi have this source in flex - easy program which switch between two states..in second state is show myImage component
<?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"
[code].....
In my Flex application I load an image into the Image control. After loading the image I can apply filters like color transform or grayscale etc and then I want to save the image with the filter applied. I am having trouble saving the image with the filters applied. With the following code the Image gets saved without the filters.However, if I use [code]...
View 1 RepliesI have a swf and the background image looks bad in a monitor 1680 x 1050 , it get cutTo define this in flash, I hace to edit my image to this size 1680 x 1050, but in flash How would I define this?. Can it be done in html code?
View 1 RepliesI am using bitmap to load the image, if the image size is more than 2880 h/w I am getting an error.[code]...
View 2 RepliesI'm loading images from xml file. I want the images to have standard width when they are displayed.
Here are the snippets of the code that do the image processing:
var allThumbs:MovieClip = new MovieClip();
addChild(allThumbs);
allThumbs.width = 200;
allThumbs.height = 200;
[Code].....
this lines, where I wanted to resize the images before they show up in the ScrollPane.
I am wondering if there is any way to determine the width and height of an image that is decoded to a ByteArray.For example in the below, any way to determine these values for data?
var data:ByteArray = new ByteArray();
data = encoded_image.decode(byteArrayData);
I am using flash 8. and i have one .Jpg image (1024 x 768px) now i want to load this image to my Movieclip. But my movieclip size is 130 x 140px. how is it possible to load and fix this movieclip size.
View 0 RepliesHow do I set the image size of an externally loaded image? The external image is 80x80, but when I load the image into my scrollBar I need it to be 1/2 that size. I tried setting the loader width and height but that make the image disappear completely. I suppose I am missing something fundamental?[code]...
View 2 RepliesI am attempting to fit an image to any size browser. Make it the whole page width and height and re size to any browser.
View 0 RepliesI've got a component with a few classes like this:
Code:
[Embed(source='assets/images/Road Works Signs/TW-01_0A.png')]
public static var RW0Icon:Class;
[Embed(source='assets/images/Road Works Signs/TW-01_0B.png')]
public static var RW1Icon:Class;
And I am calling them and adding them to a button in another module like this:
Code:
var a:int = 0;
while (a < 6)
{
[code]....
I'm just having trouble trying to change the size of the image. I want to be able to change height/width the image embedded in the RW0Icon class, but don't know how to reference it.
how to zoom in an image the same size and move.... for example, [URL] on the site menu.
View 4 RepliesHow can i do image size fixed on this carousel help with as 2.0 ? [URL]
View 5 RepliesI am loading an external image into AS3. The image comes in quite large, and I am simply trying to make it 200h x 200w. In AS3 using FlashCS3, you can do this:
Code:
import fl.containers.UILoader;
var myLoader:UILoader = new UILoader();
myLoader.height = 200;
myLoader.width = 200;
myLoader.load(myImage)
That works fine in AS3 using FlashCS3, however is not supported in FlashCS4. Why? Who knows, but my guess is that there is another simpler way to do it, even though you can't get much simpler than that. I have tried using the standard loader:
Code:
var myLoader:Loader = new Loader();
and tried to change the dimensions, but it was a no go. Also tried making a movieClip and a Sprite and loading the image into them and changing their dimensions, but then the image disappears entirely and doesn't work.
i want to change image size in slideshow.
View 2 RepliesI have a loop where I load a couple of images and I want to place them in the y-axis on stage, with 20 pixels space between them. To do this I have to know the height of each image, but as you know, I can't get the image height before it completed loading.I really don't want to do one loop for the loading, and another loop for the placing.
Code:
for (var i=0;i<productXml.productCategory.product.length();i++) {
var product_mc:MovieClip = new MovieClip();
var imgLoader:Loader = new Loader();[code].....
I'm loading images from an XML file and I know what the image name is, however this is in a string variable. How can I get the dimensions of the image from this?
View 1 RepliesHow do I make a vector image smaller in file size than a jpg image? This sounds perhaps strange since vector in general is expected to be smaller in file size then pixel.
But take this image for example:
I can get this to about 8 kb if I were to use 'save for web' in photoshop (jpg / low compression). But then I thought I perhaps could get it even smaller by vectorizing it. But that resulted in an image of about 145 kb. Is vector not always better than pixel when it comes to file size?
I already have an image that gets resized. Is there an easy way to add a text box on the bottom of it so that it behaves the same way as the picture?
View 1 RepliesI am creating a website for a wedding and using the photos of the couple on the website. I created designs in Photoshop CS3 with the following settings:Document Size: 6.25" x 8.25" or 1875p x 2475p @ 300pixels/inch To use the image in flash, I used "Save As" in photoshop to convert image into JPEG with "Quality 10 Maximum" setting.I created a Flash CS3 document with the following settings: Document Size: 6.25" x 8.25" or 494 x 550 pixels I imported the JPEG image from photoshop into flash and came in an image much larger than 6.25"x8.25". I resized the image in flash with constrained dimensions to 494x550 pixels and it the text shadows and glow lost its clarity.
TRIAL 1Obviously something was wrong. So, I went back to Photoshop and used the save for web/devices option and saved it as a high quality JPEG. Same result.
TRIAL 2This time, I tried a different trick in Photoshop. I went to Image->Image Size and changed the image resolution to 150pixels/inch and used "Save As" again. I imported it again to Flash and now the image was too small.
How do I match the image "save as" from photoshop to the flash document size so that I dont lose resolution? I used Zoomify in photoshop successfully without losses. Why is it not possible to just import an image to look the same way a JPEG file appears?
I am including a image on SWF file (using Flash CS4) i want images to keep its original dimension whether user fullscreen the SWF movie or play it on windows.
currently i do not have any action script or coding on my .fla file. when i publish the movie and fullscreen it, the image i put in fla file get all stretched out and blur.
How can I create a player in flash cs4 so that it resizes dynamically to fit the size of the images am trying to add in the 'slideshow'?
View 2 Replies