Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package
- {
- import flash.display.MovieClip;
- import flash.events.Event;
- import flash.events.ProgressEvent;
- public class Main extends MovieClip
- {
- public function Main()
- {
- stop(); //stops timeline, for game to load.
- loaderInfo.addEventListener(Event.COMPLETE, loadComplete);
- loaderInfo.addEventListener(ProgressEvent.PROGRESS, loadComplete);
- }
- public function load Complete(e:Event)
- {
- loaderInfo.removeEventListener(Event.COMPLETE, loadComplete);
- loaderInfo.removeEventListener(ProgressEvent.PROGRESS, loadComplete);
- startGame();
- }
- public function loadProgress(e:ProgressEvent)
- {
- var p:Number = e.bytesLoaded / e.bytesTotal;
- //percent.text = "";
- }
- public function startGame()
- {
- //start game code
- gotoAndStop("Menu");
- }
- }
- }
Add Comment
Please, Sign In to add comment