The following example demonstrates how to use bitmapfill and lineargradient In Flex 4 to set bitmap to fill the background color for the panel.
The following is main. mxml:
Main. mxml: <? XML version = "1.0" encoding = "UTF-8" ?> < S : Application Name = "Spark_panel_fill_bitmapfill_test" Xmlns : FX = Http://ns.adobe.com/mxml/2009" Xmlns : S = "Library: // ns.adobe.com/flex/spark" Xmlns : MX = "Library: // ns.adobe.com/flex/halo" > < MX : Applicationcontrolbar Width = "100%" Cornerradius = "0" > < MX : Form Stylename = "Plain" > < MX : Formitem Label = "Rotation :" > < S : Hslider ID = "Rotationslider" Minimum = "-360" Maximum = "360" Value = "90" Livedragging = "True" Width = "{Pnl. Width }" /> </ MX :Formitem > < MX : Formitem Label = "Ratio :" > < S : Hslider ID = "Ratioslider" Minimum = "0.0" Maximum ="1.0" Value = "0.2" Valueinterval = "0.05" Livedragging = "True" Width = "{Pnl. Width }" /> </ MX : Formitem > </ MX :Form > </ MX : Applicationcontrolbar > < S : Panel ID = "Pnl" Title = "Spark panel title" Width = "320" Height ="240" Horizontalcenter = "0" Verticalcenter = "0" > < S : Rect Width = "100%" Height = "100%" > < S :Fill > < S : Bitmapfill Source = "@ Embed ('Assets/pattern_140.gif ')" /> </ S : Fill > </ S : Rect > < S : Rect Width = "100%" Height = "100%" > < S : Fill > < S : Lineargradient Rotation ="{Rotationslider. Value }" > < S : Gradiententry Color = "White" Alpha = "0.0" Ratio = "0.0" /> < S : Gradiententry Color = "# F0ebd2" Alpha = "1.0" Ratio = "{Ratioslider. Value }" /> </ S : Lineargradient > </ S : Fill > </ S :Rect > < S : Textarea ID = "Textarea" Verticalscrollpolicy = "On" Left = "20" Right = "20" Top = "20" Bottom ="20" > < S : Text > The quick brown fox jumps over the lazy dog. </ S : Text > </ S : Textarea > </ S :Panel > </ S : Application >