|
Mailing Lists
|
Home /
Groups /
Adobe Flex
Flashvars and background colour
I'm passing in a colour via flashvars and then attempting to set theAdrian Lynch 11/17/08 11:37 A > I'm passing in a colour via flashvars and then attempting to set theDave Watts 11/17/08 04:31 P the following works fine for me (Flex 3):Stefan Richter 11/17/08 04:48 P Thanks Stefan and Dave, it was not having a default value in the app tag that did it.adrian lynch 11/18/08 05:48 A How come my example worked then - it didn't have a default color either?Stefan Richter 11/18/08 05:54 A I'm not sure.adrian lynch 11/18/08 05:59 A yeah strange - I won't try it now but one to keep in mindStefan Richter 11/18/08 06:24 A 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/ ----- 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! 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 ----- Thanks Stefan and Dave, it was not having a default value in the app tag that did it. Adrian 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 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 ----- 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 -----
|
March 22, 2010
|
Latest Fusion Authority Articles
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||