Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package
- {
- import flash.display.Sprite;
- import flash.display.MovieClip;
- import flash.events.Event;
- import flash.display.BlendMode;
- [SWF(width=640,height=400,backgroundColor=0x000000)]
- /**
- * ...
- * @author Bartłomiej Malarz
- */
- public class Main extends Sprite
- {
- public var backMC: MovieClip = new MovieClip();
- public var MC : MovieClip = new MovieClip();
- public function Main():void {
- Animation();
- }
- private function Animation():void {
- backMC.blendMode = BlendMode.LAYER;
- backMC.graphics.beginFill(0x000000);
- backMC.graphics.drawRect(0, 0, 640, 400);
- backMC.graphics.endFill();
- stage.addChild(backMC);
- MC.blendMode = BlendMode.LAYER;
- MC.alpha = 1;
- MC.x = 100;
- MC.y = 200;
- MC.scaleX = 1;
- MC.scaleY = 1;
- MC.graphics.beginFill(0x0000ff);
- MC.graphics.lineStyle(8, 0xffff00);
- MC.graphics.drawRect( -50, -50, 100, 100);
- MC.graphics.endFill();
- stage.addChild(MC);
- stage.addEventListener(Event.ENTER_FRAME, _enterFrameBasic);
- }
- private function _enterFrameBasic(event:Event):void {
- MC.rotation += 5;
- MC.x += 2;
- MC.scaleX -= 0.003;
- MC.scaleY -= 0.003;
- if (MC.alpha > 0) {
- MC.alpha -= 0.003;
- }
- else {
- Animation();
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment