Rouchie
asked on
Assets appear before movie is loaded
I am loading a movie into an empty placeholder using the MovieClipLoader object. Currently I see that if the file is large, certain assets within it (video etc) start to appear within the placeholder before the entire file is loaded. Therefore I want to hide the placeholder until the movie is fully loaded into it.
My code is below, except that something is wrong because I am still seeing the movie's assets appearing within the placeholder, when surely the placeholder shouldn't even be visible! Can anyone spot my mistake?!?
var my_mcl:MovieClipLoader = new MovieClipLoader();
var my_listener:Object = new Object();
my_listener.onLoadStart = function(mc) {
preloaderStatusText._visib le = true;
preloader._visible = true;
preloader.preloadbar._xsca le = 0;
};
my_listener.onLoadProgress =function( mc,loadedB ytes,total Bytes) {
preloaderStatusText.text = "Loading content (" + Math.round(loadedBytes/tot alBytes * 100) + "%)";
preloader.preloadbar._xsca le = Math.round(100*loadedBytes /totalByte s);
};
my_listener.onLoadComplete =function( mc) {
this.placeHolder._visible = true;
preloaderStatusText._visib le = false;
preloader._visible = false;
};
my_listener.onLoadInit=fun ction(mc) {
placeHolder._width = borderOutline._width;
placeHolder._height = borderOutline._width;
};
my_mcl.addListener(my_list ener);
this.placeHolder._visible = false;
my_mcl.loadClip(fileURL, this.placeHolder);
My code is below, except that something is wrong because I am still seeing the movie's assets appearing within the placeholder, when surely the placeholder shouldn't even be visible! Can anyone spot my mistake?!?
var my_mcl:MovieClipLoader = new MovieClipLoader();
var my_listener:Object = new Object();
my_listener.onLoadStart = function(mc) {
preloaderStatusText._visib
preloader._visible = true;
preloader.preloadbar._xsca
};
my_listener.onLoadProgress
preloaderStatusText.text = "Loading content (" + Math.round(loadedBytes/tot
preloader.preloadbar._xsca
};
my_listener.onLoadComplete
this.placeHolder._visible = true;
preloaderStatusText._visib
preloader._visible = false;
};
my_listener.onLoadInit=fun
placeHolder._width = borderOutline._width;
placeHolder._height = borderOutline._width;
};
my_mcl.addListener(my_list
this.placeHolder._visible = false;
my_mcl.loadClip(fileURL, this.placeHolder);
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
That's absolutely perfect - many thanks.
-- R