0 Replies Latest reply on Oct 30, 2008 5:33 AM by dz_

    String.split not working properly after upgrade (and downgrade!)


      Life was great until I updated both the Flex SDK ( to and FlashDevelop (Beta7 to Beta9) and the String.split function suddenly quit working as advertised... it would not work unless the optional limit parameter was supplied and of course who uses that? :(

      So I have tried to track down what introduced the problem. I have removed both Flex and FD, rebooted, deleted all temp files I could find and reinstalled the older versions of each (in totally different directories) that never demonstrated this problem before. Starting with just an empty project, I was able to reproduce the problem with the simple main.as listed below.

      This is the trace from running this program:

      === Begin Trace ===
      Running process: C:\Documents and Settings\Admin\Local Settings\Application Data\FlashDevelop\Tools\fdbuild\fdbuild.exe "C:\ofc\test\TestSplit\Test.as3proj" -ipc 4ad1fe0e-cd16-4e14-a557-56e71844ca61 -compiler "C:\flex" -library "C:\Documents and Settings\Admin\Local Settings\Application Data\FlashDevelop\Library"
      Using the Flex Compiler Shell.
      Building Test
      mxmlc -load-config+=obj\TestConfig.xml -debug=true -incremental=true -benchmark=false -o obj\Test633608882800000000
      Incremental compile of 2
      Loading configuration file C:\Flex\frameworks\flex-config.xml
      Loading configuration file C:\ofc\test\TestSplit\obj\TestConfig.xml
      Nothing has changed since the last compile. Skip...
      obj\Test633608882800000000 (978 bytes)
      Build succeeded
      Done (0)
      -------------- Before adding the text field as a child...
      string = 0 split length= 0 split =
      string = 1.4 split length= 0 split =
      string = Thi5 is a tricky-66 example. split length= 0 split =
      -------------- After adding the text field as a child...
      string = 0 split length= 1 split = 0
      string = 1.4 split length= 2 split = 1,4
      string = Thi5 is a tricky-66 example. split length= 5 split = Thi,5, is a tricky-,66, example.
      === End Trace ===

      As you can see the results of the String.split are not correct until after the TextField is set up. Further testing found that if I commented out the "this.addChild(tf);" line then I get the same results displayed... if I also comment out the "tf.text = "Hello";" line then the after results are the same as the before results.

      Any ideas as to what the problem might be? Or what I might try next to narrow it down after I disengage my forehead from the brick wall of my office?

      Thanks in advance,