bugs

Using a dynamically loaded movie as a mask in Flash 8 using Actionscript

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):