Is that bug or feature?
Monday, June 13th, 2005I’ve found this by mistake, and do not know if it is bug or some kind or feature (suppose bug
).
Here is code:
var mc = _root.createEmptyMovieClip(”mc”,100)
var mc2 = _root.createEmptyMovieClip(”mc”,90)
var a = mc.attachMovie(”a”,”a”,100)
trace(a.getDepth())
a.swapDepths(300)
trace(a.getDepth())
[/as]
and the result will be the same 100. But why, I’ve swaped depth, so it should be 300! As I said it was by mistake, so I was trying another examples, and all was working except this example. Then i had copy and paste code from this example to another, and have found why it doesn’t work here.
var mc = _root.createEmptyMovieClip(”mc”,100)
var mc2 = _root.createEmptyMovieClip(”mc”,90)
[/as]
same name for new movieclip. All works because old mc movieclip was replaced by new mc2, but swapDepths it doesn’t work from now on. It is interesting because mc should not exists (as I think) because movieclip was replaced by mc2. But why then I can attachMovie to mc?
var a = mc.attachMovie(”a”,”a”,100)
[/as]
Let me know
Thanks.






3 Comments
creynders
• Visit Site
June 13th, 2005
You’re mistaken. The second movieclip doesn’t overwrite the first one. There are simply 2 movie clip instances with the same instance name (but on different depths)
Why the swapdepths doesn’t work, i don’t know….
Administrator
• Visit Site
June 13th, 2005
but there is problem when you want get instance on movieclips:
var mc = _root.mc, which movieclip shoud be taken…
I think, that’s way swapdepths doesnt work (maybe)
eq2 plat
• Visit Site
April 13th, 2008
This is a tricky one…
Have you figured out why the swapdepths don’t work since?
Live Preview
Leave a comment