4 Replies Latest reply on Dec 17, 2012 10:14 AM by new2oop

    optimizing scaled swf

    new2oop Level 1

      In an air app I'm using loading swfloader to load a 600x800 swf game. In flex I detect the screen size and scale the swf to full screen. The swfs are simple games but they stutter at full screen. I've used the latest flash player, cached as bitmap, GPU render and other recommended optimizations but even at 15fps its still not smooth. Is there anything else I can do (short of moving to starling)? Im assuming the graphics are being rescaled every frame and this would be very cpu/gpu intensive. Rescaling all the game graphics individually (there are several games) would be a big job but is there a way to tell the swf to prescale all the graphics at the beginning of the game or there another major optimization I can do?

        • 1. Re: optimizing scaled swf
          Flex harUI Adobe Employee

          Do you have any other content outside of the game?  How are you scaling?  Via StageScaleMode?

          • 2. Re: optimizing scaled swf
            new2oop Level 1

            Thanks for the reply.

             

            Have tried to have minimal Flex content in the background, have two fullscreen display objects (can reduce it to one). The Flex starts with this:

             

             

            stage.displayState = StageDisplayState.FULL_SCREEN_INTERACTIVE;

            homeScreen = new HomeScreen();

            addElement(homeScreen);

             

            The 'homescreen' loads the game swf. It also has several buttons on it, but these should be being removed when the game is running as they are in a different "State".

             

            I'm using Flex to handle the scaling:

            <s:SWFLoader id="swfLoader" source="game.swf" scaleX="{myScale}" scaleY="{myScale}" complete="prepareGame();"/>

             

            Is there a better way?

            • 3. Re: optimizing scaled swf
              Flex harUI Adobe Employee

              It isn’t clear there is a better way.

               

              Are you trying to display other stuff around the game?  Or overlay something on the game?

               

              You might still try StageScaleMode and see if it works better.

               

              -Alex

              • 4. Re: optimizing scaled swf
                new2oop Level 1

                thanks I'll try that. However its not always displayed in full screen so the swf probably needs to be controlled from Flex. Although it is a simple game, the moving objects can at times  consume a large part of the screen so I might need to tolerate it till I move the game to starling.