Movie title
// forked from undo's TextFieldでGradientFillしたい
package {
import flash.filters.GlowFilter;
import flash.display.BitmapData;
import flash.display.GradientType;
import flash.display.SpreadMethod;
import flash.display.Sprite;
import flash.geom.ColorTransform;
import flash.geom.Matrix;
import flash.text.TextField;
import flash.text.TextFieldAutoSize;
import flash.text.TextFormat;
[SWF(width=465,height=465,backgroundColor=0x0)]
public class ASTest extends Sprite{
public function ASTest() {
init();
}
private function init():void
{
var title:TextField = createText(100.0, 0.0, 0.0, "FFFFFUUUUUUUUUUUUU");
var subtext:TextField = createText(25.0, 160, 100.0, "THE MOVIE");
var container:Sprite = new Sprite();
container.y = 100;
container.addChild(title);
container.addChild(subtext);
container.cacheAsBitmap = true;
this.cacheAsBitmap = true;
mask = container;
addChild(container);
var matrix:Matrix = new Matrix();
matrix.createGradientBox(container.width / 2, container.height / 2, Math.PI / 2, 0, 0);
graphics.beginGradientFill(GradientType.LINEAR,[0x880000,0xffdddd],[1,1],[40,230],matrix,SpreadMethod.REFLECT);
graphics.drawRect(container.x, container.y + 10, container.width, container.height);
graphics.endFill();
filters = [new GlowFilter(0xFFFF00, 1.0, 8.0, 5.0, 3.0, 2.0)];
rotationZ = -10;
rotationY = -40;
}
private function createText(size:Number, x:Number, y:Number, text:String):TextField
{
var tf:TextField = addChild(new TextField()) as TextField;
tf.autoSize = TextFieldAutoSize.LEFT;
var format:TextFormat = new TextFormat();
format.size = size;
format.font = 'Impact';
tf.defaultTextFormat = format;
tf.text = text;
tf.x = x;
tf.y = y;
return tf;
}
}
}