doomtiger
08-03-2005, 01:47 PM
Hi,
Fast note: I'm working as a corrector for flash, I'm changing and updating an web site.
I have a problem with a preloader , i had to change it so it won't use an array to load 10 swf files in order to prevent Internet Explorer from not loading after refresh (the problem was with using the cached files from Temporary Internet Files by IE).
Here it is how i looked before:
var libs : Array = [ "mooble" , "intro" , "loadbox" , "lib_popup" , "lib_classes" , "lib_fonts" , "lib_main" , "lib_intro" , "lib_utilities" , "lib_components" ] ;
this.createEmptyMovieClip ( "libholder" , 1 ) ;
var __current : Number = 0 ;
var __incr : Number = 100 / libs.length ;
this.libholder.loadMovie ( libs [ 0 ] + ".swf" ) ;
this.onEnterFrame = function ( ) {
var bytes = this.libholder.getBytesTotal ( ) ;
var loaded = this.libholder.getBytesLoaded ( ) ;
var percent = Math.round ( ( loaded / bytes ) * 100 ) ;
var scale = ( percent * __incr ) / 100 ;
var preloadscale = ( __incr * __current ) ;
if ( bytes > 4 ) preloadscale += scale ;
this.loadbar._xscale = preloadscale ;
if ( bytes > 4 && bytes == loaded ) {
if ( __current != libs.length - 1 ) {
__current ++ ;
this.libholder.loadMovie ( "http://www.mooble.com/application/" + libs[ __current ] + ".swf" ) ;
}
else {
delete this.onEnterFrame ;
this.play ( ) ;
}
}
}
stop();
so i just cutted the "var libs : Array =" and it worked fine with one exception: the preloader ended before the files were loaded, which is understandable due to no var to use for further code functions.
so i changed it more so it now looks like it:
this.createEmptyMovieClip ( "libholder" , 1 ) ;
this.libholder.loadMovie ( "mooble.swf" )+( "intro.swf" )+( "loadbox.swf" )+( "lib_popup.swf" )+( "lib_classes.swf" )+( "lib_fonts.swf" )+( "lib_main.swf" )+( "lib_intro.swf" )+( "lib_utilities.swf" )+( "lib_components.swf") ;
this.onEnterFrame = function ( ) {
var bytes = this.libholder.getBytesTotal ( ) ;
var loaded = this.libholder.getBytesLoaded ( ) ;
var percent = Math.round ( ( loaded / bytes ) * 100 ) ;
var scale = ( percent * __incr ) / 100 ;
var preloadscale = ( __incr * __current ) ;
if ( bytes > 4 ) preloadscale += scale ;
this.loadbar._xscale = preloadscale ;
if (loaded >= bytes && bytes > 0) {
if (count>=12) {
stop();
} else {
count++;
}
} else {}
}
stop();
so the thing is that i need to unload this one after the files are loaded
the function from original one is : delete this.onEnterFrame ;
this.play ( ) ;
please if anybody knows how to make it work 'couse i just have new gray hairs coused by this problem (and the boss is angry)
Fast note: I'm working as a corrector for flash, I'm changing and updating an web site.
I have a problem with a preloader , i had to change it so it won't use an array to load 10 swf files in order to prevent Internet Explorer from not loading after refresh (the problem was with using the cached files from Temporary Internet Files by IE).
Here it is how i looked before:
var libs : Array = [ "mooble" , "intro" , "loadbox" , "lib_popup" , "lib_classes" , "lib_fonts" , "lib_main" , "lib_intro" , "lib_utilities" , "lib_components" ] ;
this.createEmptyMovieClip ( "libholder" , 1 ) ;
var __current : Number = 0 ;
var __incr : Number = 100 / libs.length ;
this.libholder.loadMovie ( libs [ 0 ] + ".swf" ) ;
this.onEnterFrame = function ( ) {
var bytes = this.libholder.getBytesTotal ( ) ;
var loaded = this.libholder.getBytesLoaded ( ) ;
var percent = Math.round ( ( loaded / bytes ) * 100 ) ;
var scale = ( percent * __incr ) / 100 ;
var preloadscale = ( __incr * __current ) ;
if ( bytes > 4 ) preloadscale += scale ;
this.loadbar._xscale = preloadscale ;
if ( bytes > 4 && bytes == loaded ) {
if ( __current != libs.length - 1 ) {
__current ++ ;
this.libholder.loadMovie ( "http://www.mooble.com/application/" + libs[ __current ] + ".swf" ) ;
}
else {
delete this.onEnterFrame ;
this.play ( ) ;
}
}
}
stop();
so i just cutted the "var libs : Array =" and it worked fine with one exception: the preloader ended before the files were loaded, which is understandable due to no var to use for further code functions.
so i changed it more so it now looks like it:
this.createEmptyMovieClip ( "libholder" , 1 ) ;
this.libholder.loadMovie ( "mooble.swf" )+( "intro.swf" )+( "loadbox.swf" )+( "lib_popup.swf" )+( "lib_classes.swf" )+( "lib_fonts.swf" )+( "lib_main.swf" )+( "lib_intro.swf" )+( "lib_utilities.swf" )+( "lib_components.swf") ;
this.onEnterFrame = function ( ) {
var bytes = this.libholder.getBytesTotal ( ) ;
var loaded = this.libholder.getBytesLoaded ( ) ;
var percent = Math.round ( ( loaded / bytes ) * 100 ) ;
var scale = ( percent * __incr ) / 100 ;
var preloadscale = ( __incr * __current ) ;
if ( bytes > 4 ) preloadscale += scale ;
this.loadbar._xscale = preloadscale ;
if (loaded >= bytes && bytes > 0) {
if (count>=12) {
stop();
} else {
count++;
}
} else {}
}
stop();
so the thing is that i need to unload this one after the files are loaded
the function from original one is : delete this.onEnterFrame ;
this.play ( ) ;
please if anybody knows how to make it work 'couse i just have new gray hairs coused by this problem (and the boss is angry)