Flashguy’s Blog
Wicked Actionscript

Transparent Air application with Flashbuilder

June 28th, 2009 by Gabor Wraight

Just a quick one that annoyed me a bit. After my Vacation I came back and was so happy that the Flashbuilder beta was released. It was really necessary coz I wasn’t happy working with Flexbuilder 3 after seeing the Gumbo preview at Max.

So, I started a new AIR Project in Flashbuilder and got stuck imediatly. I wanted a transparent application and this was really easy in Flexbuilder 3.As we now have the Spark framework things have changed a bit. To get an application with no crome and transparency you have to do the following:

  • Set system Chrome to none in the application descriptor file
  • Set transparent to true in the application descriptor file
  • Copy the file ApplicationSkin.mxml from the flex4 library to your project in a folder skins and name it ApplicationAlphaSkin.mxml
  • add the state: <s:State name=”normalInactive” /> as first state in ApplicationAlphaSkin.mxml
  • set alpa=”0″ on the solidcolor of the backgroundRect
  • set the new skin in you application tag: skinClass=”skins.ApplicationAlphaSkin”

Hope this helps someone.

This entry was posted on Sunday, June 28th, 2009 at 15:47 and is filed under Flashbuilder. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.

9 Responses

  1. gg

    dont work for me…

  2. Gabor Wraight

    If you would give me some details on what doesn’t work I could help you.

  3. gg

    ok :

    1) I create one project
    2) I set system Chrome to none in the application descriptor file
    3) Set transparent to true in the application descriptor file

    You talk about ApplicationSkin.mxml, what is it ?

  4. Gabor Wraight

    Ok, that won’t be enough to get it transparent.

    Flashbuilder uses the Spark Framework for Components and Skinning, which means your Application uses ApplicationSkin.mxml for Skinning your Application. In ApplicationSkin.mxml there is a white rect, which is used to fill the background.

    What you need to do is find the file ApplicationSkin.abc in the Flex Framework.
    Click on expand Flex 4.0 in your package explorer. Then expand the flex4.swc, spark, skins and finally default. Here you will find ApplicationSkin.abc. Open it and save it as ApplicationAlphaSkin.mxml in your project in a folder called skins. Now just do the last three Steps from the description above.

    Essentially all you have to do is have your own ApplicationSkin File, where the rect is transparent and tell the Application to use it instead of the default.

  5. MCE

    When you say — set the new skin in you application tag:
    skinClass=”skins.ApplicationAlphaSkin”

    where exactly do you do this? I am completely new to this, was learning/building on Flex 3 project, but decided to switch to FB4. many thanks in advance.

  6. Gabor Wraight

    Hi MCE,
    the application tag is on top of your main mxml file. It should look like this:

    < s:Application xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="library://ns.adobe.com/flex/spark" xmlns:mx="library://ns.adobe.com/flex/halo" minWidth="1024" minHeight="768">

  7. E

    THANK YOU. it’s been giving me a headache all day.

  8. J

    FYI-

    In version 4, build 272416…

    Using backgroundAlpha=”0″ on a WindowedApplication works for me. No changing the Application skin was neccessary. Also need to change systemChrome to none and transparent to true in app descriptor xml.

  9. Gabor Wraight

    Hi Joe,
    thanks a lot for the information.

    As always things change from beta to a final release.

Leave a Comment

Please note: Comment moderation is enabled and may delay your comment. There is no need to resubmit your comment.