09
Aug
07

Rounding a Button control’s corners using the cornerRadius property

A simple example which lets you tweak a Button control’s cornerRadius property using a HSlider control.

Full code after the jump.

View MXML

<?xml version="1.0" encoding="utf-8"?>
<!-- http://blog.flexexamples.com/2007/08/09/rounding-a-button-controls-corners-using-the-cornerradius-property/ -->
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical" verticalAlign="middle" backgroundColor="white">

    <mx:Button id="button" height="40"
            cornerRadius="{slider.value}"
            label="Button.cornerRadius" />

    <mx:HSlider id="slider"
            width="{button.width}"
            minimum="0" maximum="{button.height/2}"
            snapInterval="1" tickInterval="1"
            liveDragging="true"
            dataTipPrecision="0" />

</mx:Application>

View source is enabled in the following example.


0 Responses to “Rounding a Button control's corners using the cornerRadius property”


  1. No Comments

Leave a Reply

This blog is terrible at eating HTML tags. If you plan on posting code/XML, please escape your "<" characters as "&lt;" and your ">" characters as "&gt;".




Badge Farm

  • Powered by Redoable 1.2
  • Cornify
  • Feeds burnt by Feedburner
  • Feed