6 Replies Latest reply on Mar 20, 2007 7:18 PM by Newsgroup_User

    string expected error help

    ajrobson
      I have a image which is split into different colours, so i have used imagine lingo to jump to markers depending on a colour. I am trying to get a miaw to open but i keep getting a string expected error, the miaw opens and play but the error also comes up, can any body tell me what i am doing wrong?

        • 1. Re: string expected error help
          Level 7
          > on mouseUp me
          > pClickLoc = sprite(me.spriteNum).mapStageToMember(the clickLoc)
          > case hexString(sprite(me.spriteNum).member.image.getPixel(pClickLoc)) of
          > "#FFFFFF": go "quiz"
          > "#0000FE": go "slideshow" -- blue goes to slideshow
          > "#FE0000": go window().new("clip"), window("clip").open() -- opens a miaw
          > otherwise: nothing
          > end case
          > end

          The case match that opens your MIAW contains code that looks wrong.
          Try:
          -- ...
          "#FE0000":
          w = window().new("clip")
          w.filename = "@/clip"
          w.open()
          otherwise: nothing
          -- ...
          • 2. Re: string expected error help
            Level 7
            I couldn't get your code to even compile.

            But when I changed the #FE0000 case to this,
            "#FE0000":
            go window().new("clip")
            window("clip").open() -- opens a miaw

            it worked fine. But you're getting a completely different error. Try my
            suggestion anyway, and see what happens.
            --
            Craig Wollman
            Lingo Specialist
            Word of Mouth Productions
            212-928-9581

            www.wordofmouthpros.com
            "ajrobson" <webforumsuser@macromedia.com> wrote in message
            news:etn9c2$oin$1@forums.macromedia.com...
            >I have a image which is split into different colours, so i have used
            >imagine
            > lingo to jump to markers depending on a colour. I am trying to get a miaw
            > to
            > open but i keep getting a string expected error, the miaw opens and play
            > but
            > the error also comes up, can any body tell me what i am doing wrong?
            >
            >
            >
            > on mouseUp me
            > pClickLoc = sprite(me.spriteNum).mapStageToMember(the clickLoc)
            > case hexString(sprite(me.spriteNum).member.image.getPixel(pClickLoc)) of
            > "#FFFFFF": go "quiz"
            > "#0000FE": go "slideshow" -- blue goes to slideshow
            > "#FE0000": go window().new("clip"), window("clip").open() -- opens a miaw
            > otherwise: nothing
            > end case
            > end
            >


            • 3. Re: string expected error help
              ajrobson Level 1
              I tired that and got a different error, but the weird thing is it worked last night by just having
              "#FE0000": window("clip").open()

              Now i am getting a error saying the object expected can anybody tell me why or how to solve this?
              • 4. Re: string expected error help
                Level 7
                > Now i am getting a error saying the object expected can anybody tell me why or
                > how to solve this?

                You need to learn how to use the debug tools available in the authoring
                environment.
                When an error of this sort occurs, you are presented with the option on
                the error dialog to debug. If you click that button the debugger opens
                and shows which line in the script threw the error. You can also view
                variables and the call stack here.

                I suspect you are using Director MX2004 and that your movie's
                scriptExecutionStyle is 10. If that is so, you can't address a window
                that doesn't exist the way you are trying to.

                Did you try the snippet I posted earlier?
                • 5. Re: string expected error help
                  ajrobson Level 1
                  thanks i tried your earlier post and it worked, can you tell me what
                  w.filename = "@/clip" does what does @/ mean?

                  i'll leave it this way as it works but i still dont know why it worked with just the open bit yesterday and not it don't work! guess its one of those things!
                  • 6. Re: string expected error help
                    Level 7
                    > can you tell me what
                    > w.filename = "@/clip" does

                    It sets the filename of the window stored in the (local) variable 'w' to
                    a file named "clip" in the same directory as the current movie.

                    > what does @/ mean?

                    I suggest you press F1 and look up '@' in the Index tab of the help
                    window that opens