samuels27921
asked on
How do I fix my onload and loadmovie code?
I have a URL Query String Generated Flash Site and I need this code so that when it can not find the swf typed it will return with an Error. Here's my code that I thinks should work.
loader1.onLoad = function() {
if (success) {
pagetxt.text = ("Page Found");
} else {
pagetxt.text = ("File Not Found");
}
};
ASKER
I dont know what you mean. I used javascript to pass the query string to flash with variables. How do you use that query string and how can i encorporate that with my loader. What does querySringArgument; do?
ASKER
Also I tried that it alway's return false.
-quote-
How about this:
loader1.onLoad = function(success) {
if (success) {
pagetxt.text = "Page Found";
} else {
pagetxt.text = "File Not Found";
}
}
-quote-
How about this:
loader1.onLoad = function(success) {
if (success) {
pagetxt.text = "Page Found";
} else {
pagetxt.text = "File Not Found";
}
}
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Very Close Vulturous! I designed the perfect code with what I was doing before you posted this!
Thanks
Thanks
//Provides Error Page
var loadListener:Object = new Object();
loadListener.onLoadError = function(target_mc:MovieClip, errorCode:String, httpStatus:Number) {
//Display's Error Log in to the Flash Text Boxes
trace(">> loadListener.onLoadError()");
stattxt.text = ("==========================");
pagetxt.text = ("ERROR "+errorCode);
httptxt.text = ("httpStatus: "+httpStatus);
redirect.play(); //plays a count down redirect movie clip
};
//Listens for Errors
var mcLoader:MovieClipLoader = new MovieClipLoader();
mcLoader.addListener(loadListener);
var mc:MovieClip = this.createEmptyMovieClip("mc", this.getNextHighestDepth());
ASKER
Thank You
mhh, that's a quite nice approach :)
I don't think I've ever actively used the MovieClipLoader class, might give it a shot sometime... In the end; glad you got it working!
-V
I don't think I've ever actively used the MovieClipLoader class, might give it a shot sometime... In the end; glad you got it working!
-V
loader1.onLoad = function(success) {
if (success) {
pagetxt.text = "Page Found";
} else {
pagetxt.text = "File Not Found";
}
}
I assume you're using something like
queryStringArgument = argument;
loader1.loadMovie(queryStr
before the loader1.onLoad handler
-V