the following works fine for me (Flex 3):

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml";  
layout="absolute" creationComplete="init();">


        <mx:Script>
                <![CDATA[
                        
                        
                        private function init():void
                        {
                                var bg:String = "FF0066";
                                application.setStyle("backgroundColor", "0x" + 
bg);
                        }
                        
                ]]>
        </mx:Script>
        
</mx:Application>


Maybe Adrian's backgroundColour is a reserved word of sorts?

Regards,

Stefan





On 17 Nov 2008, at 21:24, Dave Watts wrote:

>> I'm passing in a colour via flashvars and then attempting to set the
>> background colour with:
>>
>> backgroundColour =  
>> Application.application.parameters.background_colour;
>>
>> application.setStyle("backgroundColor", "0x" + backgroundColour);
>>
>> But the concatenation doesn't work. Trawling the docs, I haven't  
>> even found
>> a way to create a colour object from a string.
>>
>> Any ideas how I might achieve this?
>
> You must have a backgroundColor defined initially, or you can't set
> its style at runtime:
>
> http://jessewarden.com/2005/01/flex-chronicles-8-backgroundcolor.html
>
> Dave Watts, CTO, Fig Leaf Software
> http://www.figleaf.com/
>
> Fig Leaf Software provides the highest caliber vendor-authorized
> instruction at our training centers in Washington DC, Atlanta,
> Chicago, Baltimore, Northern Virginia, or on-site at your location.
> Visit http://training.figleaf.com/ for more information!
>
> 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;207172674;29440083;f

Archive: http://www.houseoffusion.com/groups/flex/message.cfm/messageid:5538
Subscription: http://www.houseoffusion.com/groups/flex/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.37

Reply via email to