ActionScript 2.0 :: Smoothing Images Using BitmapData And MovieClip.attachBitmap

Mar 12, 2007

When you load an image into a MovieClip then use that as the data source to draw() into a BitmapData object, the documentation says "Optionally, you can specify whether the bitmap should be smoothed when scaled. This works only if the source object is a BitmapData object." To me that implies that a second BitmapData object is needed in order for the optional [smooth:Boolean] parameter to work when set to true.

We found we didn't need to "double buffer" in this way when using MovieClip.attachBitmap() with the [smoothing:Boolean] parameter set to true. We did run into another problem though. This problem only manifests itself when you run the SWF as part of an HTML file running from a local web server like http://127.0.0.1. Here's the problem: images are loaded dynamically (URL's pulled from assets.xml) and the ones that are loaded locally from a directory on the same machine load and are smooth and distortion free. Other URL's point to a remote host. The images loaded via a remote source (example) do not "smooth nicely" running the exact same code as the local images. The remote images are shimmery and exhibit update artifacts. If you run the exact same page not via an http:// web sever i.e. - just loading the html page into the IE, then the remote images do get nice smoothing when animated.

Is there some magic to get BitmapData loaded from a remote source to smooth correctly when run from a local web sever? For our internal demo we removed any remote URLs so we could demonstrate that Flash does provide the ability for nice smooth animations but it would be a good problem to solve.

View 2 Replies


Similar Posts:


ActionScript 2.0 :: Flash8 - BitmapData Smoothing Resized Images

Feb 23, 2010

I'm trying to dynamically resize a set of images that are being loaded through the MovieClipLoader class. The code below seems to work, except that the images do not appear to be 'smoothed' at all...

[Code]....

View 7 Replies

ActionScript 2.0 :: Dynamic Image Resize + BitmapData Smoothing?

Sep 11, 2007

I'm creating a dynamic image gallery that resizes the images to fit the gallery size, and then smooths them out.I feel like I'm super close to getting it to work perfectly. The image smoothing always works, but the resizing is kind of iffy. The first image displayed will resize just fine, but when you view any others they're all distorted or squashed. What's strange is that I've traced out the resized image dimensions and they're exactly what they should be, but the images are still not resizing correctly.

Here's my code! I only included the parts of it that are really relevant, but let me know if you guys want to see all of it. It's a combination of a few tutorials that I found. I may be able to provide a live example, but it's for work so I'm not sure how the nondisclosure agreement would affect that.

Code:
var thisWidth:Number;
var thisHeight:Number;
var maximumHeight:Number;//height to which movieclip to be resized

[code].....

View 2 Replies

ActionScript 3.0 :: Applying Smoothing To XML Images

Feb 12, 2009

Ive searched and found this property .smoothing = true; But since im not using any bitmap vars i dont know where to put it, or maybe is it impossible to smooth images from my code and i need to rewrite it with bitmap stuff?

PHP Code:
var myXML:XML = new XML();
var XML_URL:String = "newsXML.xml";
var myXMLURL:URLRequest = new URLRequest(XML_URL);
var myLoader:URLLoader = new URLLoader(myXMLURL);
myLoader.addEventListener("complete", xmlLoaded);
[Code]....

View 1 Replies

ActionScript 3.0 :: Applying Smoothing To XML Images?

Feb 12, 2009

way to smooth my images via ac3. Ive searched and found this property .smoothing = true; But since im not using any bitmap vars i dont know where to put it, or maybe is it impossible to smooth images from my code and i need to rewrite it with bitmap stuff?

ActionScript Code:
var myXML:XML = new XML();
var XML_URL:String = "newsXML.xml";

[Code].....

View 2 Replies

ActionScript 2.0 :: Loaded Images Allow Smoothing?

Nov 18, 2009

How do I turn that on with actionscript when I load several images in my flashmovie?

View 4 Replies

ActionScript 2.0 :: Flash8 Smoothing Loaded Images?

Mar 10, 2010

Okay, so this little peice of code works perfectly. The author of this code has set the code up so it loads the file you want, and scales it to 150% and rotates it 15 degrees, the problem is, I cant see where in the code you can set what to scale it by or rotate,

Actionscript Code:
]_global.smoothImageLoad = function(imgURL, targetMovie) {var i=0do { i++ } while (eval("_root.smoothImageLoadTemp"+i) != undefined)tmc = _root.createEmptyMovieClip("smoothImageL� _root.getNextHighestDepth())tmc.createEmptyMovieClip("ti", tmc.getNextHighestDepth())tmc.tm = targetMoviewith(tmc) {tmcl = new MovieClipLoader()tmcl.onLoadComplete = function() {ti.onEnterFrame = function() {pixelData = new [code]....

View 2 Replies

ActionScript 3.0 :: Smoothing Multiple Images Dynamically?

Sep 8, 2011

I have a loop which is trying to load a folder full of images into my scene, the images are going to be scaled to roughly 80% of their original size (they get scaled back to 100% so they need to stay at their current size) the loop will always get the right amount of images for the images in the folder so there isnt going to be any problems about it not not finding or loading pictures etcWhen i have tried doing it recently I have my loop load my images, once the image has finished loading it calls a function which takes the data and adds it to a bitmap, which is then smoothed. The problem seems to be it only adds one of the images to the stage when its done, does anyone know the specific way of adding a large amount of images to the stage, do you have to add all the images to a list and then run the bitmap smoothing on each item in the list?

View 13 Replies

Flash :: Allow Smoothing In Externally Loaded Images?

Mar 5, 2010

In Flash, I can go into the properties of an image in the library and check 'allow smoothing' to enable resampling when the image is scaled or rotated.

How can I achieve the same effect for images loaded dynamically by the SWF from an external URL?

View 2 Replies

ActionScript 2.0 :: Allow Smoothing For Dynamically Loaded Images?

Aug 18, 2009

as you surely know, setting a picture in your library to "allow smoothing" makes it high quality while resizing, rotating, etc with it on the scene.

Now I'd like to know how to set this to a picture you externally load while playing, cause obviously you can't set its parameter "allow smoothing" to true in the library, it'll never be in your library...

I found one thing that draws a bitmap, copies the pict, etc, but it's very slow at usage. I need something faster but the quality of the image must be perfect.

View 5 Replies

ActionScript 3.0 :: Smoothing Images Loading Dynamically?

Feb 17, 2009

i m loading images dynamically from a folder and i want when they show on the stage they retain their quality for that purpose i use 2 things first is

stage.quality = StageQuality.BEST;

and the second is with bitmap class after loading the images in loader i write..

PHP Code:

Imageload.load(new URLRequest ("images\"+xml.images[k]));var image:Bitmap = Imageload.content as Bitmap;image.smoothing = true; 

[Code]....

View 3 Replies

ActionScript 3.0 :: Image Smoothing On Dynamically Loaded Images?

Jul 28, 2009

I bought and installed a component and now the place I got it from is not giving support and their site has been pulled. The issues is that I can't figure out how to convert the loaded images into bitmaps in order to apply smoothing. Can someone look at the code in the attached .fla and give me a heads up as to where to add i

View 8 Replies

ActionScript 2.0 :: Dynamically Smoothing Loaded Images (Child MC)

Nov 19, 2011

I'm trying to make smoothing for images which loaded with loadclip(). I found function for smoothing and it works but only for movieclips located in _level0, for example _level0.mc, but I want to smooth children MC, for example _level0.parent_mc.children_mc and then image just disappears. Smoothing function:

here = this; // trace(here) == _level0
bg_smooth = function (bg):Void {
var bg_depth:Number = bg.getDepth();
var bg_name:String = bg._name;
var bg_parent = bg._parent;
[Code] .....

Also tried to write _level0.parent_mc['children_mc'] instead of parent_mc.children_mc and to make here == _level0.parent_mc - still no luck. If I remove bg_smooth (element) on load complete then all works fine but of course smoothing disabled.

View 1 Replies

ActionScript 3.0 :: Access The Smoothing Property Of The PNG Images Within WindowHider's Timeline, From The Document Class?

Mar 20, 2010

I have a MovieClip in my library called WindowHider. The timeline for WindowHider contains a frame-by-frame animation that is made up of individual PNG images that I imported. Each of the 10 or so PNG images sits on it's own frame within WindowHider.I can successfully create an instance of WindowHider within my Document class and add it to the display list.

Question: Is it possible to access the smoothing property of the PNG images within WindowHider's timeline, from the Document class? The WindowHider class is animated and rotates, thus the pixels show and the image is jagged. I know if I could access the smoothing property it would solve the issue.

View 2 Replies

ActionScript 2.0 :: Attaching PNG Data With AttachBitmap?

Jul 30, 2009

I'm reprogramming a particle explosion system for a game I'm making with AS 2.0 and I got troubled with the process of loading a attaching images dynamically inside a movie clip. The following code will explain better what I mean:

var myBmp:BitmapData = BitmapData.loadBitmap("fire.jpg");
var particle_mc = createEmptyMovieClip("main_holder", getNextHighestDepth());
var internal_holder:MovieClip =

[Code]...

View 2 Replies

ActionScript 3.0 :: Bitmap Smoothing On A Graphic Already Placed Inside A MovieClip?

Feb 19, 2009

I have searched several threads, and no answer has been found to apply a bitmap smoothing to an image already inserted inside a movie clip on stage (not dynamically loaded). Any suggestions on what to do to apply smoothing to an image inside a clip? Trying to come up with an answer as I am getting a funny fuzz around a logo that I'd like to see disappear. It appears clean and crisp within the png file, but not in the compiled swf.

View 4 Replies

ActionScript 2.0 :: AttachBitmap/aspect Ratio Not Working Until Browser Resized?

Jun 15, 2007

I'm working on a large bitmap background site and for some reason, I can't get the bitmap to resize (with the correct aspect ratio) upon loading. It only works after the window has been resized. When I try to call the function after the bitmap has been loaded it displays nothing until the window is resized.This is my Actionscript:

ActionScript Code:
import flash.display.*;
// this tells Flash NOT to allow the assets to be scaled

[code].....

View 3 Replies

ActionScript 3.0 :: Sharp Images With BitmapData

Dec 12, 2009

I'm scaling down images loaded from as3 and I want them to stay sharp. They are scaled because I have a liquid layout which resizes a "body" movieclip that contains the images (loaded from xml).

I used code from here to scale bitmap, but I don't really understand it. [URL]

My biggest problem is that since the images are loaded as displayObjects rather than bitmaps, I need to know how to change the bitmapData of each displayObject.

Second problem is that I need the code the change the data, but not scale it down also(it is already scaled down). How do I do that?

Here is my attempt...

Code:
//code is executed when image is first loaded (I don't care if it is resized afterwards)
//thumb is the displayObject that is my image

[Code].....

View 1 Replies

Actionscript :: MovieClip Replacement That Converts An Existing Imported MovieClip To A Sequence Of BitmapData

Jun 22, 2011

I've written a simple MovieClip replacement that converts an existing imported MovieClip to a sequence of BitmapData. This removes the requirement for Flash to render vector data in the MovieClip on each frame.

But BitmapData has a huge memory footprint. I've tried converting the BitmapData to a ByteArray and using the compress() method. This results in a significantly smaller memory footprint. But it has proven impractical. For each redraw, I tried uncompressing()'ing the ByteArray, then using SetPixels to blit the data to the screen, then re-compressing() the frame. This works but is terribly slow.

So I was wondering if anybody else has an approach I could try. In Flash, is it possible to compress bitmap data in memory and quickly blit it to the screen?

I wonder how native animated GIFs work in Flash. Does it uncompress them to BitmapData behind the scenes, or is frame decompression done on the fly?

View 1 Replies

Actionscript 2.0 :: BitmapData And Local Vs Remote Images

Feb 27, 2012

I am creating an interactive post-it for an upcoming event that allows for us to tap into a sql database and post tweets, survey answers and images. We've already tapped into the Twitter API and the survey, so those are A-OK.The problem lies within loading the images from a location other than the local interactive board's server.If the image itself is locally hosted, it loads just fine.If the image is hosted elsewhere, the image will not load, even though I have a trace on the URL of said image.I'm loading all tweets, surveys and images through an XML load and all the data is loading properly.I AM loading the image through a smoothing filter so that when the "post-its" are slightly rotated, they are not jagged. Here is THAT code:[code]

This is a two part script where the bulk loads in the image and places it into an empty movieclip, then adds the smoothing filter. The second part is a resizer that automatically resizes the image and keeps the aspect ratio.When I test the flash piece (not embedded in HTML) the thing works 100%.As soon as I put the swf into an html and view it on a web page, the remote images will not load.I'm a bit stumped on why this is, could this be a firewall or security issue? Because I work in a high security firewall environment.

View 1 Replies

ActionScript 3.0 :: Load Images From Library With Bitmapdata?

Jan 20, 2010

As my as3 skills are not good, I stumbled against this problem, my approach in overall will probably not be the easiest, but here it goes:

In the library of my fla file I have imported 4 pictures, in the properties (class) I gave them the name photo0, photo1, photo2, photo3. With my code on the time line I create dynamically 4 movieclips and now I want to attach photo0 to movieclip 1 and photo 2 to movieclip 2 and sofort...

Is there a way to give the bitmapdata name also a dynamic name, something like[code]...

View 3 Replies

Flex :: Bitmapdata From Multiple Images (drag & Dropped)

May 29, 2011

I have an image loaded from BitmapData displayed in an Image control. This Image control has dragEnabled and user can drag and drop small images (from a bunch of images in a TileList) on top of it.

The image loaded from the Bitmapdata can be different every time with different resolution and the Image control scales it down to fit its fixed with/height. But while saving the image after editing I am saving it with its original width/height. For this purpose I am storing the original Bitmapdata in a temp object and applying any edits there before saving.

how to create an image combining the Large image and the small images dropped into it. May be I can use display object snapshot but then I want to save the image with its original with/height and preferably after converting it to Bitmapdata.

View 2 Replies

ActionScript 2.0 :: Scale Down Flash Images Using BitmapData And Matrix?

Feb 4, 2008

how to scale down flash images using BitmapData and Matrix?? I'm using it for fullscreen so that the images are always perfect. I've been tampering with this, but cannot get it to work properly.

View 3 Replies

Actionscript 3 - Loading Giant Images Into Flash - Exceeding The BitmapData Limitations?

Nov 29, 2011

I am trying to let the user import giant images into a flash application. Unfortunately the BitmapData object's dimensions cannot exceed "8,191 pixels in width or height, and the total number of pixels cannot exceed 16,777,215 pixels" (see Reference)

Obviously with FlashPlayer11 these limitations vanish - BUT: As I only get bytes from the FileReference, I need to convert these via Loader.loadBytes(), to get access to the image data. This doesn't seem to work for images exceeding the old BitmapData limitations.

[Code]...

View 1 Replies

ActionScript 3.0 :: BitmapData Cuts Off MovieClip

Aug 11, 2009

I'm having this annoying proble with BitmapData. I try to turn a movieclip into a bitmap, but there is always white space to the right and bottom. At the top and left, it is obvious that part of the movieclip was cut off. However, the width and height of the bitmap are correct. In other words, white space takes up where the rest of my movieclip should go. About 30% of the bitmap is white.I have a method that creates a grid based on an array. The Wall class extends MovieClip. Each wall is a 70 x 70 movie clip that looks like a stone (its x and y are established within the class itself).[code]I have messed around with changing the registration using a class I found online, but it didn't fix anything. In fact, changing the registration made no difference. Also, I have called addChild(walls), and everything is displayed correctly. But for performance reasons, I need to make it a bitmap.

View 2 Replies

ActionScript 1/2 :: MovieClip Pixel Manipulation With BitmapData

Jan 30, 2010

I have a MovieClip in the library exported for actionscript. How do i convert or attachMovie it to a BitmapData class so that i can manipulate its pixel data? I will need that so that i can distort the MovieClip.

View 3 Replies

ActionScript 3.0 :: Using BitmapData To Screenshot A Movieclip - Set The X And Y Position?

Sep 20, 2009

I am trying to snapshot a movieclip at X and Y by WIDTH and HEIGHT. All is fine, it snapshots fine and gets the width and height, but I can't adjust the x and y position for it to begin the snapshot at. I tried using a Matrix and its Matrix.translate() method, I tried moving the scroll beneath the draw method line. I don't understand how to get this thing to move.

[Code]...

View 7 Replies

ActionScript 3.0 :: Render Bitmapdata / MovieClip On Text

Jan 21, 2011

I got a requirement to render movieClip on text.URL...I need to replicate the beeded text part.

View 1 Replies

ActionScript 3.0 :: BitmapData.draw() And Embedded MovieClip?

Jan 26, 2011

I know half of the problem:the embedded movieclip is "content" of a Loader, and you can not draw Loaders directly with bitmapData.draw(aLoader);with a normal Loader, you could access the Loader.content and draw it but not in the embedded case.adobe forums could not give an answer to this and i searched for hours through the web ...

[Embed(source="aMovieClip.swf")]
private static var AMovieClip:Class;
//...

[code]....

View 3 Replies

ActionScript 3.0 :: Extract Bitmap Or BitmapData From MovieClip?

Jun 28, 2007

I've been looking for a solution for hours now. I have a movieclip which contains an image. Created by doing: put image on stage, convert to symbol, movieclip type, ok.I'd like to extract this bitmap because I want to use (somewhere else): graphics.begintBitmapFill(); but this method needs a BitmapData object and not a movieclip to create a repeating background (in my case).

So: how do I extract the Bitmap or the Bitmap data from a MovieClip?mind that attaching BitmapData as a base class to this symbol is NOT AN OPTION

View 11 Replies







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