How come when I take a shape and make it duplicate with actionscript.
for (var i = 0; i<50; i++) {
box.duplicateMovieClip(i, i);
}
for (var i = 0; i<25; i++) {
box2.duplicateMovieClip(i, i);
}
the mask that i had over that shape stops working? Has anyone else had this happen. I could just put all the shapes on the stage and it works under the mask. But i think it is better to not have to lay out all the shapes so that is why i wanted to make them duplicate. C:-)
I don’t think you can have masks on Duplicated Movie Clips. Each one is on a level, and I don’t think masks work like that… I thought they had to be on the stage.
A mask can only mask :lol: one movie clip at one time . the work around your problem is to do the duplication ‘inside’ a parent movie clip which is the masked one.
you know i never thought of that , you are right. I guess i am stuck using the version were i lay out all of the shapes first. I had one more question if you had time to check it out. I have random shapes that are moving from the tut on this site. I also wanted some of the shapes to randomly expand and then go back, to give the apperance that they are comeing tward the screen then going back here is the code i am using
onClipEvent (enterFrame) {
// generating movement
location = this._x;
var i;
i = 1+_root._xmouse/150;
if (this, hitTest(_root.thegotoguy)) {
this._x = -1000;
} else {
this._x = location+i++;
}
// take this out if you want to add the ablility to scale the squares,
//this._xscale = 100+_root._ymouse;
//this._yscale = 100+_root._ymouse;
}
very cool, thanks. It looks like what i might have been doing wrong was that i had the layer masked and should have taken that off since eki’s code was for a dynamic mask. Thanks so much for helping me work through that.
hey i started to add some more stuff to the action script today, i have the cubes moving in and out. If you have a chance to look at the code, could you tell me how i might add random to the in and out movement. Right now the way it is all of the shapes at one time move in and out. It would be cool if there was a way to say for it to be random some move in and out sometimes. here is the code