views:

238

answers:

1

How can I mask my flash movie dynamically using actionscript to create a 5 pixels rounded mask in the 4 corners? (the corners should be transparent, the rest should be visible)

Thanks!

+1  A: 

It could be this simple. Make a rounded corner rectangle in Flash and name it myMovie.

Mask

mask = myMovie;

Draw rounded corner rectangle to make movie on stage

//550x400 stage
var roundRect:Shape = new Shape();
roundRect.graphics.beginFill(0x006600, 1);
//stage width, stage height, width of rectangle, height of rectangle, ellipse width, ellipse height
roundRect.graphics.drawRoundRect(125, 75, 300, 200, 25, 25);
addChild(roundRect);
//mask
mask = roundRect;

Put mask and movie on stage 'symbol with Class name Rr and Ym'

//550x400 stage
//put mask on stage
var mm:MovieClip = new Rr;
addChild(mm);
//position on stage
mm.x = stage.stageWidth/4;
mm.y = stage.stageWidth/4;
//mask
mask = mm;
//put movie on stage
var yourClip:MovieClip = new Ym;
addChild(yourClip);
//position on stage
yourClip.x = stage.stageWidth/4;
yourClip.y = stage.stageWidth/4;
VideoDnd