i searched for something similar here, but didn't found a clue about what's going on.
I have a Movie Clip object with a timeline, and it has 3 layers: a layer to stop the timeline at the last frame, a layer with regular drawing with mask attribute and a layer containing a target movieclip with the instance named 'target', that is masked by the layer above.
The drawing is very simple, not even a movieclip, just vector drawing. It's supposed to show the target movieclip only on regions where the mask layer has some drawing, right?
So, I created the method to load an image, listen to the complete loaded event and add the image to the target masked movieclip, but it disappears after the first frame! If i delete the layer with the mask drawing, works fine. Any clues?
Here's a smaller version of the code. Thanks in advance.
package
{
import flash.display.*
import flash.events.Event;
import flash.net.URLRequest;
public class Main extends MovieClip
{
public function Main()
{
var loader:Loader = new Loader()
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, listenComplete)
loader.load(new URLRequest('img.jpg'));
}
private function listenComplete(e:Event)
{
target.addChild(e.currentTarget.content)
}
}
}