View Full Version : MovieClip.onLoad fix
h88
December 12th, 2002, 10:01 AM
When Loading an swf, and invoking the onLoad handler, it wouldn't work. However, when using Bokel's fix, it'd work-out that issue.
http://chattyfig.figleaf.com/ezmlm/ezmlm-cgi?1:mss:49174
h88
January 24th, 2003, 09:04 PM
Another clever solution made by FlashGuru which involves loading an swf directly from an instance of the LoadVars Class. However, there are cases, though, for which it returns a 404 error.
fileExists = new LoadVars();
fileExists._parent = this;
fileExists.onLoad = function(success) {
//success is true if the file exists, false if it doesnt
if (success) {
//the file exists
var nm = this._parent.createEmptyMovieClip("swfHolder", 1);
//so create a movieclip
nm.loadMovie("myfile.swf");
//and load our .swf file into it
} else {
trace("error");
}
};
fileExists.load("myfile.swf");
//initiate the test
For more information, see FlashGuru's article:
http://www.flashguru.co.uk/000310.php
pom
January 24th, 2003, 09:26 PM
:stunned: :stunned: :stunned:
Powered by vBulletin® Version 4.1.10 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.