Skip navigation
Currently Being Moderated

Mask containing movie clips

Apr 8, 2013 12:09 PM

Tags: #mask #as3 #effect #tween #movie #clip #drawing_object #shimmer

Hey guys

 

I am creating a 'shimmer' effect over an object using a mask as follows:

 

Layer 1: Mask

Layer 2: Shimmer effect using a motion tween

Layer 3: Object that has the shimmer effect applied to it

 

The mask layer comprises three drawing objects and the shimmer effect behaves exactly as it should i.e. applies only where the drawing objects are.

 

However, I also have five movie clips on the stage that I want the shimmer effect applied to - but not when the movie clip has been clicked. So the answer is simple, create five instances of said movie clip in the mask, and when the instance on the stage is clicked, set the visible property of the instance in the mask to false, or use removeChild...

 

No.

 

Whenever I add instances of the movie clip to the mask, the shimmer effect is not applied to them, yet if I break them apart and use them as drawing objects, they work just fine (but obviously drawing objects can't be animated using AS).

 

My question is - is this even possible, and if so, how would I go about doing it?

 

Thanks in advance

 
Replies
  • Currently Being Moderated
    Apr 8, 2013 12:34 PM   in reply to LordMysterious

    dont mix up drawingObjects and MovieClips in your mask.

    convert the 3 drawing objects to a MovieClip and then add your other movieClips inside that MovieClip.

     
    |
    Mark as:
  • Currently Being Moderated
    Apr 9, 2013 12:01 AM   in reply to LordMysterious

    set your mask not directly on the stage but with actionscript.

    make a movieclip _maskee that contains all your squares (every single one a movieclip) and combine all your "outlines" into one movieclip called outlines.

    convert your tween also in a movieclip and try this:

    _mask.cacheAsBitmap = true;

    _maskee.cacheAsBitmap = true;

    _maskee.mask = true;

     

    these three lines have to be called every time you change the contents of your masked objects (remove one of them or make one invisible)

     
    |
    Mark as:
  • Currently Being Moderated
    Apr 9, 2013 4:35 AM   in reply to LordMysterious

    put outlines and all the squares in one new movieclip and call that movieclip "_mask",

    if your motion twenn with the shimmer effect is already in a movieclip call that movieclip "_mask"

     

    then use this three lines:

    _mask.cacheAsBitmap = true;

    _maskee.cacheAsBitmap = true;

    _maskee.mask = _mask;

     

    to "actionscript" your mask

    for this to work _mask and _maskee have to live in "normal" layers (that are neither a mask nor a masked layer)

     

    to illustrate the difference:

     

    this is how an uncached mask treats complex (nested objects/your problem):

    uncachedMask.PNG

    this is how a cached mask treats complex (nested objects/your solution):

    cachedMask.PNG

    The timeline looks like this:

    cachedMaskTimeline.PNG

     
    |
    Mark as:
  • Currently Being Moderated
    Apr 9, 2013 5:53 AM   in reply to LordMysterious

    You`re welcome ;-)

     
    |
    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