This content has been marked as final. Show 9 replies
1. _root0 and _root3 make no sense
2. you're removing your listener before it hears anything.
Hi, thanks for your reply.
1. I don't have any clue of "_root" really means (someone in charge of that developed it). I just know that this code works FINE when the two url are found.
2. My job is to develop a way to redirect the http request when the first and only url ( http://www.server.com/swf/fundo1.swf) is not found.
Sorry about my english. Did I made myself clear?
1. Well if it works it is really only a matter of luck. It really should be looked into because it doesn't make sense and is likely to break in the future. If they mean _level0, it generally isn't a good idea to replace the content in _level0 with external content. If they mean a movie called _root0 it isn't a good idea to give something a name like that.
2. If you want different things to happen upon the load of different assets you've either goto use different MovieClipLoaders or inside the event handlers have some conditional code that will take the correct case. Like kglad said, you are using removeListener before there is any chance of having an event occur, so there is no way for your function to get called. You can't removeListener and still be listening.
Anyway, if the first part it's working it's fine for me. No problem.
So, why this ain't working?
Does anyone have a sample code?
This ain't working to. Is it correct?
The first example looks like it should work -- maybe, except there is no way for the loader to tell if the problem is with the first or the second loadClip. There might be problems with having the swfs come from two different domains. It would probably be best to test this locally until you get it woring, before you actually try and get it working cross-domain.
The second won't work because you've got loadListener.loadListener. I don't know what that is about.
When you said the don't work, how exactly don't they work?
Additionally, you might want to add so trace statements just to see what is getting called and what isn't. So inside the onLoadError handler (just before or after the replacement loadClip, add something like this:
trace("Loading "+target_mc+" failed. Loading replacement swf.")
Try those things out.
I worked! But my is doesn't fit in the frame...
How can I resize my frame?
Welll... there are a few problems with that. You can't resize until you've loaded the content. So you need to have an onLoadInit event handler. Something like:
The problem is that you are loading external swfs and their width and height can change. So if the first frame of the clip is blank or has a small box or something, it will give a small number and then in subsequent frames it will be larger.
If you know that, for example, it just needs to come down to 90% you can just set the _x/yscale. But if it can vary you will need to come up with a clever solution.