I can't quite get this circular mask to work.
onClipEvent(load)
{
_root.stop();
dO = 3.6;
r = 75;
function addSlice(O)
{
x1 = r*Math.sin(O*Math.PI/180);
x2 = r*Math.sin((O+dO)*Math.PI/180);
y1 = r*Math.cos((O)*Math.PI/180);
y2 = r*Math.cos((O+dO)*Math.PI/180);
trace(x1 + ":" + y1);
with(_root.mask)
{
moveTo(0,0);
beginFill(0x000088);
lineTo(x1,y1);
lineTo(x2,y2);
endFill();
}
}
_root.createEmptyMovieClip("mask",0);
this.setMask(_root.mask);
_root.mask._yscale = -100;
_root.mask._x = this._x;
_root.mask._y = this._y;
oldLoaded = 0;
}
onClipEvent(enterFrame)
{
loaded = Math.ceil(_root.getBytesLoaded()/_root.getBytesTotal()*100);
for(i = oldLoaded; i < loaded; i++)
{
addSlice(dO*i);
}
oldLoaded = loaded;
}
I've created a movieclip with a donut graphic in it.
Registration points are centered.
And set the AS to the movieclip.
There is a second frame in the timeline with a photo in it.
Nothing happens. Any suggestions?