1 Reply Latest reply on Apr 13, 2007 6:11 AM by Newsgroup_User

    I have question about null and undefined?

    kyduke
      I tested null and undefined all single character.
      I saw abnormal result

      /* test code */
      var A:String
      ...
      var Z:String

      var a:String
      ...
      var z:String

      trace("A: " + A);
      ...
      trace("Z: " + Z);
      trace("");
      trace("a: " + a);
      ...
      trace("z: " + z);
      /* End of test code */

      I tested this code on Flash 8.

      /* result */
      A: undefined
      ...
      Z: undefined

      a: undefined
      ...
      n: undefined
      o: null
      p: undefined
      ...
      z: undefined
      /* End of result */

      Only 'o' make different result.
      It is same result on Flash Player 8 and Flash Player 9.

      Please, tell me why.

      Thanks

      ---------------------------------

      /* code generation code */
      type = "String"; //Number, Movieclipe ...

      for (i = 65; i < 91; i++)
      {
      trace("var " + String.fromCharCode(i) + ":" + type);
      }
      trace("");
      for (i = 97; i < 123; i++)
      {
      trace("var " + String.fromCharCode(i) + ":" + type);
      }
      trace("");
      for (i = 65; i < 91; i++)
      {
      trace("trace(\"" + String.fromCharCode(i) + ": \" + " + String.fromCharCode(i) + ");");
      }
      trace("trace(\"\");");
      for (i = 97; i < 123; i++)
      {
      trace("trace(\"" + String.fromCharCode(i) + ": \" + " + String.fromCharCode(i) + ");");
      }
      /* End of code generation code */