[HTML5] 'Loader' class behavior in OpenFL vs. Flash

Hi everyone,

I use the Loader class to load pictures from URLs in the following way:

m_loader.contentLoaderInfo.addEventListener (SecurityErrorEvent.SECURITY_ERROR, OnSecurityError);
m_loader.contentLoaderInfo.addEventListener (IOErrorEvent.IO_ERROR, OnIOError);
m_loader.contentLoaderInfo.addEventListener (Event.COMPLETE, OnComplete);
	var context : LoaderContext = new LoaderContext ();
	context.checkPolicyFile = true;
	context.allowCodeImport = false;
	context.securityDomain = SecurityDomain.currentDomain;
	m_loader.load (new URLRequest (url), context);
catch (error : Error)

When a picture is loaded, I downscale it 2x in the OnComplete handler as follows:

m_loader.content.width /= 2;
m_loader.content.height /= 2;

Now I switch the application to the fullscreen mode by the following:

stage.displayState = StageDisplayState.FULL_SCREEN_INTERACTIVE;

Here comes the difference between OpenFL and Flash. For example, the original picture I was loading was 100x100. Upon loading it, it would be downscaled to 50x50 and would be displayed as 50x50 in the normal mode. Let’s say the picture would occupy 90x90 physical screen space after switching to the fullscreen mode. What Flash would do in this situation would be taking the original 100x100 picture and downscaling it to 90x90 and displaying it in the fullscreen mode. What OpenFL seemingly does after going fullscreen is taking the downscaled 50x50 picture and upscaling it to 90x90 and displaying it in the fullscreen mode, which results in ugly pixelation.

Is there a way to mimic Flash’s behavior in this situation?