5 Replies Latest reply on Jul 12, 2006 5:13 PM by Newsgroup_User

    showing variables

    Opera Rat Level 1
      I've searched everywhere (too frantically) and I can't find how to do a basic output to the stage task.

      I just want the stage to say: "you've scored xxx" where xxx is global variable xxx.
        • 1. Re: showing variables
          Level 7
          There are many ways but one is to add a text member or field member to the
          stage. Then wherever you want to add the score use:

          put "you've scored " & xxx into field "name of field member"

          or

          put "you've scored " & xxx into member "name of text member"

          you could also use dot syntax.

          --
          Craig Wollman
          Word of Mouth Productions

          phone 212 928 9581
          fax 212 928 9582
          159-00 Riverside Drive West #5H-70
          NY, NY 10032
          www.wordofmouthpros.com


          "Opera Rat" <webforumsuser@macromedia.com> wrote in message
          news:e8uksb$fki$1@forums.macromedia.com...
          > I've searched everywhere (too frantically) and I can't find how to do a
          > basic output to the stage task.
          >
          > I just want the stage to say: "you've scored xxx" where xxx is global
          > variable xxx.


          • 2. Re: showing variables
            Opera Rat Level 1
            Well it's not working. The fields come up empty. I tried to simplify it too. Here is what I did:

            In a 10 frame span of the movie I made Score Reading it's own text member and next to it a put an empty field called srResults. I did the same for the remaining variables that the program kept track of (Tonal Answer and a taResults text field).

            Then in the script channel in the frame before the text appears I put the following script:

            on exitFrame me
            global sr, ta, tl, fe, sdi, mii, ma, hii, sti, tha, sffr, tr, ca, fs, scr
            put sr into field "srResults"
            put ta into field "taResults"
            end

            Why do I need to restate my global variables every time I use them?
            • 3. Re: showing variables
              Level 7
              if your field is named srResults then two things could be wrong. Your
              global variables might have the value of an empty string ("") which would
              make it appear that nothing happens, or the text in the fields is the same
              color as the background.

              add this line in your exitframe handler...

              put "sr = " & sr && "ta = " & ta

              after that handler runs, open the message window (CNTRL-M) and see what the
              values of those two globals are.

              You don't have to necessarily need to restate your global variables every
              time you use them. First, you only need to declare those that you are using
              in any particular script window. You do this by placing the global
              statement outside all handlers in a script window, typically at the top.
              This way any variable in the global statement is available to any handler
              within that script window, whether its a behavior, a movie script or a
              parent script.

              So, yes, you do need to declare them for each script window but not for each
              handler. If you place them inside the handlers where you're going to use
              them then you do need to declare only those which are to be used in that
              handler. Interestingly, if you use this technique (which I don't
              recommend), the globals declared within a handler aren't available to other
              handlers in that script window.

              --
              Craig Wollman
              Word of Mouth Productions

              phone 212 928 9581
              fax 212 928 9582
              159-00 Riverside Drive West #5H-70
              NY, NY 10032
              www.wordofmouthpros.com


              "Opera Rat" <webforumsuser@macromedia.com> wrote in message
              news:e8v2p5$2rc$1@forums.macromedia.com...
              > Well it's not working. The fields come up empty. I tried to simplify it
              > too.
              > Here is what I did:
              >
              > In a 10 frame span of the movie I made Score Reading it's own text member
              > and
              > next to it a put an empty field called srResults. I did the same for the
              > remaining variables that the program kept track of (Tonal Answer and a
              > taResults text field).
              >
              > Then in the script channel in the frame before the text appears I put the
              > following script:
              >
              > on exitFrame me
              > global sr, ta, tl, fe, sdi, mii, ma, hii, sti, tha, sffr, tr, ca, fs,
              > scr
              > put sr into field "srResults"
              > put ta into field "taResults"
              > end
              >
              > Why do I need to restate my global variables every time I use them?
              >


              • 4. Re: showing variables
                Opera Rat Level 1
                IT WORKS!! When I put:

                put "sr = " & sr && "ta = " & ta

                in my exitframe handler. It didn't work right away. I was depressed and gave up on it for a while. Then I started moving things around on the timeline to make space for transitions and fades that correspond to voiceovers. Then I tested it again and it worked! Thank you so much, Craig.
                • 5. Re: showing variables
                  Level 7
                  I'm glad you solved it.


                  --
                  Craig Wollman
                  Word of Mouth Productions

                  phone 212 928 9581
                  fax 212 928 9582
                  159-00 Riverside Drive West #5H-70
                  NY, NY 10032
                  www.wordofmouthpros.com


                  "Opera Rat" <webforumsuser@macromedia.com> wrote in message
                  news:e920ga$me5$1@forums.macromedia.com...
                  > IT WORKS!! When I put:
                  >
                  > put "sr = " & sr && "ta = " & ta
                  >
                  > in my exitframe handler. It didn't work right away. I was depressed and
                  > gave
                  > up on it for a while. Then I started moving things around on the timeline
                  > to
                  > make space for transitions and fades that correspond to voiceovers. Then
                  > I
                  > tested it again and it worked! Thank you so much, Craig.
                  >