5 Replies Latest reply on Sep 8, 2009 5:53 PM by Sean_Wilson

    on activateWindow blocked?

    Rix Level 1

      Hi there,

       

      Here's a strange one causing me serious grief in Director 11. I need to detect loss of focus on a very large 3D shockwave game in a browser.

       

      I've added this to a movie script along with some start / stop movie lingo...

       

      on activateWindow

      --Do UnPause stuff

      alert"Activated"--try to get some proof that it's been triggered

      end

       

      on deActivateWindow

      --Do Pause stuff

      alert"Deactivated"--try to get some proof that it's been triggered

      end

       

       

      It works perfectly within Director, BUT when viewed in a browser (Chrome / IE7) nothing happens at all. The handlers just aren't called when they should be.

       

      What's strange is that I can get the above to work fine in a browser on a fresh blank build, but not when adding it to my nearly finished game project.

       

      Does anyone know if any reason this might be blocked within a shockwave movie?

       

      Thanks in advance!

       

      Richard

        • 1. Re: on activateWindow blocked?
          Chunick Level 3

          Well, I cannot test in D11 or IE7 for you, but I can confirm that it works using D11.5, and IE8. Chrome and FF3.5 don't catch the on activateWindow.

           

          btw, I would use a text member to output any messages instead of the alert() method when testing in browsers.

          1 person found this helpful
          • 2. Re: on activateWindow blocked?
            Rix Level 1

            Hi,

             

            Thanks for testing.

             

            As mentioned I have got this working in a browser (Chrome and IE7) from a freshly created dir file. But for some reason it's not working when added to a large pre existing project. (Works in Director, but not in browser). That's the real mystery to me.

             

            Thanks for your time!

             

            Richard

            • 3. Re: on activateWindow blocked?
              Sean_Wilson Adobe Community Professional

              What about the #activateApplication handler - does it fire in a browser in Shockwave?

               

              I've no idea why it wouldn't work in a pre-existing project unless you already have the handler implemented in a #movie script that is called first (a lower member.number), or the script you placed the handler in isn't a #movie script.

              1 person found this helpful
              • 4. Re: on activateWindow blocked?
                Rix Level 1

                Hi Sean,

                 

                Yes I did try that too. No luck (seems to be a destop app handler only). I can't find any other calls to these handlers using the text search for all cast + members.

                 

                I have found the bigger the projects get in Director the more wierd things start to happen. My maniacal version saving has saved my bacon many times this big game project!

                 

                Thanks for your time

                 

                Richard

                • 5. Re: on activateWindow blocked?
                  Sean_Wilson Adobe Community Professional

                  You might try using Valentin Schmidt's Director/JavaScript Integration Kit to pass the blur() event from browser-based JS through to Director