In Flash 8, I had a movieclip "artwork" that I wanted to mask with another movieclip "mcdots" from actionscript. The typical syntax is:
mcMaskee.setMask(mcMask);
// or in my case:
artwork.setMask(mcdots);
The trouble is when I dynamically load the movie "maskdots," something weird happens, and the mask won't work:
maskdots.loadMovie("dots.swf");
artwork.setMask(mcdots);
The movie loads as expected, but the dots simply overlay rather than mask.
The solution was to delay or separate the process of loading the mask and applying it. To avoid a messy load checkstate routine, I simply used a basic enclosure called from a setTimeout (years of javascript taught me that):
setTimeout(function() { artwork.setMask(mcdots); }, 0 );
mcdots.loadMovie("dots.swf");
Now, I'm not 100% certain why this works, but I believe it has something to do with the time at which things are evaluated, when they are computed, and when they are rendered. I posted the same solution to Macrodobe Live Docs as well. Hope it helps someone.
this helped quite a bit
solved my problem.
thanks