| Package | yourminis.api |
| Class | public class Chrome |
| Inheritance | Chrome flash.display.Sprite |
| Implements | yourminis.api.IChrome |
| Property | Defined by | ||
|---|---|---|---|
| buttonPoint : Point
Used to set the location of the copy button
| 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 | Chrome | ||
| height : Number
The 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
The width of the widget
| Chrome | ||
| Method | Defined by | ||
|---|---|---|---|
| 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 show/hide the chrome background
| Chrome | ||
| buttonPoint | property |
buttonPoint:Point [read-write]Used to set the location of the copy button
Implementation public function get buttonPoint():Point
public function set buttonPoint(value:Point):void
import flash.geom.Point
import yourminis.api.IWidget
var widget:IWidget;
addEventListener("widget-loaded",onWidgetLoaded);
function onWidgetLoaded(evt:Event):void {
widget.initWidget(300,250,0x000000);
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
import yourminis.api.IWidget
var widget:IWidget;
addEventListener("widget-loaded",onWidgetLoaded);
function onWidgetLoaded(evt:Event):void {
widget.initWidget(300,250,0x000000);
widget.chrome.chromeAlpha = 0;
widget.chrome.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
import yourminis.api.IWidget
var widget:IWidget;
addEventListener("widget-loaded",onWidgetLoaded);
function onWidgetLoaded(evt:Event):void {
widget.initWidget(300,250,0x000000);
widget.chrome.chromeColor = 0xFFFFFF;
widget.chrome.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
import yourminis.api.IWidget
var widget:IWidget;
addEventListener("widget-loaded",onWidgetLoaded);
function onWidgetLoaded(evt:Event):void {
widget.initWidget(300,250,0x000000);
widget.chrome.chromeGradient = 0x000000;
widget.chrome.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
import yourminis.api.IWidget
var widget:IWidget;
addEventListener("widget-loaded",onWidgetLoaded);
function onWidgetLoaded(evt:Event):void {
widget.initWidget(300,250,0x000000);
widget.chrome.chromeTexture = new GrassBitmap(120,120);
widget.chrome.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
import yourminis.api.IWidget
var widget:IWidget;
addEventListener("widget-loaded",onWidgetLoaded);
function onWidgetLoaded(evt:Event):void {
widget.initWidget(300,250,0x000000);
widget.chrome.cornerRadius = 0;
widget.chrome.redrawChrome();
}
| 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
import yourminis.api.IWidget
var widget:IWidget;
addEventListener("widget-loaded",onWidgetLoaded);
function onWidgetLoaded(evt:Event):void {
widget.chrome.draggable = false;
widget.initWidget(300,250,0x000000);
}
| 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
import yourminis.api.IWidget
var widget:IWidget;
addEventListener("widget-loaded",onWidgetLoaded);
function onWidgetLoaded(evt:Event):void {
widget.initWidget(300,250,0x000000);
widget.chrome.editEnabled = false;
}
| enabled | property |
enabled:Boolean [read-write]Implementation
public function get enabled():Boolean
public function set enabled(value:Boolean):void
| height | property |
height:Number [read-write]The height of the widget
Implementation public function get height():Number
public function set height(value:Number):void
import yourminis.api.IWidget
var widget:IWidget;
addEventListener("widget-loaded",onWidgetLoaded);
function onWidgetLoaded(evt:Event):void {
widget.addEventListener(widget.WIDGET_RESIZED,onWidgetResized);
widget.debugMode = true;
widget.initWidget(300,250,0x000000);
}
function onWidgetResized(evt:Event):void {
widget.debug("Widget resized to: " + widget.chrome.width + " by " + widget.chrome.height);
}
| 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
import yourminis.api.IWidget
var widget:IWidget;
addEventListener("widget-loaded",onWidgetLoaded);
function onWidgetLoaded(evt:Event):void {
widget.initWidget(300,250,0x000000);
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
import yourminis.api.IWidget
var widget:IWidget;
addEventListener("widget-loaded",onWidgetLoaded);
function onWidgetLoaded(evt:Event):void {
widget.initWidget(300,250,0x000000);
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
import yourminis.api.IWidget
var widget:IWidget;
addEventListener("widget-loaded",onWidgetLoaded);
function onWidgetLoaded(evt:Event):void {
widget.initWidget(300,250,0x000000);
widget.chrome.visualsEnabled = false;
}
| width | property |
width:Number [read-write]The width of the widget
Implementation public function get width():Number
public function set width(value:Number):void
import yourminis.api.IWidget
var widget:IWidget;
addEventListener("widget-loaded",onWidgetLoaded);
function onWidgetLoaded(evt:Event):void {
widget.addEventListener(widget.WIDGET_RESIZED,onWidgetResized);
widget.debugMode = true;
widget.initWidget(300,250,0x000000);
}
function onWidgetResized(evt:Event):void {
widget.debug("Widget resized to: " + widget.chrome.width + " by " + widget.chrome.height);
}
| Chrome | () | constructor |
public function Chrome(_widget:Widget, initWidth:int, initHeight:int, initColor:uint, ... bounds)Parameters
_widget:Widget |
|
initWidth:int |
|
initHeight:int |
|
initColor:uint |
|
... bounds |
| redrawChrome | () | method |
public function redrawChrome():voidUsed to redraw the widget chrome. Useful for refreshing the chrome after you make a change.
import yourminis.api.IWidget
var widget:IWidget;
addEventListener("widget-loaded",onWidgetLoaded);
function onWidgetLoaded(evt:Event):void {
widget.initWidget(300,250,0x000000);
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. Note that if dropshadown is enabled, it increased the widget canvas size by 10 pixels in each direciton.
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
|
* |
import yourminis.api.IWidget
var widget:IWidget;
addEventListener("widget-loaded",onWidgetLoaded);
function onWidgetLoaded(evt:Event):void {
widget.initWidget(300,250,0x000000);
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) |
import yourminis.api.IWidget
var widget:IWidget;
addEventListener("widget-loaded",onWidgetLoaded);
function onWidgetLoaded(evt:Event):void {
widget.initWidget(300,250,0x000000);
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.
|
import yourminis.api.IWidget
var widget:IWidget;
addEventListener("widget-loaded",onWidgetLoaded);
function onWidgetLoaded(evt:Event):void {
widget.initWidget(300,250,0x000000);
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) |
import yourminis.api.IWidget
var widget:IWidget;
addEventListener("widget-loaded",onWidgetLoaded);
function onWidgetLoaded(evt:Event):void {
widget.initWidget(300,250,0x000000);
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.
|
import yourminis.api.IWidget
var widget:IWidget;
addEventListener("widget-loaded",onWidgetLoaded);
function onWidgetLoaded(evt:Event):void {
widget.initWidget(300,250,0x000000);
widget.chrome.setTitle("Test Widget");
}
| setView | () | method |
public function setView(isFullView:Boolean):voidUsed to show/hide the chrome background
ParametersisFullView:Boolean — If false, will hide the background of the chrome (but the interface buttons will still be usable).
|
import yourminis.api.IWidget
var widget:IWidget;
addEventListener("widget-loaded",onWidgetLoaded);
function onWidgetLoaded(evt:Event):void {
widget.initWidget(300,250,0x000000);
widget.chrome.setView(false);
}