Call Encore now on +44 (0) 1273 722 544 or contact us
Monday 6th, February 2012

Flex skinning tool

Posted by Jethro Grassie on June 7, 2009

Anyone who has done a lot of skinning in Flex will know the simplest, quickest and most effective way is to use a PNG with a scale 9 grid (via the Embed directive).

As an example, applied in CSS:

Button
{
    downSkin: Embed(source="/assets/skin_button_pressed.png",
        scaleGridBottom="23", scaleGridLeft="3", scaleGridRight="11", scaleGridTop="3");
    overSkin: Embed(source="/assets/skin_button_hover.png",
        scaleGridBottom="23", scaleGridLeft="3", scaleGridRight="11", scaleGridTop="3");
    upSkin: Embed(source="/assets/skin_button_normal.png",
        scaleGridBottom="23", scaleGridLeft="3", scaleGridRight="11", scaleGridTop="3");
}

So we get passed a PSD from one of the designers, export the PNG’s, then using an on-screen ruler or the guides in Gimp, work out what the scale grid parameters need to be. And its this last step that is just a bore.

So while toying around with JavaFX 1.2, I knocked together a little application which allows us to simply load a PNG, drag four guides to mark the scale grid, then click a button to copy an Embed tag with correct scale grid values to the system clipboard ready to paste into the code.

I know all of us at Encore will be using this little gem of a time-saver, so for anyone else who fancies using it too, I have packaged it up as a Java Web Start application.

Install and launch here:

4 Comments »

  1. koko8829's me2DAY

    June 8, 2009 // 1:29 am

    열이아빠의 알림…

    Flex skinning tool인데 JavaFX로 만들었다. 이거..ㄷㄷ…

  2. Sönke Rohde

    June 8, 2009 // 2:35 pm

    Hi, I build the same with AIR and a bit more functionality: http://flairskin.com

  3. Jethro Grassie

    June 8, 2009 // 2:52 pm

    @Sönke Rohde
    Very cool. In fairness, I did just knock this out in an hour though ;)

  4. eric fickes

    June 8, 2009 // 4:45 pm

    JavaFX to build Flex, awesome!

Leave a Comment

Like what you see? Then get in touch;
t. +44 (0) 1273 722 544   e. contact us