However, one of the vignettes had a custom cursor in it, which would hide the regular cursor. The end result of this was that when I preloaded that SWF, it would execute that code and hide the cursor for the movie before displaying that vignette.
The solution was to use URLLoader to load the vignettes to get them into Flash Player's cache, and then, when they were needed, using the Loader class to load them into the engine:
import flash.net.*;Using this method, you could preloadSWF() the MovieClips you will need later, and the Flash Player will put them into the cache. Load the MovieClips normally using the Loader() class, and Flash Player will pull the SWF's from the Flash Player cache instead of downloading them again from the web server.
public class SWFPreloader {
public function SWFPreloader() {
// Preload a list of SWFs here, or call preloadSWF()
this. preloadSWF( 'intro' );
}
public function preloadSWF( url:String ) {
var urlr:URLRequest = new URLRequest( url );
var _loader:URLLoader = new URLLoader();
_loader.dataFormat = URLLoaderDataFormat.BINARY;
_loader.load( urlr );
}
}
No comments:
Post a Comment