title: Gradient TextField ActionScript 3
body: <p>I have been searching for a way to put gradient colors on TextField component for the past few hours with no luck. One method is to create a gradient rectangle and set the TextField as a mask for it but I can't make it work:</p>
  
  <pre><code>var m:MovieClip = new MovieClip();
  var mTxt:Sprite = new Sprite();
  var txt:TextField = new TextField();
  var tf:TextFormat = new TextFormat();
  var dropShadow:DropShadowFilter = new DropShadowFilter(); 
  
  dropShadow.distance = 0;
  dropShadow.angle = 120;
  dropShadow.color = 0x000000;
  dropShadow.alpha = 1;
  dropShadow.blurX = 2;
  dropShadow.blurY = 2;
  dropShadow.strength = 1;
  dropShadow.quality = 80;
  dropShadow.inner = false;
  dropShadow.knockout = false;
  dropShadow.hideObject = false;
  txt.filters = new Array(dropShadow); 
  
  
  tf.font = "Ethnocentric Rg";
  tf.color = 0xffde00;
  tf.size = 72;
  txt.defaultTextFormat = tf;
  txt.text = "1756.25";
  mTxt.addChild(txt);
  
  var fillType:String = GradientType.LINEAR;
  var colors:Array = [0xFF0000, 0x0000FF];
  var alphas:Array = [1, 1];
  var ratios:Array = [0x00, 0xFF];
  var matr:Matrix = new Matrix();
  
  matr.createGradientBox(400, 100, 0, 0, 0);
  
  var spreadMethod:String = SpreadMethod.REFLECT;
  
  
  m.graphics.beginGradientFill(fillType, colors, alphas, ratios, matr, spreadMethod);  
  m.graphics.drawRect(0,0,400,120);
  
  m.mask = mTxt;
  
  addChild( m );
  </code></pre>
  
  <p>This code literally crashes the AIR debugger and exits itself. 
  What am I doing wrong here?</p>