Flash loader component failing to scale down loaded pictures

Hi,

I’ve ran into this bug recently and tried to find a solution, a quick google search returned no answers to the issue so I thought I would post about the problem here and also post the solution / workaround I found.

The problem is that the loader component (flash 8 AS2) is not scaling down the loaded jpg (unless the latter are cached by the browser) despite the fact that I have set the scaleContent property of the component to true via the component inspector panel (and even tried to set it via actionScript code), so as soon as the picture is loaded, it displays or renders to the screen with its original dimensions, if you refresh the page, it will scale down correctly.

Just a side note here, this has happened while I was using multiple instance of the loader component each loading a different jpg having a unique contentPath.

The solution I found is simply to preload the pictures I intend to use first using the MovieClipLoader class and then to set the contentPath property of the instances AFTER the images have been fully loaded (and thus cached by the browser). This solution works.

 

PS: you’ll have to test online to reproduce this since flash loads local content differently.

 

 

 

Leave a Reply