tags:

views:

1063

answers:

2

Hello

I'm writing custom flex preloader with extends IPreloaderDisplay class. How I can load the images from web in my custom preloader?

Thanks Vladimir

A: 

Can't you just create an image object and add it to the stage? Can you post your progess so I know which part of this to help you with?

UPDATE

Here is a general solution for the time being:

this.loader = new Loader();
this.loader.load("http://somewebsite.com/image.png");
this.loader.addEventListener(Event.COMPLETE, onLoadComplete);

public function onLoadComplete(event:Event):void {
    var thumbnail:Sprite = new Sprite();
    thumbnail.addChild(this.loader);
}
Tony
Hello TonyThanks a lot for you answer - but it don't help me. You post the code from flash to create the normal preloader. But I need the sources for Flex to change the standart Flex preloader. I extends IPreloaderDisplay class and now I can't load image from web.bestVladimir
Vladimir
+1  A: 

You can't load your preloader images from the web because the framework hasn't loaded. You need to keep preloaders VERY lightweight and don't use any framework code. Just extend Sprite and implement the IPreloaderDisplay methods but embed your images and don't attempt to load them at runtime.

Lee Probert