4 Replies Latest reply on Feb 20, 2007 2:55 PM by pideja

    Global variable

    fo_ka
      How can I create a global variable? At the beggining it will be equal with 1. Each time I press a button it will grow by 1 unit.
        • 1. Re: Global variable
          Level 7
          To make a global variable, just declare it. To make it start with a
          given value, declare it in a startMovie script.

          global gCounter

          on startMovie
          gCounter=1
          end

          Then, to increment it every time a button is clicked, increase it by one:

          global gCounter

          on mouseUp me
          gCounter=gCounter+1
          end

          You must declare the variable as a global in every script that uses it.
          • 2. Re: Global variable
            fo_ka Level 1
            ok that worked, but I can't reset the value each time I start the movie... it keeps growing up
            • 3. Re: Global variable
              Level 7
              Make sure that the startMovie handler I gave you is a #movie script (not
              a behaviour)- then it will reset every time you start it.
              • 4. Re: Global variable
                pideja Level 1
                >>Now if we can just get to knowing where it's breaking. Is anything working at
                all? That would be great...
                >>Does the projector start? Yes, the projector starts, but does not display the correct images. Stays "stuck" on one or two images.
                >>Any error codes? No error messages appear.

                > openFile(myFile, filename, 1) -- Opens file that user selected

                >>Does this line execute if it needs to (SHOWNAME and filename are void)? Yes
                >>Do you see the file open dialog box? I don't usually see the box when it's running. I don't see it even in the deffective Mac version.

                > alert error(myfile,status(myfile)) -- Displays error message

                >>Does your fileIO error checking throw up an alert? No alert messages.

                What, exactly, is not working? When the projector starts (it does start), I see the initial screen that provides a choice of show to see. Upon selecting a show, spacebar should initiate the slide-show (images). What images are shown is listed in the text file. This does not happen. That is to say that the "action" (dissolve time. position, size) do occur, but there is no choice of images. Could the problem reside in the actual text file?