This content has been marked as final. Show 3 replies
I want to help you, but there are so many issues here. First and foremost is that you are using an old style of code that you really should dump. The next is that I'm really confused by exactly what the problem is. So let's do this a bit at a time.
First layers mean nothing in the published swf file. They are just a method to allow the author to organize there work. At publish time they are used to determine the stacking order of the artwork and then they are discarded. So talking about layers only confuses the issue. Instead talk about symbol instances -- movieclips, graphics, buttons, etc.
The next issue is the setProperty issues. While not directly related to your problem I just can't let this go by. It is outmoded and depreciated and goes away in newer versions of Flash. So instead of using setProperty just set the property!
The trick here is that the createEmptyMovieClip method returns a reference to the clip you just created so you can use that to reference the clip. Like this:
and so on....
Next thing is that most likely you should use loadMovie. There is a time delay between when you request an external file and when it actually gets loaded. There are also many things you can't do until the clip is loaded. In the olden days (when loadMovie was all we had) you often needed to make a "preloader" to check when the movie was loaded and it could get a little comples. Nowadays (if you are publishing for Flash 7 or later) it would be better to use the MovieClipLoader class. If you have interest in doing that, post back and we can get that sorted.
Okay finally now onto the depths issue in general. Here is a tutorial that explains everything about depths in Flash:
The basic problem I think you are running into is sort of like the floors of a tall building. You have the main timeline which is like the building. Each of its children clips are like a floor in the building and each of their children clips are like bookshelf on a given floor. So for example you've got something on the lowest level of the bookshelf on floor one. You can move it to the top of the bookshelf on floor 1, but no matter how high you move it, the highest thing on floor 1 will always be below the lowest thing on floor 2.
Now we depart from reality a bit, but imagine you can move the entire floor of a building! So now floor one is swaped with floor 2. But everything on floor 1 has to go with floor one so all of its "children" go with it. There is no way to have half the stuff on Floor 1 stay below floor 2 and the other half above.
This little idea -- that the depths count restarts each time you have a new clip trips up a lot of folks. I'm not following the exact structure of your layout, but I'm guessing that is what is causing the problem.
Also as the link above will show you, the number you are using in the swapDepths is a bit too big. There are a lot of depths, but not that many.
Sorry for the late reply!
However thanks for the info! It worked fine now and i think i understand how depths work.
However you write:
"Next thing is that most likely you should use loadMovie. There is a time delay between when you request an external file and when it actually gets loaded. There are also many things you can't do until the clip is loaded. In the olden days (when loadMovie was all we had) you often needed to make a "preloader" to check when the movie was loaded and it could get a little comples."
Here i guess you don't refer to loadMovie in the first sentence but just wrote wrong? Because loadMovie has this delay and i think i need to get rid of it. Right now i need some kind of preloader.
I was on vacation so I didn't see this 'til just now. And yes, I meant to say that you shouldn't use loadMovie.
Have you worked out how to use the MovieClipLoader class? Do you need more help?