Share on Google+Share on Google+

HRule Control in Flex4

Advertisement
The HRule control is a MX component. It has no Spark component. The HRule is used to create a single horizontal line.

HRule control in Flex4:

The HRule control is a MX component. It has no Spark component. The HRule is used to create a single horizontal line. It is used for dividing a space. You can use the strokeWidth, strokeColor, shadowColor properties for set a style. If strokeWidth is 1 then you can use only strokeColor properties for set a color.
If strokeWidth is more than 1 then You can use strokeColor and shadowColor properties for set a color.
The tag of HRule control is <mx:HRule>.

Example:

 <?xml version="1.0" encoding="utf-8"?>

<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"

xmlns:s="library://ns.adobe.com/flex/spark"

xmlns:mx="library://ns.adobe.com/flex/mx"

minWidth="955" minHeight="600">

<s:Panel title="HRule Control Example" width="177">

<s:VGroup x="10" y="11" width="155" height="73">

<mx:Label text="Above portion of HRule"/>

<mx:HRule strokeWidth="10" strokeColor="0x00ff00" shadowColor="0x0000ff" width="131"/>

<mx:Label text="Below portion of HRule"/>

</s:VGroup>

</s:Panel>

</s:Application>

In this example you can see how we can use a HRule control in Flex4.

Output:

Running Application:

To view this page ensure that Adobe Flash Player version 10.0.0 or greater is installed.

Download this code

Advertisements

Advertisement

Posted on: May 21, 2010 If you enjoyed this post then why not add us on Google+? Add us to your Circles

Share this Tutorial Follow us on Twitter, or add us on Facebook or Google Plus to keep you updated with the recent trends of Java and other open source platforms.