Gradient mask on View

Software: Away3D 3.x

achim, Newbie
Posted: 22 June 2011 12:52 PM   Total Posts: 20

Hi,
I’d like to set a gradient mask to one of my Views, but it doesn’t work.
Here is the code :

private function onMirrorAdded(pEvt:Event):void
  {
   this
._mirrorView.removeEventListener(Event.ADDED_TO_STAGE,onMirrorAdded);
   
this._alphaGradient=new Sprite;
   
this._mirrorView.cacheAsBitmap=true;
   
this._alphaGradient.cacheAsBitmap=true;
   
this._alphaGradient.graphics.beginGradientFill(GradientType.LINEAR,[0x00FF000x000088],[1,0],[0255]);
   
this._alphaGradient.graphics.drawRect(0,0,200,200);
   
this._alphaGradient.rotation Math.PI/2;
   
this._alphaGradient.x=-this._alphaGradient.width/2+this._mirrorView.x;
   
this._alphaGradient.y=+this._mirrorView.y;
   
addChild(this._alphaGradient);
   
this._mirrorView.mask=this._alphaGradient;
  

Am I missing something ? Does this need an extra update function ?
Thanks.

   
   

X

Away3D Forum

Member Login

Username

Password

Remember_me



X