Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I have a post on my blog on how to make this exact component <a href="http://www.soliantconsulting.com/blog/2009/10/bevel-gradient-component/" rel="nofollow noreferrer">Here</a>.</p> <p>You create a basic custom MXML component (extending in this case, VBox). You specify a programmatic skin, which is where the bevel and gradient gets applied.</p> <p>The programmatic skin does all it's drawing in the updateDisplayList function. </p> <p>Here is some of the code (the rest is on my blog, with a demo)</p> <pre><code> var g:Graphics = graphics; var cn:Number = this.getStyle("cornerRadius"); var crtl:Number = this.getStyle("cornerRadiusTopLeft") &gt; 0 ? this.getStyle("cornerRadiusTopLeft") : cn; var crtr:Number = this.getStyle("cornerRadiusTopRight") &gt; 0 ? this.getStyle("cornerRadiusTopRight") : cn; var crbl:Number = this.getStyle("cornerRadiusBottomLeft") &gt; 0 ? this.getStyle("cornerRadiusBottomLeft") : cn; var crbr:Number = this.getStyle("cornerRadiusBottomRight") &gt; 0 ? this.getStyle("cornerRadiusBottomRight") : cn; var gradFrom:Number = this.getStyle("gradientFrom"); var gradTo:Number = this.getStyle("gradientTo"); var b:EdgeMetrics = borderMetrics; var w:Number = unscaledWidth - b.left - b.right; var h:Number = unscaledHeight - b.top - b.bottom; var m:Matrix = verticalGradientMatrix(0, 0, w, h); g.clear(); g.beginGradientFill("linear", [gradFrom, gradTo], [1, 1], [0, 255], m); g.lineStyle(1,borderColor,1,true,LineScaleMode.NORMAL,CapsStyle.ROUND,JointStyle.ROUND); GraphicsUtil.drawRoundRectComplex(g, b.left, b.top, w, h, crtl, crtr, crbl, crbr); g.endFill(); } </code></pre> <p>for a demo, look <a href="http://xanthos.soliantconsulting.com/charmer/bevelGradient/BevelGradientVBoxDemo.html" rel="nofollow noreferrer">Here</a>. Hope this helps.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload