Today I tried to load an image form an url and apply it to a background, well appears like setStyle don’t have the ability to load an image from URL.
So I had to look another alternative, I load the image using an Loader, but I couldn’t found a way to apply it to the background style, I did a workaround, I draw it on the graphics object, I guess it is helpful because the image is titled, but I will try more options I didn’t quite like 100% this solution.
IMPORTANT : dont’ forget the security restrictions of doing this, remember that flash can’t load images from another domain, and www.zerokernel.com is different to zerokenel.com, see Adobe for more information ( Player 9 restrictions from Adobe – PDF )
Anyway, here is the demo:
http://zerokernel.com/demos/flex/backgroundChanger/
And the code:
http://zerokernel.com/demos/flex/backgroundChanger/BackgroundChanger.zip
