4 Replies Latest reply on Oct 28, 2011 2:44 PM by MECS

    Button scripts not working

    MECS Level 1

      I don't think we're in Kansas any more, Toto.  I've been programming with Director ever since version 3.0, and I can't make my buttons work in Director 11.  I realize they are now Flash components, and I realize that may present a whole new set of rules for the game.  Right now, I have a test movie set up to experiment with the Buddy API xtra for desplay resolution set and reset.  The first movie has a button labled "Continue".  It has a sprite script that says,

       

      on mouseUp me

         go to movie "nextMovie2"

      end

       

      The movie entitled "nextMovie2" has a button with a sprite script that says,

       

      on mouseUp me

         quit

      end

       

      Neither of those scripts works.  The buttons highlight when you click them (as long as the mouse is down), and unhighlight when you release the mouse, just as they should.  But nothing happens.

       

      There is no manual, of course, and the help files are, well, shall we say, a bit unrewarding to search through?

       

      Can someone tell me what I'm missing, please?

       

      Thanks!

       

      Dewey

        • 1. Re: Button scripts not working
          Mike Blaustein Level 4

          I'll go out on a limb here and assume that you are using the #flashComponent buttons from the toolbar.  For some reason unbeknownst to mortals, Adobe decided that those buttons will not work by default.  You need to select the member and go to the property inspector, flash component tab, and set the #eventPassMode to #passAlways.  Then it will work.

           

          Alternately, you could use the 'on click me' handler instead of 'on mouseUp me'.

          • 2. Re: Button scripts not working
            MECS Level 1

            That did it, Mike.  Many thanks.  Are you also familiar with the Buddy API xtra?  I am trying to use the set Display function.  Two of the arguments for setting screen rez are "perm" and "temp".  It says that if I use "temp" the screen rez will be restored to it's original setting when the user exits the movie.  That isn't happening.  It also encourages users to utilize MultiDisplay function instead of set Display function.  But I can't find that one in the manual.

             

            All I want to do is set screen rez to the resolution my programs were authored in, then back to users' original settings when they exit the program.

             

            Any light you can shed will be much appreciated.

             

            Dewey

            • 3. Re: Button scripts not working
              Mike Blaustein Level 4

              First of all, some advice.  Don't.  Just don't.  It is very bad form to change someone's screen resolution. It is super annoying when your program crashes and fails to bring the normal resolution back... which then messes up all the desktop icons and other system settings.  Also, you have no idea what kind of monitor people have.  In the old days, it was usually a choice between 640x480, and 1024x768 or something.  Now there are loads of options, with different width-to-height ratios (widescreen), some HD capable, some not, some LCD monitors (like mine) which will ONLY work at one specific resolution.  If I ran your program and it tried to change my screen res, it would probably just go black and I would be pissed.  Widescreen monitors will stretch your image if you set it to the wrong width.  And that is only the tip of the iceberg.  Things get even more complicated for folks (like myself) who have multiple monitors hooked up. 

               

              Just.  Don't.

               

              But that said, in an attempt to actually answer your question, the "temp" option is not what you think.  It will change it until the computer is rebooted, at which point it <should> go back to the original.  If you want to change the resolution back to the original yourself, do so in a stopMovie handler.

               

              And here is the docs for baSetMultiDisplay()

               

              http://www.mods.com.au/budapi_docs/baSetMultiDisplay.htm

              1 person found this helpful
              • 4. Re: Button scripts not working
                MECS Level 1

                Yes, in the process of trying to get this thing going I have actually encountered some of the things you mentioned in your email.  Your words, and those experiences have given me second thoughts about tampering with other people's monitors.  In the past, we have set screen resolutions that would allow our programs to run full screen.  We publish educational software, and we know that it is important for children's eyes to have large details to deal with.  It really aids in their concentration, comprehension, and enjoyment of the learning process.  But, as you said, things are not as simple as they used to be.  Many variables have been thrown into the mix now, and we sometimes have to change our way of doing things to accomodate them.

                 

                I believe the prudent choice woiuld be to include instructions for the users to set their own resolution, and why it's important.  If they choose to, good for them.  If they choose not to, so be it.  I wish the children could have the best possible experience in using the software, but they aren't my children so I can't control that.

                 

                Thanks for sharing your knowledge with me, and thanks for sharing your advice as well.

                 

                Dewey