6 Replies Latest reply on Sep 13, 2015 5:09 PM by Colin Holgate

    Starling and Flash Professional

    brklemz

      Hi there,

       

      I bought the book "Starling Game Development Essentials" from PacktPub (by Juwal Bose) and I downloaded the sample code.

       

      But the book only describes using Flash Builder and I am using Flash Professional (CC). I have built several games using Flash Pro with AS3 that are in iTunes and I was hoping to learn how to use Starling's code to improve performance.

       

      No surprise, the samples do not work. First, nothing worked, it was not linked to Starling so it didn't find what was needed and I got loads of can't-find-this errors. So, I tried building a FLA for the Chapter 1 demo, updated the Class to point at the demo actionscript, and I updated the library path to include Starling. All the can't-find-this errors are now gone but I now get the error "Context3D not available" in a big black box (along with the simulator window) when I try to run the demo.

       

      My machine is a MacBook Pro which is current and I am using Adobe CC which is also current.

       

      Can I use the examples in this book on my setup (and if so, how)?

       

      I should note that all the online demos I can find for Starling use Flash Builder.

       

      So, more generally, can I use Starling with Flash Professional (and if so, how)?

       

      If the answer is "no" to the above questions, does anyone want a book about Starling?

       

      Thanks in advance.

       

       

       

       

       

        • 1. Re: Starling and Flash Professional
          Colin Holgate MVP & Adobe Community Professional

          I just tried the sample code (which you can download by the way, to make sure you didn't mistype things Code Downloads | PACKT Books ), I had to put a copy of the starling folder into the src folder, and a copy of the adobe folder (in order to get AGALMiniAssembler in place) into the com folder.

           

          Once you have those in place you would take the TopDownDemo.as file and make it be the document class of a new FLA. This line:

           

          [SWF(backgroundColor = "#000000", frameRate = "30", width = "800", height = "600")]

           

          isn't needed by Flash Pro, but it does no harm. It does tell you that you would make the FLA be 800x600, 30 fps, black stage color.

           

          Save the FLA in the same folder as the src folder, and in the ActionScript 3.0 settings add another entry to the Source Path tab, of: src/

           

          Test Movie then works without any errors.

           

          So, the general approach with using Flash Builder demo code in Flash Pro is to take the main AS file and make it be the document class of a new FLA, set the size and frame rate and stage color to what the SWF line suggests, add src/ to the Source Path, and make sure that the starling and adobe folders are in place.

           

          To answer your question about can Flash Pro do Starling, yes it can.

          • 2. Re: Starling and Flash Professional
            Colin Holgate MVP & Adobe Community Professional

            Ha! I just noticed something key that you wrote, about the Simulator window being open. That made me realize you were testing as an iOS or Android FLA. Don't do that. Or if you do, just test with the iPhone Simulator or on an actual device.

            • 3. Re: Starling and Flash Professional
              brklemz Level 1

              Colin

               

              Yikes, when I simply switched the "Target" to "Flash Player 17" the demo worked perfectly. Many thanks, wow.

               

              But now I have another question (that always happens).

               

              I can now go thorough the book and pick up what I can for the apps we're planning. But, we want to publish our games in iTunes for iOS (educational games for iPad) and that requires AIR. With your help I now know how to code and test on my MacBook in Flash Pro but I do not know how to Publish the game for iOS without re-specifying "AIR 17 for iOS" as the "Target".

               

              If I do that and Publish the app can I test on my iPad? Will I get the "Context3D not available" error? And if I do, can I ignore it and test it in the iPad anyway?

               

              Like all my coding, trial and error still reign supreme I guess.

               

              Thanks for the help, Bruce

              • 4. Re: Starling and Flash Professional
                Colin Holgate MVP & Adobe Community Professional

                I misremembered something. Testing iOS FLAs does work with Starling, but make sure you have the render mode set to Direct, and not Auto.

                • 5. Re: Starling and Flash Professional
                  brklemz Level 1

                  Colin

                   

                  That's perfect. Many thanks. As I search Adobe's help your name comes up often as the "goto guy" and I'm very glad you answered my questions. Now I can play with Starling to try to improve our AIR app's performance.

                   

                  Once again, thanks for the help,

                  Bruce

                  • 6. Re: Starling and Flash Professional
                    Colin Holgate MVP & Adobe Community Professional

                    Always happy to help! By the way, you can get good performance without Starling and Starling requires a particular way of working that may be tricky, especially if you have to get images in and out of the Starling world.

                     

                    There is a Starling forum if you have more questions. Or you can ask here too.