title: Access of undefined property- but its defined.
body: <p>I get that error message for all lines of choosetext()- which is referred every time I change the value of mode. </p>
  
  <p>package 
      {
          import flash.display.Bitmap;
          import flash.display.Sprite;
          import flash.events.<em>;
          import flash.ui.Keyboard;
          //import board;
          import flash.accessibility.AccessibilityImplementation;
          import flash.display.MovieClip;
          import flash.text.TextField;
          import flash.text.TextFormat;
          import flash.display.Sprite;
          import flash.utils.ByteArray;
          import flash.events.MouseEvent;
          import flash.text.AntiAliasType; 
          import flash.utils.describeType;
          import flash.net.</em>;
          import Set;
          import StatusBox;
          import Statusx;
          import flash.display.InteractiveObject;
          import flash.text.TextFieldType;
          import flash.events.FocusEvent;
          import fl.managers.FocusManager;
          import flash.display.*;
          import flash.display.Stage;
          import flash.events.KeyboardEvent;</p>
  
  <pre><code>    public class boxsprite extends Sprite  
      {     
          [Embed(source = "C:/Windows/Fonts/Verdana.ttf", fontName = "Verdana", fontWeight = "bold", advancedAntiAliasing = "true", mimeType = "application/x-font")] 
          public static const VERD:Class;
          [Embed(source="../lib/box.gif")]
           private var boxspriteClass:Class
           [Embed(source = "../lib/m2.gif")]
           private var m2:Class
           [Embed(source = "../lib/m3.gif")]
          private var m3:Class
           [Embed(source="../lib/m4.gif")]
          private var m4:Class
          [Embed(source = "../lib/m5.gif")]
          private var m5:Class
          [Embed(source = "../lib/m6.gif")]
          private var m6:Class
  
          [Embed(source = "../lib/m7.gif")]
          private var m7: Class
          [Embed(source="../lib/m8.gif")]
          private var m8: Class
          [Embed(source = "../lib/m9.gif")]
          private var m9: Class
  
           internal var mode:uint=1;
              internal var displaytext:String;
              internal var setBox:Boolean = false;
              internal var onBoard:Array = [0];
              internal var playerRound:uint = 1;
              internal var round:uint = 1;
              internal var playernumber:uint; 
              internal var myTextBox:TextField = new TextField();
              public function boxsprite():void
              {
                  trace (mode);
              init2(); 
              var boxsprite2:Bitmap = new boxspriteClass() as Bitmap;
              this.addChild(boxsprite2); 
              var m77:Bitmap = new m7 as Bitmap;
              this.addChild(m77)
  
              var m66:Bitmap = new m6 as Bitmap;
              this.addChild(m66)
  
              var m55:Bitmap = new m5 as Bitmap;
              this.addChild(m55)
              var m44:Bitmap = new m4 as Bitmap;
              this.addChild(m44)
              var m33:Bitmap = new m3 as Bitmap;
              this.addChild(m33);
              var m22:Bitmap = new m2 as Bitmap;
              this.addChild(m22)
              }
  
  private function choosetext():void
                  { switch (mode)
                  {
                   case 2: {this.setChildIndex(m22, this.numChildren - 1);}
                  case 3: {this.setChildIndex(m33, this.numChildren - 1);}
                  case 4: {this.setChildIndex(m44, this.numChildren - 1);}
                  case 5: {this.setChildIndex(m55, this.numChildren - 1);}
                  case 6: {this.setChildIndex(m66, this.numChildren - 1);}
                  case 7: {this.setChildIndex(m77, this.numChildren - 1); }
                  case 8: {this.setChildIndex(m88, this.numChildren - 1);  }
                  case 9: {this.setChildIndex(m99, this.numChildren - 1); }   
                  }
                  }
  </code></pre>