[FMX]Masks, Depths, Actions, and Mohicans

Hey everyone!
Well, the mohican part doesn’t belong in the title, but it is catchy though :cyclops:

My problem is, I have a movie clip on a layer that is being duplicated from an action in the timeline. Above the layer containing the movie clip, I have placed a funny looking shape that will act as the masking “thing”. I masked both layers.

The problem is, the original, unduplicated movie clip falls under the mask. All the movie clips that have been duplicated appear above the mask layer - thus not falling within the mask area. I have tried messing around with swapDepths, setMask, and even performed a voodoo dance, yet I can not seem to find a way to get all the duplicated movie clips to not go above the mask.

Is there a method to make this work. I am sure the mask is what is causing this problem. If the mask was not there, a simple swapDepths(large_number) placed on a movie clip would ensure that it stays above any duplicated movie.

I have attached the FLA to this post. Any help or suggestions would be highly appreciated =)

Cheers!
Kirupa :ub:

hey kirupa … is there any reason why you need it masked?

if not why don’t you try something like this?

[size=1][EDIT]
I forgot something …

and even performed a voodoo dance

lol :stuck_out_tongue: :stuck_out_tongue: :P[/size]

Hey kax!
Thanks for the help. Your method was my backup plan. This was going to be a tutorial to help people learn how to make random lines move around, and I thought that telling people that method of cutting an outline from a large solid would be too confusing :slight_smile:

Thanks!
Kirupa :ub:

confusing??

I thought about it since I saw your post … you thought about it as your backup … why people would be confused about it?

What you would need to do (and this applies to Flash 5 as well) is to put your clip to be duplicated within another clip, then mask that containing clip. Since all duplications are kept in the depth of the clip they are created from, they remain in the container clip which alone never escapes from the mask.

The setMask method works fine. Just have to keep in mind that each mask can only mask one MC (so you need to duplicate the mask as well as the MC). Check out my attachment. Works like a charm. All actions are in the theLine MC and the _root timeline. My recommendation is to always keep all of your code in the _root timeline for ease of portability and editting.

-Al

Thanks al!
That worked brilliantly =) I’m probably going to make this an open source file with shared credit going to all of you. I think a tutorial on this would be quite repetive of things already viewable on the site =)

Cheers!
Kirupa :ub:

oh!! everything seems so clearly now … I didn’t know that you can’t mask different movie clips with the same mc

thank you very much alethos =)

kirupa:
you don’t need to give me any credit
after all … alethos solved the problem :wink: