Jeff from Custom Logic posted on the Flash Lite mailing list about a problem with MovieClipLoader. Basically, if you remove the MovieClip via removeMovieClip that is used in the load operation for the MovieClipLoader.loadClip, as soon as the image loads, you’ll get a “Unable To Load Data” error. For some reason this race condition is handled fine in Flash Player 9 and below, as well as the Flash Lite emulator in Flash 8, but not in Flash Lite 2.
Solution is to encapsulate the load operation & removing of the MovieClip in a class that generates an event upon success since it cannot happen immediately.
Non-class example (tested and works):
function init()
{
mcl = new MovieClipLoader();
mcl.addListener(this);
load_btn.onPress = function()
{
this._parent.doLoad();
};
kill_btn.onPress = function()
{
this._parent.doKill();
};
abortFurtherLoading = false;
isLoading = false;
fscommand2("FullScreen", true);
}
function doLoad()
{
if(isLoading == false)
{
isLoading = true;
if(image_mc) image_mc.removeMovieClip();
createEmptyMovieClip("image_mc", 0);
mcl.loadClip("http://www.some.com/image.jpg", image_mc)
}
}
function onLoadInit(p_mc)
{
isLoading = false;
if(abortFurtherLoading)
{
abortFurtherLoading = false;
removeTheClip();
}
}
function doKill()
{
if(isLoading == true)
{
abortFurtherLoading = true;
}
else
{
removeTheClip();
}
}
function removeTheClip()
{
image_mc.removeMovieClip();
delete image_mc;
}
init();