Guest User

Untitled

a guest
Apr 19th, 2016
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.31 KB | None | 0 0
  1. package
  2. {
  3. import flash.display.Sprite;
  4. import flash.display.MovieClip;
  5. import flash.events.Event;
  6. import flash.display.BlendMode;
  7.  
  8. [SWF(width=640,height=400,backgroundColor=0x000000)]
  9.  
  10. /**
  11. * ...
  12. * @author Bartłomiej Malarz
  13. */
  14. public class Main extends Sprite
  15. {
  16.  
  17. public var backMC: MovieClip = new MovieClip();
  18. public var MC : MovieClip = new MovieClip();
  19.  
  20. public function Main():void {
  21. Animation();
  22. }
  23.  
  24. private function Animation():void {
  25. backMC.blendMode = BlendMode.LAYER;
  26. backMC.graphics.beginFill(0x000000);
  27. backMC.graphics.drawRect(0, 0, 640, 400);
  28. backMC.graphics.endFill();
  29. stage.addChild(backMC);
  30.  
  31. MC.blendMode = BlendMode.LAYER;
  32.  
  33. MC.alpha = 1;
  34. MC.x = 100;
  35. MC.y = 200;
  36. MC.scaleX = 1;
  37. MC.scaleY = 1;
  38.  
  39. MC.graphics.beginFill(0x0000ff);
  40. MC.graphics.lineStyle(8, 0xffff00);
  41. MC.graphics.drawRect( -50, -50, 100, 100);
  42. MC.graphics.endFill();
  43.  
  44. stage.addChild(MC);
  45. stage.addEventListener(Event.ENTER_FRAME, _enterFrameBasic);
  46.  
  47. }
  48. private function _enterFrameBasic(event:Event):void {
  49.  
  50. MC.rotation += 5;
  51. MC.x += 2;
  52. MC.scaleX -= 0.003;
  53. MC.scaleY -= 0.003;
  54. if (MC.alpha > 0) {
  55. MC.alpha -= 0.003;
  56. }
  57. else {
  58. Animation();
  59. }
  60.  
  61. }
  62.  
  63. }
  64.  
  65. }
Advertisement
Add Comment
Please, Sign In to add comment