3 Replies Latest reply on Jan 14, 2011 11:18 AM by yuval_italia

    Flash plugin stops playing when hidden or on different tab.

    yuval_italia

      I've noticed (a few months ago, actually) that in most browsers I use  to test my application (Firefox, chrome and explorer) the flash plug in,  while playing it's content, will stop, or freeze, when the actual plug in  playback window is out of the window (due to scrolling, or switching  tabs), or covered by another window (a different browser or program  window that will cover the visible area of the player), which is  something good, and nice, when you think about web pages full of  commercials slowing down your browser and computer in general, but what  happens when you a games programmer, who work with multiplayer games, on  games which are mostly turn based?

      If one of my players switches  tabs, open a new window over the browser, or god forbids, scroll down  the page, the game is essentially stopped, since no events occur on that  players side of the game!!

      And this does not effect just simple  frame based animation, but everything, onEnterFrame events stop,  setInterval stops... the only thing that I could find that does not stop  when this happens is a setInterval action done in a different swf,  which is loaded to a different level of my game file.

       

      How  can I by pass this? and what did Adobe or who ever came up with this  idea, was thinking? a whole community of games programmers left to dry  in the sun??

       

      Hoping for a solution to be found for this problem, since my boss is already talking Java, and I don't want to go there....

       

      Thanks.

       

      Yuval Lahav.

        • 1. Re: Flash plugin stops playing when hidden or on different tab.
          yuval_italia Level 1

          Since I've noticed this a few months ago already, but still can't find anything on google about this problem, and no one here seems to have the same problem or comment on this in anyway, I'm left with 3 options... either this is something that is so well knows and so common, and the solution is so simple and everyone already knows it and so everyone assumes this is some kind of a joke and they don't reply, or no one untill now has notices this problem exist or... no one is programming multiplayer games with flash anymore, so now one cares, since no one is effected...

           

          So whats the deal here??

          • 2. Re: Flash plugin stops playing when hidden or on different tab.
            Lee Burrows Level 4

            hi

             

            you could try adding this to your html (see http://help.adobe.com/en_US/as3/mobile/WS4bebcd66a74275c36cfb8137124318eebc6-7ffd.html):

             

            <param name="hasPriority" value="true" />

             

            i haven't looked into this new feature myself yet, so i don't know if it only applies to mobiles...

            • 3. Re: Flash plugin stops playing when hidden or on different tab.
              yuval_italia Level 1

              The article clearly states that:

              "regardless of the value of the hasPriority parameter, a SWF file that is not visible to the user always has its rendering paused".

              And this is a big big big big huge huge terrible terrible  problem for programmers and users of flash based turn by turn games,  since as a player, if I would want to "cheat" the game, all I need to do  is simply switch to another tab in the browser, or open a new window, a  program, something to cover the screen, and that would "pause" the  game.

              This new feature is, and will, kill the turn by turn based  games, time based games  (since now I can "pause" the timer) and if you  think about it, real time games also, as rendering stops completely when  the swf is not visible on the screen!!

              This is not only ridiculous, it's going to create problems for all flash developers of real dynamic online content!!