PDA

View Full Version : How to set these masks??



deamothul
April 15th, 2003, 07:14 AM
Hey ASscripters,:tb:

I have a problem, i want 2 mask a certain shape.
So i want the shape to show through a few other shapes.
i tried it with setmask, but i can't seem 2 get the shape2Mask to show up under all the masks.
Yesterday it kept on showing up through one mask and the others were ignored.
Hope it's all clear what i mean, still early, still sleepy.

My script is below, i put some comments into it.



MovieClip.prototype.drawShape=function(r,x,y,w,c,a ,fc,fa,style){
this.lineStyle(w,c,a);
this.beginFill(fc,fa);
this.moveTo(x+r,y);
a = Math.tan(style*Math.PI/180);
for(var angle=45;angle<=360;angle+=45){
var endX = r*Math.cos(angle*Math.PI/180)
var endY = r*Math.sin(angle*Math.PI/180)
var cX = endX + r*a*Math.cos((angle-90)*Math.PI/180)
var cY = endY + r*a*Math.sin((angle-90)*Math.PI/180)
this.curveTo(cX+x,cY+y,endX+x,endY+y);
}
this.endFill()
}

//this is the clip that i want 2 show throught the mask

shape2Mask=createEmptyMovieClip("shape2Mask",1)
shape2Mask.drawShape(150,0,0,3,0x0000aa,100,0x0000 66,100,22.5);
shape2Mask._x=250
shape2Mask._y=250
shape2Mask.onEnterFrame=function(){
shape2Mask._x=Math.sin(angleX+=0.2)*350+250
}


// these are 4 shapes i want set as mask, so that shape2Mask
// will only be seen through these shapes. :confused:

Mask1=createEmptyMovieClip("Mask1",2)
Mask1.drawShape(40,0,0,3,0xeeddee,100,0xaaeeaa,50, 52.5);
Mask1._x=100
Mask1._y=250


Mask2=createEmptyMovieClip("Mask2",3)
Mask2.drawShape(40,0,0,3,0xeeddee,100,0xaaeeaa,50, 52.5);
Mask2._x=200
Mask2._y=250


Mask3=createEmptyMovieClip("Mask3",4)
Mask3.drawShape(40,0,0,3,0xeeddee,100,0xaaeeaa,50, 52.5);
Mask3._x=300
Mask3._y=250

Mask4=createEmptyMovieClip("Mask4",5)
Mask4.drawShape(40,0,0,3,0xeeddee,100,0xaaeeaa,50, 52.5);
Mask4._x=400
Mask4._y=250


// HOPE somebody's out there who knows what i mean.

GREETINGZZ 2 ALL From DEAMOTHUL - THE SCRIPT KEEPER -

deamothul
April 15th, 2003, 08:05 AM
;( :angry: :skull: