Skip to content

Instantly share code, notes, and snippets.

@shengoo
Created April 24, 2014 02:33
Show Gist options
  • Save shengoo/11239522 to your computer and use it in GitHub Desktop.
Save shengoo/11239522 to your computer and use it in GitHub Desktop.
package
{
import mx.controls.Button;
public class ImageButton extends Button
{
[Embed(source="assets/image/button.png")]
private var icon:Class;
[Embed(source="assets/image/buttonon.png")]
private var overIcon:Class;
[Embed(source="assets/image/buttondown.png")]
private var downIcon:Class;
public function ImageButton()
{
super();
this.label = "";
this.width = 16;
this.height = 16;
this.setStyle("cornerRadius",8);
this.setStyle("icon",icon);
this.setStyle("downIcon",downIcon);
this.setStyle("overIcon",overIcon);
this.setStyle("upIcon",icon);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment