2

I have found several solutions for this,but non of those solutions work for me.Can someone help me with this please. here is my code :

<?xml version="1.0" encoding="utf-8"?>
<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/mx" name="app_clock" 
               minWidth="150" minHeight="150" width="150" height="150" backgroundAlpha="0.0">


               <fx:Script>
        <![CDATA[   

        ]]>
    </fx:Script>
    <fx:Declarations>
    </fx:Declarations>  

               <s:Graphic id="clock_graphics">  
        <s:Ellipse width="90" height="90" x="5" y="5">
            <s:stroke>
                <s:LinearGradientStroke weight="50" rotation="60">
                    <s:entries>
                        <s:GradientEntry color="#B5B5B5">                           
                        </s:GradientEntry>
                        <s:GradientEntry color="#494949">                           
                        </s:GradientEntry>
                    </s:entries>
                </s:LinearGradientStroke>
            </s:stroke>
        </s:Ellipse>    
        </s:Graphic>

</s:Application>

And I have setup in js to this params.wmode = "transparent"; and in object

<param name="bgcolor" value="transparent" />
<param name="wmode" value="transparent" />  

Does anybode have a solution that work ? Tnx in advance.

user147
  • 1,312
  • 5
  • 22
  • 41
  • What exactly do you need to fix? You mention several solutions you've already tried, what are they? Keep in mind that not every web browser handles transparency in the same way, e.g. most linux browsers don't work with flash transparency. – Kyle Jun 06 '11 at 22:34
  • @Kyle I didn't know that on linux doesn't work,that is ok,I just need for firefox,chrome and explorer :) , I want transparent background. So ellipse graphic have some color,everything else(background) I want transparent, if you type flex 4 transparent background on google,than you will see what have I tried,I'm not flex developer,maybe I have done something wrong,tnx in advance,sorry on my bad English. – user147 Jun 06 '11 at 22:40
  • Why won't simply setting the alpha to 0 work? – Kyle Jun 06 '11 at 22:48
  • @Kyle,I try,that didn't work. – user147 Jun 06 '11 at 22:51

1 Answers1

5

'Backgroundalpha' won't work. You'll need to create a custom transparent application skin class. Something like this:

<s:Skin xmlns:fx="http://ns.adobe.com/mxml/2009" 
        xmlns:s="library://ns.adobe.com/flex/spark">

<fx:Metadata>
    [HostComponent("spark.components.Application")]
</fx:Metadata>

<s:states>
    <s:State name="normal" />
    <s:State name="disabled" />
</s:states>

<s:Rect id="backgroundRect" left="0" right="0" top="0" bottom="0">
    <s:fill>
        <s:SolidColor alpha="0" />
    </s:fill>
</s:Rect>

<s:Group id="contentGroup" left="0" right="0" top="0" bottom="0" 
         minWidth="0" minHeight="0" />

</s:Skin>

and assign it to your Application:

 <s:Application ... skinClass="MyTransparentApplicationSkin" ... />

I've tested this solution on all major browsers. (Yes, that includes Safari)

Furthermore, <param name="bgcolor" value="transparent" /> will do you no good. It will only take color hex codes.

RIAstar
  • 11,912
  • 20
  • 37