Skip navigation
Currently Being Moderated

add drop shadow with css?

Dec 16, 2008 6:50 AM

is there a way to add a dropshadow with css? (specifically to a label component)


Thanks!
 
Replies
  • Currently Being Moderated
    Dec 16, 2008 8:49 AM   in reply to john isaacks
    No, drop shadows are implemented as filters, not styles. They cannot be set via CSS in Flex 3.

    matt horn
    flex docs
     
    |
    Mark as:
  • Currently Being Moderated
    Dec 16, 2008 10:14 AM   in reply to john isaacks

    "danger42" <webforumsuser@macromedia.com> wrote in message
    news:gi8m68$i9s$1@forums.macromedia.com...
    > No, drop shadows are implemented as filters, not styles. They cannot be
    > set via CSS in Flex 3.

    You could, however, extend whatever component it is you're wanting to apply
    the style to to add the capability of a CSS drop shadow.


     
    |
    Mark as:
  • Currently Being Moderated
    Feb 14, 2009 11:05 AM   in reply to matthew horn
    quote:

    Originally posted by: danger42
    No, drop shadows are implemented as filters, not styles. They cannot be set via CSS in Flex 3.

    matt horn
    flex docs


    Although Matt's reply is true with respect to label components, which is what the original question addressed, it's worth pointing out that MXML Styles can set dropshadows on components which happen to expose the dropShadowEnabled property. Perhaps this is new to Flex 3.2.

    For example, CSS can apply dropshadows to TextArea, Canvas, DataGrid, AdvancedDataGrid, and other list-based containers, but not to Buttons, Labels, ComboBoxes, Images, etc. The rationale for exposing or not exposing the dropShadowEnabled (and dropShadowColor) property is not clear, so you have to refer to the docs.

    I would recommend updating this Answer with a bit more detail.

    Thanks,

    Allen
     
    |
    Mark as:
  • Currently Being Moderated
    Mar 5, 2009 9:44 AM   in reply to ashtangakasha
    quote:

    Originally posted by: ashtangakasha
    quote:

    Originally posted by: danger42
    No, drop shadows are implemented as filters, not styles. They cannot be set via CSS in Flex 3.

    matt horn
    flex docs


    Although Matt's reply is true with respect to label components, which is what the original question addressed, it's worth pointing out that MXML Styles can set dropshadows on components which happen to expose the dropShadowEnabled property. Perhaps this is new to Flex 3.2.

    For example, CSS can apply dropshadows to TextArea, Canvas, DataGrid, AdvancedDataGrid, and other list-based containers, but not to Buttons, Labels, ComboBoxes, Images, etc. The rationale for exposing or not exposing the dropShadowEnabled (and dropShadowColor) property is not clear, so you have to refer to the docs.

    I would recommend updating this Answer with a bit more detail.

    Thanks,

    Allen


    I use CSS to add drop shadows; alternately I declare them as an MXML attribute. There's peculiar an unexpected hitch with either approach. It seems that you must set also set a borderStyle or dropShadowEnabled has no effect.

    Phrankie
     
    |
    Mark as:
  • Currently Being Moderated
    Mar 5, 2009 12:07 PM   in reply to Phrankie
    Phrankie,

    Yes, I noticed that too. I found that a plain border seemed to work most consistently, but I didn't test thoroughly. If I don't want a border, I have to leave it set to flat and then set the thickness to zero.

    I hope Matt notices these replies. I'd feel better if the Answer were updated to be more accurate. Or, if setting dropshadows via CSS is not supposed to work, then it would be good to know that.
     
    |
    Mark as:
  • Currently Being Moderated
    Mar 5, 2009 7:49 PM   in reply to ashtangakasha
    quote:

    Originally posted by: ashtangakasha
    Phrankie,

    Yes, I noticed that too. ... If I don't want a border, I have to leave it set to flat and then set the thickness to zero.


    Thanks for confirming this peculiar behavior. In this case it seems odd that one attribute would be dependent upon another.

    I hope Matt notices these replies. I'd feel better if the Answer were updated to be more accurate. Or, if setting dropshadows via CSS is not supposed to work, then it would be good to know that.


    Agreed,

    Phrankie

     
    |
    Mark as:
  • Currently Being Moderated
    Mar 7, 2009 10:04 PM   in reply to ashtangakasha

    "Phrankie" <webforumsuser@macromedia.com> wrote in message
    news:gop31l$24j$1@forums.macromedia.com...
    >
    quote:

    Originally posted by: ashtangakasha
    >
    quote:

    Originally posted by: danger42
    > No, drop shadows are implemented as filters, not styles. They cannot be
    > set
    > via CSS in Flex 3.
    >
    > matt horn
    > flex docs

    >
    > Although Matt's reply is true with respect to label components, which is
    > what
    > the original question addressed, it's worth pointing out that MXML Styles
    > can set dropshadows on components which happen to expose the
    > dropShadowEnabled property. Perhaps this is new to Flex 3.2.
    >
    > For example, CSS can apply dropshadows to TextArea, Canvas, DataGrid,
    > AdvancedDataGrid, and other list-based containers, but not to Buttons,
    > Labels,
    > ComboBoxes, Images, etc. The rationale for exposing or not exposing the
    > dropShadowEnabled (and dropShadowColor) property is not clear, so you have
    > to
    > refer to the docs.

    I think it depends on whether the component has a HaloBorder or not.


     
    |
    Mark as:
  • Currently Being Moderated
    Mar 8, 2009 7:49 AM   in reply to john isaacks
    Ah, yes. That makes sense. I haven't poked into the source, but it sounds like the dropshadow may be a method of the border itself.
     
    |
    Mark as:
  • Currently Being Moderated
    Jul 5, 2011 11:30 PM   in reply to john isaacks

    Hi ,

    I  m using Flex 4. I would like to know now if this feature is avalaible for labels .

     

    Thanks,

    Sohil

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points