Advertisement
Guest User

flash.ho

a guest
Oct 22nd, 2014
135
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.60 KB | None | 0 0
  1. import flash.text.TextField;
  2. import flash.utils.Timer;
  3. import flash.events.TimerEvent;
  4.  
  5. var count:uint = 5
  6.  
  7. var counter:TextField = new TextField ();
  8. counter.text = "Count Down: " + count;
  9. counter.x=50
  10. counter.y=120
  11. counter.scaleX = 5
  12. counter.scaleY = 5
  13. counter.width = 500
  14. addChild(counter);
  15.  
  16. var myTimer:Timer = new Timer(1000);
  17. myTimer.addEventListener(TimerEvent.TIMER, countDown);
  18. myTimer.start();
  19.  
  20. function countDown(event:TimerEvent) {
  21. if(count > 0) {
  22. count = count -1;
  23. counter.text = "Count Down: " + count;
  24. }else {
  25. counter.text = "Game Over";
  26. myTimer.stop();
  27. }
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement