return undefined;


Solid HRule/VRule in Flex

Posted in Flex by Ben on the May 1st, 2008

This was completely non-obvious to me so figured I would blog it. To create a rule more than one pixel thick of a solid color use this format:

<mx:HRule width="500"
    strokeWidth="4"
    strokeColor="#1278A7"
    shadowColor="#1278A7"
    opaqueBackground="#1278A7" />

opaqueBackground is the key attribute since by default (and counter intuitively) rules are actually borders around a transparent rectangle.

2 Responses to 'Solid HRule/VRule in Flex'

Subscribe to comments with RSS or TrackBack to 'Solid HRule/VRule in Flex'.

  1. Rob McKeown said,

    on May 1st, 2008 at 2:21 pm

    Where were you yesterday? I just came across this and ended up just using a 5 pixel tall canvas instead. I will have to go back and change it now. Thanks :-)


  2. on May 20th, 2008 at 12:27 pm

    Ben, thanks for this post. I actually just used your technique in a custom component container wrapper and it was perfect for what we needed. Just wanted to say thanks for this specific post and keep up the good work yo from ATL sucka.

Leave a Reply