Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package
- {
- import flash.display.Sprite;
- import flash.events.MouseEvent;
- import flash.text.TextField;
- import flash.text.TextFormat;
- import flash.text.TextFieldAutoSize;
- import com.greensock.TweenMax;
- import com.greensock.plugins.*;
- public class Main extends Sprite
- {
- private var format:TextFormat;
- private var text:TextField;
- public function Main(name:String,swf:String):void
- {
- graphic();
- events();
- createFormat();
- createText(name);
- //loaderSwf(swf);
- }
- private function graphic():void{
- graphics.beginFill(0x332211);
- graphics.drawCircle(0,0,50);
- buttonMode = true;
- }
- private function createFormat():void{
- format = new TextFormat();
- format.font = "Arial";
- format.size = 20;
- format.bold = true;
- format.color = 0xFFFFFF;
- }
- private function createText(name:String):void{
- text = new TextField();
- text.text = name;
- text.x = -48;
- text.y = -12;
- text.mouseEnabled = false;
- text.width = 97;
- text.height= 27;
- text.autoSize = TextFieldAutoSize.CENTER;
- text.setTextFormat(format);
- addChild(text);
- }
- private function events():void{
- addEventListener(MouseEvent.MOUSE_OVER,over);
- addEventListener(MouseEvent.MOUSE_OUT,out);
- }
- private function over(e:MouseEvent):void{
- TweenMax.to(e.currentTarget,0.5,{tint:0xff0033});
- }
- private function out(e:MouseEvent):void{
- //TweenMax.to(e.target,1,{tint:remove});
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement