all groups > flash actionscript > february 2006 >
You're in the

flash actionscript

group:

MovieClipLoader help


MovieClipLoader help esplwebdesign
2/14/2006 11:41:18 PM
flash actionscript: I am following a tutorial on kirupa.com, but it uses MovieClipLoader, and
MovieClipLoader.onLoadInit. This is only available from Flash 7 / MX 2004, but
I only have 6 / MX. Can I download the MovieClipLoader object, or is there
another way to do it?

Thanks in advance,
Shai
Re: MovieClipLoader help abeall
2/15/2006 12:00:00 AM
Hm... there may be a MovieClipLoader Class for MX...

Otherwise, yes there is another way to do it. The basic key to making sure a
movie is fully loaded is this:

if(movie.getBytesLoaded()/movie.getBytesTotal() && movie._width!=0)

bytesLoaded/bytesTotal because that way if its 85646/85646 you get one, but if
it hasn't started yet and thus is 0/0 it doesn't think it's done

_width != 0 because sometimes even after all bytes are loaded, the clip
evidentally hasn't been initialized yet... perhaps same difference as
MovieClipLoader.onLoadComplete and MovieClipLoader.onLoadInit

So your script would instead of being:

myMovieClipLoader.onLoadInit = function(){}

would be be:

myMovieClipContainer.onEnterFrame = function(){
if(myMovieClip.getBytesLoaded()/myMovieClip.getBytesTotal() &&
myMovieClip._width!=0){
//loadInit
}
}
AddThis Social Bookmark Button