flashactionscript-3traceavm2

ActionScript - trace().Top level function behavior


When I'm tracing a variable in Flash Player Debug, I'm getting a strange behavior. Let's assume that we have a pattern like "x:y". "x" and "y" are integer vars. If we trace that expression with

trace("x:y");

the behavior is

1) if x < 10

"x" variable and ":" will be omitted and only "y" will be printed out

2) if x >= 10

everything works as expected. "x:y" printed out.

Questions:

  1. Why it happens?
  2. Is colon a special character in actionscript?
  3. Is it possible to avoid this behavior and print out for example "1:1"?

To reproduce:

// following looks wrong
trace("1:1");  // 1
trace("2:1");  // 1
//but the next ones - look correct
trace("10:1"); // 10:1
trace("11:1"); // 11:1

Thanks in advance.


Solution

  • Testing this with mxmlc:

    // following looks wrong
    trace("1:1");  // 1
    trace("2:1");  // 1
    //but the next ones - look correct
    trace("10:1"); // 10:1
    trace("11:1"); // 11:1
    

    Produces these results for me:

    1:1
    2:1
    10:1
    11:1
    

    Anything else you can post to help narrow the problem down?