3 Replies Latest reply on Apr 21, 2006 6:06 AM by Newsgroup_User

    Flash External interface iterprets empty string "" as string "null"

    slawu
      Hi
      I'm using ScreenTime mProjector and Flash8 to write some MSWindows application. A have a little plugin writen in C++. When I used Flash7 everything was all right but when I switched to Flash8 string "null" showed up everywhere. I asked ScreenTime support - they wrote:
      "When we pass or return a null string through the Flash External interface the Flash 8 player changes it to be a string equal to "null"."

      Can you help?
        • 1. Re: Flash External interface iterprets empty string "" as string "null"
          Level 7
          slawu,

          > I'm using ScreenTime mProjector and Flash8 to write some
          > MSWindows application. A have a little plugin writen in C++.

          Okay.

          > When I used Flash7 everything was all right but when I switched
          > to Flash8 string "null" showed up everywhere. I asked ScreenTime
          > support - they wrote:
          > "When we pass or return a null string through the Flash External
          > interface the Flash 8 player changes it to be a string equal to "null"."

          All right.

          > Can you help?

          What's your question? What do you need? Based on ScreenTime's
          response, I would alter my ActionScript to check for both empty strings and
          the string "null" in all locations where I previously only checked for empty
          strings.


          David
          stiller (at) quip (dot) net
          Dev essays: http://www.quip.net/blog/
          "Luck is the residue of good design."


          • 2. Re: Flash External interface iterprets empty string "" as string "null"
            slawu Level 1
            I'm sorry. I really didn't wrote what is my problem. So my problem is...
            I would like to pass empty strings between my plugin and my ActionScript and I would like to distinguish the strings "" and "null". Now I never know if the user entered the string "null" or he entered "".

            My question is: how can I pass the string "" from my plugin to AS and vice versa?
            • 3. Re: Flash External interface iterprets empty string "" as string "null"
              Level 7
              slawu,

              > I would like to pass empty strings between my plugin and
              > my ActionScript and I would like to distinguish the strings
              > "" and "null". Now I never know if the user entered the
              > string "null" or he entered "".

              Aha. Well, this seems to only be happening because of your 3rd party
              wrapper. If that's how ScreenTime interacts with the ExternalInterface
              class, you may just have to handle the ""/"null" discrepancy from inside the
              SWF. If the user submits an empty string, you could check for that before
              using ExternalInterface and pass something else, instead.


              David
              stiller (at) quip (dot) net
              Dev essays: http://www.quip.net/blog/
              "Luck is the residue of good design."