feathersui / feathersui-starling

User interface components for Starling Framework and Adobe AIR

Home Page:https://feathersui.com/learn/as3-starling/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ImageLoader with assigned textureCache doesn't restore after context loss

subdan opened this issue · comments

I noticed that if I set textureCache value ImageLoader doesn't restore texture after context loss.

var textureCache:TextureCache;
textureCache = new TextureCache();

var image1:ImageLoader = new ImageLoader();
image1.textureCache = textureCache;
image1.source = path_to_local_file
addChild(image1);

Could you please check it? Try to create 5 ImageLoader instances and load 5 different images by URL.

I tried the following code that forces the context to be lost, and the texture restores correctly:

var textureCache:TextureCache = new TextureCache();

var image1:ImageLoader = new ImageLoader();
image1.textureCache = textureCache;
image1.source = "https://feathersui.com/examples/tabs/images/men67.jpg"
image1.move(20, 100);
addChild(image1);

var button:Button = new Button();
button.label = "Click Me";
button.move(20, 20);
button.addEventListener(Event.TRIGGERED, function():void
{
	Starling.current.context.dispose();
})
this.addChild(button);