Link to home
Start Free TrialLog in
Avatar of samuels27921
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");
}
};

Open in new window

Avatar of Antonio Estrada
Antonio Estrada
Flag of Mexico image

How about this:

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(queryStringArgument);

before the loader1.onLoad handler

-V
Avatar of samuels27921
samuels27921

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?
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";
  }
}

SOLUTION
Avatar of Antonio Estrada
Antonio Estrada
Flag of Mexico image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Very Close Vulturous! I designed the perfect code with what I was doing before you posted this!

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());

Open in new window

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