Manipulating images loaded using URLRequest

Hi guys,

So using AS3 I’ve got external images to load perfectly, the code is pretty much:

public function loadImage(url:String):Loader{
            var image:URLRequest = new URLRequest(url);
            var loader:Loader = new Loader(); 
            loader.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, loadProgress);  
            loader.contentLoaderInfo.addEventListener(Event.COMPLETE, loadComplete);  
            return loader;

This is working great, BUT i cant seem to get access to the image once its loaded. What i mean is, how can i change its dimensions, or how can i just its smoothing, any of of its properties really.

I’ve tried acessing it through the loader variable, but havent had any luck. It cant be that hard to do, seems like it would be such a common thing.


Alright turns out i figured it out :stuck_out_tongue:

Once the image is loaded so:

loader.contentLoaderInfo.addEventListener(Event.COMPLETE, loadComplete); 
public function loadComplete(event:Event):void {
            var actualImage = loader.content;
            loader.content.width = 100;

You can get the actual bitmap object from the ‘loader.content’ :party: