House of Fusion
Search over 2,500 ColdFusion resources here
  
Home of the ColdFusion Community

Mailing Lists
Home /  Groups /  Adobe Flex

Flashvars and background colour

  << Previous Post |  RSS |  Sort Oldest First |  Sort Latest First |  Subscribe to this Group Next >> 
Top  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Adrian Lynch
11/17/2008 11:37 AM

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? Adrian Lynch Building a database of ColdFusion errors at http://cferror.org/

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Dave Watts
11/17/2008 04:31 PM

----- Excess quoted text cut - see Original Post for more ----- 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!

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Stefan Richter
11/17/2008 04:48 PM

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: ----- Excess quoted text cut - see Original Post for more -----

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
adrian lynch
11/18/2008 05:48 AM

Thanks Stefan and Dave, it was not having a default value in the app tag that did it. Adrian

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Stefan Richter
11/18/2008 05:54 AM

How come my example worked then - it didn't have a default color either? Cheers Stefan On 18 Nov 2008, at 10:39, adrian lynch wrote: > Thanks Stefan and Dave, it was not having a default value in the app   > tag that did it. > > Adrian

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
adrian lynch
11/18/2008 05:59 AM

I'm not sure. My app tag now looks like this: <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="horizontal" creationComplete="init()" backgroundColor="0xcccccc"> and I see the colour as I was trying previously with: if (backgroundColour != "") {     application.setStyle("backgroundColor", "0x" + backgroundColour); } Where backgroundColour is set with a flashvar. I wonder what would happen if you tested the same example using a flashvar. I wouldn't expect any difference but might be worth seeing? Adrian ----- Excess quoted text cut - see Original Post for more -----

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Stefan Richter
11/18/2008 06:24 AM

yeah strange - I won't try it now but one to keep in mind Regards, Stefan stefan@flashcomguru.com www.flashcomguru.com On 18 Nov 2008, at 10:50, adrian lynch wrote: ----- Excess quoted text cut - see Original Post for more -----


<< Previous Thread Today's Threads Next Thread >>

Search flex

March 22, 2010

<<   <   Today   >   >>
Su Mo Tu We Th Fr Sa
   1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30 31