I have a small flash file that just loads and shows one image scaled to fit inside the content area. We use these with a javascript gallery so we have several instances on one html page (embedded with swfObject) I’ve been using MovieClipLoader to load the jpgs but it no longer works.
We updated the server and as far as I know only relevant thing that has changed is cache related. Previously all images and swfs were always reloaded. Now they should be loaded from cache.
I can see from firebug that the swf is actually loading the jpg it just doesn’t display anything. This happens on many browser/os/flash plugin combinations. Sometimes some of the images show, sometimes none.
The code inside moviecliploader event handlers (onloadinit, onloaderror) is never run.
Any ideas on how to get this working would be appreciated.
I found a solution.
Turns out the problem had something to do with cache but nothing to do with the MovieClipLoader.
I was scaling the loaded image based on Stage.width and Stage.height. What I found out was that flash will sometimes give a width and height of 0 for a short period of time. This may happen even if there is stuff visible on stage. previously this was not a problem since the dimensions were correct once the image loaded. Now when the images come from a cache the dimensions are sometimes 0.
the solution was to check the stage dimensions in an onEnterFrame handler and only proceed with the loading in case the dimensions are > 0