Adobe Dreamweaver Forums



Last 10 THreads :         CS4 Motion Editor issues (Last Post : aaronlyon - Replies : 4 - Views : 9 )           »          Bridge No Longer Rotates Automatically (Last Post : Michael_Palumbo@adobeforums.com - Replies : 1 - Views : 2 )           »          dollarFormat / numberformat problem (Last Post : izdabye - Replies : 0 - Views : 1 )           »          Call out side flex (Last Post : Amy Blankenship - Replies : 15 - Views : 16 )           »          captions for photos (Last Post : dc111652 - Replies : 0 - Views : 1 )           »          Re: CS4 GPU Acceleration and Intel X3100 (Last Post : Paul_B_Brown@adobeforums.com - Replies : 0 - Views : 1 )           »          error 1034 (Last Post : shottogan - Replies : 0 - Views : 1 )           »          Keyboard events don't work in player or projector (Last Post : tunghoy - Replies : 0 - Views : 1 )           »          Help with caption box question (Last Post : NZ-developer - Replies : 1 - Views : 2 )           »          Realistic Cat Hair and... (Last Post : chrisf111 - Replies : 0 - Views : 1 )           »         


User Info Statistics
Go Back   Adobe Dreamweaver Forums > Macromedia Software > Flex
 
Tags:



Reply
  #1 (permalink)  
Old 11-03-2008, 04:37 AM
ericbelair
 
Posts: n/a
Diggs:
Default CSS - How to best handle color settings?

I'm starting to get frustrated with CSS in Flex... It seems like external
stylesheets are a waste of time, since you can't set a lot of styles with them.
Instead I am forced to set the styles in ActionScript, like this:

var dataGridStyle:CSSStyleDeclaration =
StyleManager.getStyleDeclaration("DataGrid");
dataGridStyle.setStyle("headerColors", [0x694845,0x691E19]);
dataGridStyle.setStyle("alternatingItemColors", [0xF1F1F1,0xFFFFFF]);
dataGridStyle.setStyle("rollOverColor", 0xDEDEDE);

Is there some easier/better way to do this? I would really like to be able to
change styles on the fly - or at least not having to compile a file with
updated ActionScript code to change the background color of a component.

Any thoughts?



Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 11-03-2008, 04:37 AM
-Hob
 
Posts: n/a
Diggs:
Default Re: CSS - How to best handle color settings?

You shouldn't have to set your styles in actionscript like that. Changing them
in your stylesheet should work just as well. However...that being said, you DO
still have to re-compile your app after a change to your stylesheet. If all
you're trying to do is test out different colors, and try out different styles,
you might try something like FlexSpy: http://code.google.com/p/fxspy/

FlexSpy will let you change styles on the fly without touching any css or
actionscript.

Reply With Quote
  #3 (permalink)  
Old 11-03-2008, 04:37 AM
ericbelair
 
Posts: n/a
Diggs:
Default Re: CSS - How to best handle color settings?

Hey! You're right...the problem was that I wasn't setting the values as string (i wasn't surrounding the values in double quotes).

I'll check out FlexSpy as well.

Thanks.
Reply With Quote


Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



© Camley Interactive (camley.info) 2008 - all logos and images are copywrite their respective owners.
Proud member of the Camley Interactive Network
All times are GMT. The time now is 03:23 AM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.1.0 ©2007, Crawlability, Inc.
Inactive Reminders By Mished.co.uk