PDA

View Full Version : Masking troubles


luke_4_mls
10-09-2009, 09:18 PM
here's my setup inside an MC
bottom layer: emptyMC - holds an image called dynamically
middle layer: Mask - a new shape (keyframe) every two frames (10 shapes), no tween
top layer: Frame - black outline of the mask

the mc just loops continuosly, so that the mask is always changing.

When I replace the emptyMC with a static image, everything works fine. But when I try to load an image dynamically, the image only appears for the length of that mask section's keyframe (2 frames).

If I throw a "stop();" in the mask keyframe, all is well. also, if i lengthen each mask segment to 40 keyframes, it works until the next mask keyframe. So I know that my image loading code is good. It's something weird with masking

I've tried putting the mask animation in a separate mc so the the original mc is one keyframe, but then it doesn't mask the image at all.

I haven't tried applying the mask using AS3, but I assume i will get the same results. Any suggestions? thanks.

luke_4_mls
10-09-2009, 09:23 PM
I also just figure out that each time the next mask keyframe ticks, it removes the child.

So in my code, on MOUSE_CLICK I load the img using the loader class, then use addchild to attach it to the empty mc. On the second MOUSE_CLICK, I removeChild, then load img and addchild. But I get an error message -> no child to remove.

This is a strange problem...