Recently I had to put a mask to an UIComponent. Here is the way to do it:
var largeMask:UIComponent = new UIComponent(); largeMask.graphics.beginFill(0x00FFFF, 0.5); largeMask.graphics.drawRect(0, 0, 120, 40); largeMask.graphics.endFill(); largeMask.x = 0; largeMask.y = 0; this.addChild(largeMask); this.mask = largeMask;
this should be UIComponent or Shape or similar object.
Obs: the mask must be added as child to the object you need to add the mask otherwise everything will be masked - nothing will be shown.
Tags: ActionScript, flex, mask, UIComponent
This post was written by Andrei Ionescu
Views: 1680


















