5 Replies Latest reply on May 20, 2008 2:38 PM by fazstp

    app is activated just after it is hidden with Alt+tab

    Level 7
      Hi

      I have following problem under Mac

      My application changes screen resolution to the size of application on the
      startup
      And when the user wants to jump to another application without closing
      director app(through ALT+TAB), I should restore original screen resolution.

      Under Windows I've realised it using on activateWindow and on
      deactivateWindow handlers

      on deactivateWindow
      gResolutionXtra.reset_resolution()
      end

      on activateWindow
      gResolutionXtra.set_resolution(1024,768,32)
      end

      But on MAC it works very strange

      Just after application window disappears(after pressing ALT+TAB), it appears
      again; using put-functions I see, that activateWindow handler is called. The
      reason of this is reset_resolution function, which is called in on
      deactivateWindow function. When it is commented - window disappears and is
      activated just on next ALT+TAB or click on application Icon on taskbar -
      directly as I need it and as it works under windows

      Does any one have some workaround, how can I restore the resolution on
      changing to another application but without activating the window again?

      Any help will be appreciated

      game_dev

      P.S. Sorry for Windows terminology for mac problem, but I'm realy new to MAC



        • 1. Re: app is activated just after it is hidden with Alt+tab
          McFazstp
          I just tried this ( not the resolution thing, just the focus ).

          When I deactivate using ALT-TAB it seems to call

          deactivateWindow - deactivateWindow

          when reactivated it calls

          activateWindow


          However the window does disappear. Do you have animateInBackground set? Maybe the deactivateWindow handler returns focus to the window.

          Is it running in a window or full-screen? If full-screen you could try running in a window and using baHideTaskBar( 2 ) to make it look full-screen.
          • 2. DEADLINE:   Re: app is activated just after it is hidden with Alt+tab
            Level 7
            If I do not use reset_resolution function everything works fine

            But at the moment I want to resen resolution in on deactivateWindow
            handler - this strange thing happens - onactivateWindow is called
            authomatically

            How can i prevent it?
            any help will be appreciated
            game_dev


            "McFazstp" <webforumsuser@macromedia.com> wrote in message
            news:g0l0tu$34n$1@forums.macromedia.com...
            >I just tried this ( not the resolution thing, just the focus ).
            >
            > When I deactivate using ALT-TAB it seems to call
            >
            > deactivateWindow - deactivateWindow
            >
            > when reactivated it calls
            >
            > activateWindow
            >
            >
            > However the window does disappear. Do you have animateInBackground set?
            > Maybe
            > the deactivateWindow handler returns focus to the window.
            >
            > Is it running in a window or full-screen? If full-screen you could try
            > running
            > in a window and using baHideTaskBar( 2 ) to make it look full-screen.
            >
            >


            • 3. Re: DEADLINE:   Re: app is activated just after it is hidden with Alt+tab
              stephen_ Level 1
              If the resolution xtra is returning focus to your projector you could try testing the active window with BuddyAPI before using it.


              • 4. Re: DEADLINE:   Re: app is activated just after it is hidden with Alt+tab
                Level 7
                It helps, thank you Stephen_

                another question:
                when the application window is minimized under mac and user press ALT-TAB,
                the window is showed but does not get on activateWindow handler
                User should click into window - and just then window is activated (gets on
                activateWindow event)

                Is there any way to made window be activated just on ALT-TAB combination
                without additional clkick into the window?


                "stephen_" <webforumsuser@macromedia.com> wrote in message
                news:g0ss7g$a0v$1@forums.macromedia.com...
                > If the resolution xtra is returning focus to your projector you could try
                > testing the active window with BuddyAPI before using it.
                >
                >
                >
                >
                > on deactivateWindow
                > active_window = baActiveWindow()
                > gResolutionXtra.reset_resolution()
                > _player.appMinimize()
                > baActivateWindow( active_window )
                > end
                >


                • 5. Re: DEADLINE:   Re: app is activated just after it is hidden with Alt+tab
                  fazstp Level 2
                  You could use a timeout to check the active window.