Skip navigation
Currently Being Moderated

How to identify a mask?

Jun 27, 2012 1:50 AM

Tags: #mask #layer #layer_mask

How can you figure out programmatically that a shape is used as a mask?

 

 

Use case:

 

1) In the authoring tool, create 2 layers with a shape on each.

 

2) Set the topmost layer as a mask layer.

 

3) If you do a trace, neither shapes will have their mask properties set, and yet, the 'topmopt' shape ( from the mask layer ) will nevertheless act as a mask.

 

4) I would like to know how I could identify via actionscript if a shape is used as a mask in this particular situation.

 
Replies
  • Currently Being Moderated
    Jun 27, 2012 2:00 PM   in reply to AsterLUXman

    If you set the mask in the timeline you can't query the mask property with script. You have to set it with script in order to query it with script.

     
    |
    Mark as:
  • Currently Being Moderated
    Jun 27, 2012 3:26 PM   in reply to AsterLUXman

    Removes the layer mask property and assign it with code.

     

    yourMovieClip.mask=yourMask1;

     

    A mask can be applied to several other movieclips, but a movie clip can not have multiple masks.

    Maybe you should put all of your layer "masks" into a single movie clip

     
    |
    Mark as:
  • Currently Being Moderated
    Jun 27, 2012 5:41 PM   in reply to AsterLUXman

    You shouldn't have to split the name on the underscore.... name.indexOf(...etc should be all you need if you are looking for "mask" in  the name

     

    Is there some reason you do not create the masks programmatically instead of using the timeline?  It would probably remove any annoyance you have.

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points