This content has been marked as final. Show 5 replies
are you adding mc1 to a masked object? ie, is that code located on a timeline that's masked?
Thanks for the response, but no, and if it were that AS would disappear itselft when I deleted the masked layers. I tried switching to
Which works for now, but why I don't know. I guess I'm confused about this new displayobjectcontainer business in general. Since AS can no longer be associated with an object, and only keyframes, what exacly is it adding a child to? The stage? How do I specify a container? The docs are woefully sketchy on this as always. I've tried using other displayobjects or movieclips as a container but I get errors and doubt I'm doing it right. All of which doesn't explain to me why even if I use plain old addChild() it will show up on top of 21 layers no matter where I put it as long as I have no masked layers but not show up if I have (entirely unrelated) masked layers in there at all...
i assume you meant addChildAt(mc1,5) which is the same as
this.addChildAt(mc1,5). and, in general, when you don't specify a displayobjectcontainer (doc) while coding in a flash frame, the stage that contains that frame is the default doc.
you can always specify your doc by using:
doc1.addChild() or doc1.addChildAt().
and this works just like flash 2:
// and unlike as2, you can stagger these displayobjects as follows:
now, if you use addChild, the depth of the first display object added to a doc is 0. each subsequent displayobject added is placed at increasing depths.
so, just why your making worked when mc1 was added to depth 5 and not when added to depth 0, must depend upon some circumstances specific to your masking. do you know what that is?
I have no idea. Really I have just have three masked layers all of which are completely dumb and static (except for some timeline keyframing) involving no AS anywhere, and are on entirely un-conflicting areas of the stage from my mc, so I couldn't tell you! Getting rid of just one or some combo of them doesn't work either--I have to delete all of them to not have to use addChildAt 5
what if you use addChildAt(mc1,0) or addChildAt(mc1,this.numChildren)?