BasicButton

Kind of class: public class
Package:
Inherits from:
  • Sprite
Author: John Polacek, john@johnpolacek.com
Classpath: com.johnpolacek.ui.BasicButton
File last modified: Wednesday, 16 February 2011, 18:35:25
The BasicButton class is used to create basic buttons that contain a buttonValue property that can be used to store a string value. For example, use BasicButton objects for creating a menu and on click events use the buttonValue property to load new sections. Or assign a filename to the buttonValue property to initiate lightbox content. By default, BasicButtons have MOUSE_OUT and MOUSE_OVER events which toggle the transparency between .8(out) and 1(over) which is deactivated if the select(true); method is called.
Example
  • import com.johnpolacek.ui.BasicButton;
    import com.johnpolacek.shapes.RectangleShape;
    var exampleButton:BasicButton = new BasicButton("A string stored by the button");
    var buttonShape:Sprite = new RectangleShape(50);
    exampleButton.addChild(buttonShape);
    

Summary

Constructor
  • BasicButton (val:String = "", enableSimpleRollovers:Boolean = true, ba:Number = .9, ra:Number = 1, rc:String = null, sc:String = null)
Instance properties
Instance methods
  • addSimpleRollovers (ba:Number = .9, ra:Number = 1, rc:String = null, sc:String = null) : void
  • select (sel:Boolean = true) : void

Constructor

BasicButton

function BasicButton(val:String = "", enableSimpleRollovers:Boolean = true, ba:Number = .9, ra:Number = 1, rc:String = null, sc:String = null)

Instance properties

baseAlpha

baseAlpha:Number = .9(read,write)

buttonValue

buttonValue:String(read,write)

rolloverAlpha

rolloverAlpha:Number = 1(read,write)

rolloverColor

rolloverColor:String(read,write)

selectColor

selectColor:String(read,write)

Instance methods

addSimpleRollovers

function addSimpleRollovers(ba:Number = .9, ra:Number = 1, rc:String = null, sc:String = null) : void

select

function select(sel:Boolean = true) : void