3 Replies Latest reply on Jan 11, 2008 5:38 AM by Zen Seven

    Multiuser Xtra Javascript coding

    Zen Seven
      Hi everyone,

      First off, does anybody here use javascript instead of lingo when coding their director scripts? Specifically ones that incorporate the Multiuser Xtra? I get this feeling that I'm alone here with all the lack of support and examples on the internet regarding this.

      Now my main problem - there seems to be a bug in the Multiuser Xtra library, since doing the following causes an error:

      var errText = connection.getNetErrorString(-2147216214);

      That should return a string "No current connection". However I get a error dialog popping up saying "integer expected", stating that the value that I'm passing is -2147216214.000, a float. Using parseInt() to force the number to an integer doesn't work at all. This is not normal for Javascript, or Director.

      Has anyone encountered this? Does anybody have a work around?

      Thanks in advance!
        • 1. Re: Multiuser Xtra Javascript coding
          Level 7
          I've done quite a bit of work with the MUS xtra, but I write all of my
          code with native Lingo and never Javascript.
          getNetErrorString(-2147216214) returns "No current connection" as
          expected for me.

          Macromedia long ago ceased further development of the MUS Xtra and left
          us with poor documentation and scant few examples. I always thought this
          was unfortunate but I suppose it just wasn't something that many
          developers had a need for.

          Sorry I can't help you much with the Javascript thing, only to suggest
          you try using native Lingo code instead. There are a couple of MUS gurus
          that post here from time to time. Perhaps one of them might have a solution.
          • 2. Re: Multiuser Xtra Javascript coding
            Level 7
            Not using javascript either, but i did test and can verify the problem. And
            it's not the multiuserXtra that's causing it.
            Seems that, when using javascript, every negative integer higher
            than -1073741823 ( -1073741824, 5 etc) is treated by director as a float -
            and therefore, passed as a float (or double, to be more accurate) argument
            to any Xtra, and probably to any internal function.
            If this is the only issue you have with the Xtra, then you can store all
            error codes in a [code:string] proplist, and create your custom handler for
            retrieving the error string from that list.
            Let me know if you need those codes.

            "Zen Seven" <webforumsuser@macromedia.com> wrote in message
            news:fm58dj$o5e$1@forums.macromedia.com...
            > Hi everyone,
            >
            > First off, does anybody here use javascript instead of lingo when coding
            > their
            > director scripts? Specifically ones that incorporate the Multiuser Xtra? I
            > get
            > this feeling that I'm alone here with all the lack of support and examples
            > on
            > the internet regarding this.
            >
            > Now my main problem - there seems to be a bug in the Multiuser Xtra
            > library,
            > since doing the following causes an error:
            >
            > var errText = connection.getNetErrorString(-2147216214);
            >
            > That should return a string "No current connection". However I get a error
            > dialog popping up saying "integer expected", stating that the value that
            > I'm
            > passing is -2147216214.000, a float. Using parseInt() to force the number
            > to an
            > integer doesn't work at all. This is not normal for Javascript, or
            > Director.
            >
            > Has anyone encountered this? Does anybody have a work around?
            >
            > Thanks in advance!
            >


            • 3. Re: Multiuser Xtra Javascript coding
              Zen Seven Level 1
              Wow - that's pretty crazy that director would handle primitive types like that. Am errpr lookup table will do just fine. Hopefully there aren't many more "quirks" with the language in Director so I can continue my work in Javascript, and not Lingo.

              Thank you very much for the responses!