8 Replies Latest reply on Apr 18, 2007 8:50 AM by Newsgroup_User

    scripts

    newmfa
      Hello All,
      in my director movie, i have one button, this button has script,
      is lingo has ability to change its script with other when i click it..?

      i tried "scriptInstanceList" but it may be mission impossible..?

      newmfa
        • 1. Re: scripts
          Level 7
          Why would you want to do this? Do you want the sprite to behave
          differently once it has been clicked?

          --
          Rob
          _______
          Rob Dillon
          Adobe Community Expert
          http://www.ddg-designs.com
          412-243-9119

          http://www.macromedia.com/software/trial/
          • 2. Re: scripts
            newmfa Level 1
            my movie include button named "check", this button check a text box if user write on it .. for example "Hen" go to marker "excellent" else go market "wrong"..
            i mean that check button will check different words..about 78 words, so i want check all these words with only this button.. if my information not enough i will attach dir movie to explain more..

            newmfa
            • 3. Re: scripts
              Level 7
              It sounds like you're better off using a list of those words or multiple
              lists or even field members with words (although slower) any of which would
              act as a database. I'm not sure where changing scripts would help. You can
              write a behavior with a case statement or other conditional statement that
              will respond to each possible state your operation is in.

              Craig


              --
              Craig Wollman
              Lingo Specialist
              Word of Mouth Productions
              212-928-9581

              www.wordofmouthpros.com
              "newmfa" <webforumsuser@macromedia.com> wrote in message
              news:evltom$mt2$1@forums.macromedia.com...
              > my movie include button named "check", this button check a text box if
              > user
              > write on it .. for example "Hen" go to marker "excellent" else go market
              > "wrong"..
              > i mean that check button will check different words..about 78 words, so i
              > want
              > check all these words with only this button.. if my information not enough
              > i
              > will attach dir movie to explain more..
              >
              > newmfa
              >


              • 4. Re: scripts
                Level 7
                Is there one text space to check and one button, and this one button's
                action will check for 78 different words? or do you have 78 different
                places in your movie where you want to check what's been written into a
                text member?

                If it's the latter, then you can write a behavior and set the word to
                check for and the marker to move to for each one.

                --
                Rob
                _______
                Rob Dillon
                Adobe Community Expert
                http://www.ddg-designs.com
                412-243-9119

                http://www.macromedia.com/software/trial/
                • 5. Re: scripts
                  newmfa Level 1

                  here is the movie http://www.geocities.com/newmfa/mov06.dir

                  if you click on button "A" lingo write in text box letter "A", and the same
                  about button "B" and if you type "Aaa" and click "ok" button you will go
                  screen "GOOD", if you type else you go to screen "WRONG"..

                  the problem here is make button "OK" check more than word, I mean you can see
                  that "OK" button check word "Aaa" only, my aim is check other words for example "Aaaa"..i think
                  I will solve that by change "OK" sprite by other one, but how..I tried, but number of sprite make
                  some troubles, do you have other solve?

                  newmfa
                  • 6. Re: scripts
                    Level 7
                    One way to deal with this is to create a case statement to check for all
                    possible correct words. Another method is to put all of the correct
                    words in a list and compare the user's entry with the items in the list.
                    The first is useful for going to a unique new frame for each correct
                    word entry, the second is useful for going to the same new frame for any
                    correct entry. You could also build a second list of markers to move to
                    to use with the list method.

                    example 1:

                    ------------------
                    on mouseUp me
                    stringToCompare = member("textArea").text
                    case (true) of
                    stringToCompare = "aaa": go to "good"
                    stringToCompare = "bbb": go to "good2"
                    otherwise: go to "bad"
                    end case
                    end
                    -----------------

                    example 2:

                    ------------------
                    wordList = ["aaa","bbb"]

                    on mouseUp me
                    if wordList.getOne(member("textArea").text) > 0 then
                    go to "good"
                    else
                    go to "bad"
                    end if
                    end
                    -------------------

                    example 3:

                    -------------------
                    wordList = ["aaa","bbb"]
                    markerList = ["good","good2"]

                    on mouseUp me
                    if wordList.getOne(member("textArea").text) > 0 then
                    go to markerList[wordList.getOne(member("textArea").text)]
                    else
                    go to "bad"
                    end if
                    end
                    -------------------

                    --
                    Rob
                    _______
                    Rob Dillon
                    Adobe Community Expert
                    http://www.ddg-designs.com
                    412-243-9119

                    http://www.macromedia.com/software/trial/
                    • 7. Re: scripts
                      newmfa Level 1
                      many thanks for your efforts..

                      next dir movie exact what i mean http://www.geocities.com/newmfa/checking.dir
                      sure your code gave me alot, but i forget tell you that "check" button
                      has two jobs:

                      1- check text box
                      2- check w3d scene visible
                      I mean..
                      "if text area include word "RED" and the sametime the w3d member "red box" is visible,
                      then go marker "good" and exchange member "red box" with member "green box",
                      else go marker "wrong"

                      after that same "check" button check that event:
                      "if text area include word "GREEN" and the sametime the w3d member "green box" is visible,
                      then go marker "good" and exchange member "green box" with member "blue box",
                      else go marker "wrong"

                      i don't know is this possible with lingo or not..?!

                      in every case, many thanks

                      regards
                      newmfa

                      • 8. Re: scripts
                        Level 7
                        Yes, that should be possible. The code would work pretty much the way
                        that you describe it.

                        --
                        Rob
                        _______
                        Rob Dillon
                        Adobe Community Expert
                        http://www.ddg-designs.com
                        412-243-9119

                        http://www.macromedia.com/software/trial/