| Package | yourminis.api |
| Class | public class Chrome |
| Inheritance | Chrome flash.display.Sprite |
| Implements | yourminis.api.IChrome |
See also
| Property | Defined by | ||
|---|---|---|---|
| buttonPoint : Point
Used to set the visibility of the dropdown button in the widget chrome
| Chrome | ||
| chromeAlpha : Number
Used to set the alpha of the widget chrome.
| Chrome | ||
| chromeColor : uint
Used to set the primary color of the widget chrome.
| Chrome | ||
| chromeGradient : int
Used to create a downward gradient in the widget, the primary color being the chromeColor.
| Chrome | ||
| chromeTexture : BitmapData
Used to set the widget chrome to a textured bitmap.
| Chrome | ||
| cornerRadius : int
Used to set the roundness of the widgets corners (default is 10, square corners is 0).
| Chrome | ||
| draggable : Boolean
Boolean used to allow the widget to be dragged in free floating environments (such as the gallery sandbox).
| Chrome | ||
| editEnabled : Boolean
Used to set the visibility of the dropdown button in the widget chrome
| Chrome | ||
| enabled : Boolean
Used to enable/disable the chrome of a widget.
| Chrome | ||
| height : Number
height of the widget
| Chrome | ||
| resizable : Boolean
Boolean to determine whether or not the widget is resizable (by the user or widget environment--the widget will always be able to be programatically resized).
| Chrome | ||
| shadowEnabled : Boolean
Used to set the visibility of the chrome shadow.
| Chrome | ||
| visualsEnabled : Boolean
Used to set the visibility of the color picker button in the widget chrome
| Chrome | ||
| width : Number
width of the widget
| Chrome | ||
| Method | Defined by | ||
|---|---|---|---|
| Chrome | |||
|
addDropDownItem(title:String, data:* = null, callback:Function = null, nodeNumber:int = -1):void
Used to add items to the dropdown menu.
| Chrome | ||
|
redrawChrome():void
Used to redraw the widget chrome.
| Chrome | ||
|
setBounds(minWidth:int, minHeight:int, maxWidth:int, maxHeight:int):*
Used to set the resizable boundaries of the widget.
| Chrome | ||
|
setSize(newWidth:Number, newHeight:Number, init:Boolean = false):void
Used to set the dimensions of the chrome in pixels.
| Chrome | ||
|
setSkin(skin:String):void
Used to set the skin picture of the chrome.
| Chrome | ||
|
setTheme(_color:uint, init:Boolean = false):void
Used to set the theme color of the chrome.
| Chrome | ||
|
setTitle(txt:String, xoffset:int = 0, yoffset:int = 0):void
Used to set the text of the title bar in the chrome.
| Chrome | ||
|
setView(isFullView:Boolean):void
Used to set the text of the title bar in the chrome.
| Chrome | ||
| buttonPoint | property |
buttonPoint:Point [read-write]Used to set the visibility of the dropdown button in the widget chrome
Implementation public function get buttonPoint():Point
public function set buttonPoint(value:Point):void
See also
import flash.geom.Point widget.chrome.buttonPoint = new Point(5,10);
| chromeAlpha | property |
chromeAlpha:Number [read-write]Used to set the alpha of the widget chrome. The chrome must be redrawn or resized after setting to have an effect.
Implementation public function get chromeAlpha():Number
public function set chromeAlpha(value:Number):void
See also
widget.chrome.chromeAlpha = 0; redrawChrome();
| chromeColor | property |
chromeColor:uint [read-write]Used to set the primary color of the widget chrome. The chrome must be redrawn or resized after setting to have an effect.
Implementation public function get chromeColor():uint
public function set chromeColor(value:uint):void
See also
widget.chrome.chromeColor = 0xFFFFFF; redrawChrome();
| chromeGradient | property |
chromeGradient:int [read-write]Used to create a downward gradient in the widget, the primary color being the chromeColor. The chrome must be redrawn or resized after setting to have an effect.
Implementation public function get chromeGradient():int
public function set chromeGradient(value:int):void
See also
widget.chrome.chromeGradient = 0x000000; redrawChrome();
| chromeTexture | property |
chromeTexture:BitmapData [read-write]Used to set the widget chrome to a textured bitmap. The chrome must be resized or redrawn after setting to have an effect.
Implementation public function get chromeTexture():BitmapData
public function set chromeTexture(value:BitmapData):void
See also
widget.chrome.chromeTexture = new GrassBitmap(120,120); redrawChrome();
| cornerRadius | property |
cornerRadius:int [read-write]Used to set the roundness of the widgets corners (default is 10, square corners is 0).
Implementation public function get cornerRadius():int
public function set cornerRadius(value:int):void
See also
widget.chrome.cornerRadius = 0;
| draggable | property |
draggable:Boolean [read-write]Boolean used to allow the widget to be dragged in free floating environments (such as the gallery sandbox).
Implementation public function get draggable():Boolean
public function set draggable(value:Boolean):void
See also
widget.chrome.draggable = false;
| editEnabled | property |
editEnabled:Boolean [read-write]Used to set the visibility of the dropdown button in the widget chrome
Implementation public function get editEnabled():Boolean
public function set editEnabled(value:Boolean):void
See also
widget.chrome.editEnabled = false;
| enabled | property |
enabled:Boolean [read-write]Used to enable/disable the chrome of a widget. Disabled by default for non-API widgets.
Implementation public function get enabled():Boolean
public function set enabled(value:Boolean):void
See also
widget.chrome.enabled = false;
| height | property |
height:Number [read-write]height of the widget
Implementation public function get height():Number
public function set height(value:Number):void
| resizable | property |
resizable:Boolean [read-write]Boolean to determine whether or not the widget is resizable (by the user or widget environment--the widget will always be able to be programatically resized).
Implementation public function get resizable():Boolean
public function set resizable(value:Boolean):void
See also
widget.chrome.resizable = false;
| shadowEnabled | property |
shadowEnabled:Boolean [read-write]Used to set the visibility of the chrome shadow. Note that when the chrome shadow is enabled 10 pixels from the with and 10 pixels from the height of the widget are used to give space for the shadow.
Implementation public function get shadowEnabled():Boolean
public function set shadowEnabled(value:Boolean):void
See also
widget.chrome.shadowEnabled = false;
| visualsEnabled | property |
visualsEnabled:Boolean [read-write]Used to set the visibility of the color picker button in the widget chrome
Implementation public function get visualsEnabled():Boolean
public function set visualsEnabled(value:Boolean):void
See also
widget.chrome.visualsEnabled = false;
| width | property |
width:Number [read-write]width of the widget
Implementation public function get width():Number
public function set width(value:Number):void
| Chrome | () | constructor |
public function Chrome(_widget:Widget, initWidth:int, initHeight:int, initColor:uint, ... bounds)Parameters
_widget:Widget |
|
initWidth:int |
|
initHeight:int |
|
initColor:uint |
|
... bounds |
| addDropDownItem | () | method |
public function addDropDownItem(title:String, data:* = null, callback:Function = null, nodeNumber:int = -1):voidUsed to add items to the dropdown menu.
Parameterstitle:String — The title of the menu item.
|
|
data:* (default = null) — data object to pass to the callback function.
|
|
callback:Function (default = null) — A callback function to call when the item is clicked.
|
|
nodeNumber:int (default = -1) — If a secondary level menu is desired, specify the node of the primary menu to place this item under.
|
See also
widget.addEventListener(widget.DROPDOWN_LOADED,onDropdownLoaded);
function onDropdownLoaded(evt:Event)
{
widget.addItem("Set color: black",0x000000, widget.setTheme);
widget.addItem("Set color: red" ,0xFF0000, widget.setTheme);
widget.addItem("Set color: green",0x00FF00, widget.setTheme);
widget.addItem("Set color: blue" ,0x0000FF, widget.setTheme);
}
| redrawChrome | () | method |
public function redrawChrome():voidUsed to redraw the widget chrome.
See also
widget.chrome.setTheme(0x000000); widget.chrome.chromeGradient = 0xFFFFFF; widget.chrome.redrawChrome();
| setBounds | () | method |
public function setBounds(minWidth:int, minHeight:int, maxWidth:int, maxHeight:int):*Used to set the resizable boundaries of the widget.
ParametersminWidth:int — the minimum width of the widget
|
|
minHeight:int — the minimum height of the widget
|
|
maxWidth:int — the maximum width of the widget
|
|
maxHeight:int — the maximum height of the widget
|
* |
See also
widget.chrome.setBounds(200,160,800,600);
| setSize | () | method |
public function setSize(newWidth:Number, newHeight:Number, init:Boolean = false):voidUsed to set the dimensions of the chrome in pixels.
ParametersnewWidth:Number — The desired width of the chrome.
|
|
newHeight:Number — The desired height of the chrome.
|
|
init:Boolean (default = false) |
See also
widget.chrome.setSize(240,200);
| setSkin | () | method |
public function setSkin(skin:String):voidUsed to set the skin picture of the chrome.
Parametersskin:String — The url of the picture to load.
|
See also
widget.chrome.setSkin("http://www.example.com/my_picture.jpg");
| setTheme | () | method |
public function setTheme(_color:uint, init:Boolean = false):voidUsed to set the theme color of the chrome.
Parameters_color:uint — The desired color of the theme.
|
|
init:Boolean (default = false) |
See also
widget.chrome.setTheme(0x000000);
| setTitle | () | method |
public function setTitle(txt:String, xoffset:int = 0, yoffset:int = 0):voidUsed to set the text of the title bar in the chrome.
Parameterstxt:String — The desired title text.
|
|
xoffset:int (default = 0) — The number of pixels to offset the title location by horizontally. Defaults to 0.
|
|
yoffset:int (default = 0) — The number of pixels to offset the title location by vertically. Defaults to 0.
|
See also
widget.chrome.setTitle("Test Widget");
| setView | () | method |
public function setView(isFullView:Boolean):voidUsed to set the text of the title bar in the chrome.
ParametersisFullView:Boolean — If false, will hide the background of the chrome (but the interface buttons will still be usable).
|
See also
widget.chrome.setView(true);