PDA

View Full Version : Smoothing images loading dynamically !!



secret007
February 17th, 2009, 09:35 AM
Hi,

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..


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

but i gives me the following error..


[TypeError: Error #1009: Cannot access a property or method of a null object reference.
at BaseClass/::loadimage()
at flash.events::EventDispatcher/flash.events:EventDispatcher::dispatchEventFunctio n()
at flash.events::EventDispatcher/dispatchEvent()
at flash.net::URLLoader/flash.net:URLLoader::onComplete()

anyone comes up with the solution...

.ral:cr
February 17th, 2009, 12:43 PM
i don't think will work what you have there. you have to load the photo, create a bitmapdata from it, and then attach back to stage with

this.addChild ( new Bitmap (bitmap, PixelSnapping.AUTO, true) );

Felixz
February 18th, 2009, 10:32 PM
Imageload.content is accessed before it actually loads... use event listener.

bonnieraymond
February 19th, 2009, 12:01 AM
OT: you should use "images/", not "images\\"