3 Replies Latest reply on Jul 14, 2011 3:23 PM by Linda Nicholls

    Export scalable pngs for Android

    Felipe 1000

      Hi All.

      Im currently looking for a way to automate the export of nine patch images (http://developer.android.com/guide/developing/tools/draw9patch.html)
      These images are used in Android applications and contain the 9 slice information in a 1px border around the image.
      Instead of drawing these pixels by hand it would be super when FW can automate this on export:
      Is there a way to access the 9-slice coordinates in a FW symbol?
      Would it then be possible to export the (nested) symbol(s) together with this extra border?
      That way FW could export these 9patch images that are ready to be used in an android app and create a scalable interface.
      Hope someone can shine some light on this..
      Thanks
      Felipe

        • 1. Re: Export scalable pngs for Android
          Linda Nicholls Level 4

          According to an earlier post, SWF files maintain their 9-slice coordinates. Have you tried exporting in SWF format from Fireworks? Instead of File > Export, use File > Save As and then for "Save Copy As" choose Adobe SWF. Click on the Options button and check the Maintain Paths and Maintain Editability boxes. Let me know if this works.

          1 person found this helpful
          • 2. Re: Export scalable pngs for Android
            Felipe 1000 Level 1

            Hi Linda,

             

            Thanks for your reply. Tried to get the info out of the SWF but did not get very far. But i managed to get it another way:

             

            1) In the document library choose "export symbols..."

            2) select the desired symbol and click export

            3) import the png in flash (i just dragged it to flash)

            4) a dialog pops up -> click ok

            5) place this script on the first frame: trace((getChildAt(0) as MovieClip).getChildAt(0).scale9Grid);

            6) publish to see the trace which contains the 9slice info

             

            Credits go to my helping colleague :-)

             

            Next step is to automate this, and try to get all the layers / states out

             

            Felipe

            • 3. Re: Export scalable pngs for Android
              Linda Nicholls Level 4

              Excellent! Thanks for posting your solution Felipe.