Guest User

Untitled

a guest
Jan 11th, 2019
133
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. package  
  2. {
  3.     import flash.display.MovieClip;
  4.     import flash.events.Event;
  5.     import flash.events.ProgressEvent;
  6.    
  7.     public class Main extends MovieClip
  8.     {
  9.         public function Main()
  10.         {
  11.             stop(); //stops timeline, for game to load.
  12.             loaderInfo.addEventListener(Event.COMPLETE, loadComplete);
  13.             loaderInfo.addEventListener(ProgressEvent.PROGRESS, loadComplete);
  14.         }
  15.        
  16.         public function load Complete(e:Event)
  17.         {
  18.             loaderInfo.removeEventListener(Event.COMPLETE, loadComplete);
  19.             loaderInfo.removeEventListener(ProgressEvent.PROGRESS, loadComplete);
  20.             startGame();
  21.         }
  22.        
  23.         public function loadProgress(e:ProgressEvent)
  24.         {
  25.             var p:Number = e.bytesLoaded / e.bytesTotal;
  26.             //percent.text = "";
  27.         }
  28.        
  29.         public function startGame()
  30.         {
  31.             //start game code
  32.             gotoAndStop("Menu");
  33.         }
  34.     }
  35.    
  36. }
Add Comment
Please, Sign In to add comment