Guest User

Untitled

a guest
Oct 31st, 2017
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. package
  2. {
  3.    
  4.     /**
  5.      * ...
  6.      * @author Daniel Williams
  7.      *          ** Interplanetary Studios **
  8.      *          ** PLAYER PROTOTYPING **
  9.      *
  10.      */
  11.    
  12.     import flash.display.MovieClip;
  13.     import flash.events.MouseEvent;
  14.     import flash.events.TimerEvent;
  15.     import flash.events.Event;
  16.     import flash.media.Sound;
  17.     import flash.media.SoundMixer;
  18.     import flash.media.SoundChannel;
  19.     import flash.utils.Timer;
  20.     import flash.ui.Keyboard;
  21.     import flash.events.KeyboardEvent;
  22.     import flash.events.*;
  23.     import Player;
  24.    
  25.     public class Main extends MovieClip
  26.     {
  27.        
  28.         var myPlayer:Player; //Declare here vs in a private function to access it throughout the class.
  29.  
  30.         public function Main()
  31.         {
  32.            addEventListener(Event.ADDED_TO_STAGE, init);
  33.            stage.focus = myPlayer;
  34.         }
  35.         private function init(e:Event):void
  36.         {
  37.             myPlayer = new Player();
  38.             this.addChild(myPlayer);
  39.             stage.focus = myPlayer;
  40.         }
  41.  
  42.     }
  43. }
Add Comment
Please, Sign In to add comment