PDA

View Full Version : Dynamic Mask Problem


MrGS
04-25-2006, 02:34 AM
I'm working on an animation where I have two layers, with similar pictures on them and I have lines of random sizes moving backwards and forwards over them, the idea is that the lines are supposed to be masks so that you can see the image below the top layer as they move along. My problem is that only one of the lines is masking and the others are remaining black. I'm not sure why this is happening because to the code to set the mask is on the movieclip that is being duplicated and all of the other code on the movieclips is functioning properly (random widths and their movements). This is the code I'm working with:

This is on the frame, it makes the fifty duplicates of the line movieclip


for(var i = 0;i<50;i++){
line.duplicateMovieClip("line"+i, i);
}

This is on the oringal line movieclip, it sets their widths, their starting locations and their movement. It's also supposed to mask the clear movieclip but only one line does. Oh, clear is the name of the movieclip that gets masked.

onClipEvent (load) {
_root.clear.setMask(this)
this._width = Math.random()*9;
this._x = Math.random()*550;
speed = Math.random()*9;
// 3 to 6
drift = Math.random()*2-1;
// -1 to 1
}

onClipEvent (enterFrame) {
this._x += drift;
// bring back to top
// one side to another
if (this._x<0) {
this._x = 550;
}
if (this._x>550) {
this._x = 0;
}
}


Can anyone help?

EDIT: Doesn't matter, it's sroted out now, just had to put the make a mask movie clip and put my line movieclip in that.