| Package | yourminis.api |
| Class | public class Widget |
| Inheritance | Widget flash.display.Sprite |
| Implements | yourminis.api.IWidget |
var widget; //Widget
addEventListener("widget-loaded",onWidgetLoaded);
function onWidgetLoaded(evt:Event)
{
//your widget has started and is ready for display
}
var widget; //Widget
var rss;
addEventListener("widget-loaded",onWidgetLoaded);
function onWidgetLoaded(evt:Event)
{
//your widget has started and is ready for display
rss = widget.newRSS();
rss.addEventListener(Event.COMPLETE,onRSSLoaded);
rss.load(new URLRequest("http://feeds.feedburner.com/yourminis"));
}
function onRSSLoaded(evt:Event)
{
var loader:URLLoader = URLLoader(evt.target);
namespace dc="http://purl.org/dc/elements/1.1/";
namespace content="http://purl.org/rss/1.0/modules/content/";
namespace geo="http://www.w3.org/2003/01/geo/wgs84_pos#";
var rssxml:XML = XML(loader.data);
var str = "";
for each (var item:XML in rssxml..item)
{
str+="<b><a href='" + item.link + "' target='_blank'><u>" + item.title + "</u></a></b>";
str+="<br/>" + item.description + "<br/><br/>";
}
output_txt.htmlText = str;
}
See also
| Property | Defined by | ||
|---|---|---|---|
| air : Boolean [read-only]
Adobe AIR(TM) widget flag
| Widget | ||
| ajax : Boolean [read-only]
ajax widget flag
| Widget | ||
| allowFullScreen : Boolean
Call this method to allow the widget to go into full screen mode when copied (wont work on MySpace)
| Widget | ||
| api : IApiBase [read-only]
Provides REST API access to the yourminis widget server
| Widget | ||
| APIWidget : Boolean [read-only]
API widget flag
| Widget | ||
| bgcolor : uint
background color of the widget
| Widget | ||
| chrome : IChrome [read-only]
Provide access to Chrome API
| Widget | ||
| compiler : Boolean [read-only]
compiler widget flag
| Widget | ||
| content : * [read-only]
Provide read-only access to the content of the widget
| Widget | ||
| debugMode : Boolean
private
| Widget | ||
| DROPDOWN_LOADED : String [read-only] Event fired when the Widget dropdown is finished loading
| Widget | ||
| embedded : Boolean [read-only]
embedded widget flag
| Widget | ||
| guid : String [read-only]
Provide read-only access to the guid setting
| Widget | ||
| height : Number
height of the widget
| Widget | ||
| hostname : String [read-only]
Provide read-only access to the API hostname
| Widget | ||
| loading : Boolean
loading indicator
| Widget | ||
| macdashboard : Boolean [read-only]
Mac Dashboard(TM) widget flag
| Widget | ||
| reporting : IReporting [read-only]
Provide access to the Reporting API
| Widget | ||
| reportingEnabled : Boolean [read-only]
reportingEnabled flag
| Widget | ||
| sandbox : Boolean [read-only]
sandbox widget flag
| Widget | ||
| settings : Object [read-only]
Provides read-only access to the settings array;
| Widget | ||
| SETTINGS_UPDATED : String [read-only] Event fired when the widget updates a setting
| Widget | ||
| social : ISocial
[read-only]
Provide access to the Social API
| Widget | ||
| STAGE_MOUSEOUT : String [read-only] Event fired when the mouse leaves the widget display area
| Widget | ||
| STAGE_MOUSEOVER : String [read-only] Event fired when the mouse enters the widget display area
| Widget | ||
| startpage : Boolean [read-only]
startpage widget flag
| Widget | ||
| statshostname : String [read-only]
Provide read-only access to the API statshostname
| Widget | ||
| swfhost : String [read-only]
Provide read-only access to the Widget hostname
| Widget | ||
| syndication : ISyndication [read-only]
Provide access to the Syndication API
| Widget | ||
| SYNDICATION_LOADED : String [read-only] Event fired when the widget syndication has loaded
| Widget | ||
| testpanel : Boolean [read-only]
testpanel widget flag
| Widget | ||
| title : String [read-only]
Provide read-only access to the title setting
| Widget | ||
| tooltip : Object [read-only]
Provide access to the tooltip
| Widget | ||
| uri : String [read-only]
Provide read-only access to the uri setting
| Widget | ||
| vista : Boolean [read-only]
Windows Vista(TM) widget flag
| Widget | ||
| WIDGET_CLOSING : String [read-only] Event fired when the widget is about to close (to allow opportunity to close streams);
| Widget | ||
| WIDGET_COPIED : String [read-only] Event fired when the Widget has successfully copied to another location
| Widget | ||
| WIDGET_FULLSCREEN : String [read-only] Event fired when fullscreen mode is toggled
| Widget | ||
| WIDGET_LOADED : String [read-only] Event fired when the Widget is finished loading
| Widget | ||
| WIDGET_RESIZED : String [read-only] Event fired when the Widget has been resized
| Widget | ||
| WIDGET_THEMED : String [read-only] Event fired when the Widget theme has changed
| Widget | ||
| width : Number
width of the widget
| Widget | ||
| yahoo : Boolean [read-only]
Yahoo Widgets(TM) widget flag
| Widget | ||
| Method | Defined by | ||
|---|---|---|---|
|
Widget(__settings:Object, _widgetLocation:String)
| Widget | ||
|
addDropDownItem(title:String, data:* = null, callback:Function = null, nodeNumber:int = -1):void
Used to add items to the dropdown menu.
| Widget | ||
|
addTooltip(mc:InteractiveObject, tooltip:String, backgroundColor:Number = -1, borderColor:Number = -1, css:StyleSheet = null, delay:int = 1000):*
Used to add hover-over tooltips to movieclips, sprites, text, and buttons
| Widget | ||
|
alert(message:String, callback:Function = null, cancelcallback:Function = null):*
Used much like a javascript alert to display messages to the user
| Widget | ||
|
debug(msg:String):void
Call this method to trace a message (for debugging purposes).
| Widget | ||
|
displayFullScreen(evt:MouseEvent):*
Call this method to set the widget to fullscreen mode
| Widget | ||
|
getProxyURL(url:String):String
| Widget | ||
|
getSetting(settingName:String, defaultValue:*):*
Get a widget setting
| Widget | ||
|
initWidget(_w:Number = 300, _h:Number = 250, _c:uint = 0x000000):void
Call this method after the widget is loaded to initialize its dimensions and color (only if you are using the widget.chrome)
| Widget | ||
|
navigateToURL(urlreq:URLRequest, target:String = "_blank", track:Boolean = true):void
Used to navigate the user to the URL in the browser and track.
| Widget | ||
|
newHTTP():URLLoader
HTTP Class Factory method
| Widget | ||
|
newRSS():URLLoader
RSS Class Factory method
| Widget | ||
|
setSetting(name:*, data:*, init:Boolean = false):void
Set a widget setting
| Widget | ||
| air | property |
air:Boolean [read-only]Adobe AIR(TM) widget flag
Implementation public function get air():Boolean
| ajax | property |
ajax:Boolean [read-only]ajax widget flag
Implementation public function get ajax():Boolean
| allowFullScreen | property |
allowFullScreen:Boolean [read-write]Call this method to allow the widget to go into full screen mode when copied (wont work on MySpace)
Implementation public function get allowFullScreen():Boolean
public function set allowFullScreen(value:Boolean):void
See also
| api | property |
api:IApiBase [read-only]Provides REST API access to the yourminis widget server
Implementation public function get api():IApiBase
| APIWidget | property |
APIWidget:Boolean [read-only]API widget flag
Implementation public function get APIWidget():Boolean
| bgcolor | property |
bgcolor:uint [read-write]background color of the widget
Implementation public function get bgcolor():uint
public function set bgcolor(value:uint):void
| chrome | property |
chrome:IChrome [read-only]Provide access to Chrome API
Implementation public function get chrome():IChrome
| compiler | property |
compiler:Boolean [read-only]compiler widget flag
Implementation public function get compiler():Boolean
| content | property |
content:* [read-only]Provide read-only access to the content of the widget
Implementation public function get content():*
| debugMode | property |
debugMode:Boolean [read-write]private
Implementation public function get debugMode():Boolean
public function set debugMode(value:Boolean):void
| DROPDOWN_LOADED | property |
DROPDOWN_LOADED:String [read-only]Event fired when the Widget dropdown is finished loading
Implementation public function get DROPDOWN_LOADED():String
| embedded | property |
embedded:Boolean [read-only]embedded widget flag
Implementation public function get embedded():Boolean
| guid | property |
guid:String [read-only]Provide read-only access to the guid setting
Implementation public function get guid():String
| height | property |
height:Number [read-write]height of the widget
Implementation public function get height():Number
public function set height(value:Number):void
| hostname | property |
hostname:String [read-only]Provide read-only access to the API hostname
Implementation public function get hostname():String
| loading | property |
loading:Boolean [read-write]loading indicator
Implementation public function get loading():Boolean
public function set loading(value:Boolean):void
| macdashboard | property |
macdashboard:Boolean [read-only]Mac Dashboard(TM) widget flag
Implementation public function get macdashboard():Boolean
| reporting | property |
reporting:IReporting [read-only]Provide access to the Reporting API
Implementation public function get reporting():IReporting
| reportingEnabled | property |
reportingEnabled:Boolean [read-only]reportingEnabled flag
Implementation public function get reportingEnabled():Boolean
| sandbox | property |
sandbox:Boolean [read-only]sandbox widget flag
Implementation public function get sandbox():Boolean
| settings | property |
settings:Object [read-only]Provides read-only access to the settings array;
Implementation public function get settings():Object
| SETTINGS_UPDATED | property |
SETTINGS_UPDATED:String [read-only]Event fired when the widget updates a setting
Implementation public function get SETTINGS_UPDATED():String
| social | property |
social:ISocial [read-only]Provide access to the Social API
Implementation public function get social():ISocial
| STAGE_MOUSEOUT | property |
STAGE_MOUSEOUT:String [read-only]Event fired when the mouse leaves the widget display area
Implementation public function get STAGE_MOUSEOUT():String
| STAGE_MOUSEOVER | property |
STAGE_MOUSEOVER:String [read-only]Event fired when the mouse enters the widget display area
Implementation public function get STAGE_MOUSEOVER():String
| startpage | property |
startpage:Boolean [read-only]startpage widget flag
Implementation public function get startpage():Boolean
| statshostname | property |
statshostname:String [read-only]Provide read-only access to the API statshostname
Implementation public function get statshostname():String
| swfhost | property |
swfhost:String [read-only]Provide read-only access to the Widget hostname
Implementation public function get swfhost():String
| syndication | property |
syndication:ISyndication [read-only]Provide access to the Syndication API
Implementation public function get syndication():ISyndication
| SYNDICATION_LOADED | property |
SYNDICATION_LOADED:String [read-only]Event fired when the widget syndication has loaded
Implementation public function get SYNDICATION_LOADED():String
| testpanel | property |
testpanel:Boolean [read-only]testpanel widget flag
Implementation public function get testpanel():Boolean
| title | property |
title:String [read-only]Provide read-only access to the title setting
Implementation public function get title():String
| tooltip | property |
tooltip:Object [read-only]Provide access to the tooltip
Implementation public function get tooltip():Object
| uri | property |
uri:String [read-only]Provide read-only access to the uri setting
Implementation public function get uri():String
| vista | property |
vista:Boolean [read-only]Windows Vista(TM) widget flag
Implementation public function get vista():Boolean
| WIDGET_CLOSING | property |
WIDGET_CLOSING:String [read-only]Event fired when the widget is about to close (to allow opportunity to close streams);
Implementation public function get WIDGET_CLOSING():String
| WIDGET_COPIED | property |
WIDGET_COPIED:String [read-only]Event fired when the Widget has successfully copied to another location
Implementation public function get WIDGET_COPIED():String
| WIDGET_FULLSCREEN | property |
WIDGET_FULLSCREEN:String [read-only]Event fired when fullscreen mode is toggled
Implementation public function get WIDGET_FULLSCREEN():String
| WIDGET_LOADED | property |
WIDGET_LOADED:String [read-only]Event fired when the Widget is finished loading
Implementation public function get WIDGET_LOADED():String
| WIDGET_RESIZED | property |
WIDGET_RESIZED:String [read-only]Event fired when the Widget has been resized
Implementation public function get WIDGET_RESIZED():String
| WIDGET_THEMED | property |
WIDGET_THEMED:String [read-only]Event fired when the Widget theme has changed
Implementation public function get WIDGET_THEMED():String
| width | property |
width:Number [read-write]width of the widget
Implementation public function get width():Number
public function set width(value:Number):void
| yahoo | property |
yahoo:Boolean [read-only]Yahoo Widgets(TM) widget flag
Implementation public function get yahoo():Boolean
| Widget | () | constructor |
public function Widget(__settings:Object, _widgetLocation:String)Parameters
__settings:Object |
|
_widgetLocation:String |
| 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.addDropDownItem("Set color: black",0x000000, widget.setTheme);
widget.addDropDownItem("Set color: red" ,0xFF0000, widget.setTheme);
widget.addDropDownItem("Set color: green",0x00FF00, widget.setTheme);
widget.addDropDownItem("Set color: blue" ,0x0000FF, widget.setTheme);
}
| addTooltip | () | method |
public function addTooltip(mc:InteractiveObject, tooltip:String, backgroundColor:Number = -1, borderColor:Number = -1, css:StyleSheet = null, delay:int = 1000):*Used to add hover-over tooltips to movieclips, sprites, text, and buttons
Parametersmc:InteractiveObject — The InteractiveObject to add a tooltip to.
|
|
tooltip:String — The string you wish to display in the tooltip.
|
|
backgroundColor:Number (default = -1) — The background color of the tooltip. Default is 0xFFFFCC;
|
|
borderColor:Number (default = -1) — The border color of the tooltip. Default is 0x000000.
|
|
css:StyleSheet (default = null) — The StyleSheet of the tooltip's text. Default is 0x000000.
|
|
delay:int (default = 1000) — The delay in miliseconds before the tooltip appears on hover over. Default is 1000 (one second).
|
* |
See also
widget.addTooltip(my_button,"Click me!");
| alert | () | method |
public function alert(message:String, callback:Function = null, cancelcallback:Function = null):*Used much like a javascript alert to display messages to the user
Parametersmessage:String — The text to display in the alert
|
|
callback:Function (default = null) — Optional. The callback function for when the alert is closed.
|
|
cancelcallback:Function (default = null) |
* |
See also
widget.alert("This is a test!");
| debug | () | method |
public function debug(msg:String):voidCall this method to trace a message (for debugging purposes). Note: widget.debugMode must be set to true to get debug statements outside of the Widget Test Panel
Parametersmsg:String — the desired message to log
|
See also
widget.debug("Hello World!");
| displayFullScreen | () | method |
public function displayFullScreen(evt:MouseEvent):*Call this method to set the widget to fullscreen mode
Parametersevt:MouseEvent |
* |
See also
| getProxyURL | () | method |
public function getProxyURL(url:String):StringParameters
url:String |
String |
| getSetting | () | method |
public function getSetting(settingName:String, defaultValue:*):*Get a widget setting
ParameterssettingName:String — The name of the setting to retrieve
|
|
defaultValue:* — The default value if the setting does not exist
|
* |
See also
var widget; //Widget
addEventListener("widget-loaded",onWidgetLoaded);
function onWidgetLoaded(evt:Event)
{
//your widget has started and is ready for display
var playerid = widget.getSetting("playerid",null);
//do something with player id
}
| initWidget | () | method |
public function initWidget(_w:Number = 300, _h:Number = 250, _c:uint = 0x000000):voidCall this method after the widget is loaded to initialize its dimensions and color (only if you are using the widget.chrome)
Parameters_w:Number (default = 300) — The desired width
|
|
_h:Number (default = 250) — The desired height
|
|
_c:uint (default = 0x000000) — The desired color
|
See also
| navigateToURL | () | method |
public function navigateToURL(urlreq:URLRequest, target:String = "_blank", track:Boolean = true):voidUsed to navigate the user to the URL in the browser and track. (required for external URL support in myspace.com)
Parametersurlreq:URLRequest — The URL to navigate to and optionally track
|
|
target:String (default = "_blank") — An optional parameter to specify the target window name
|
|
track:Boolean (default = true) — An optional parameter to enable/disable tracking
|
See also
var widget = ...
widget.navigateToURL(new URLRequest("http://www.yourminis.com/developers/"));
| newHTTP | () | method |
public function newHTTP():URLLoaderHTTP Class Factory method
ReturnsURLLoader — HTTP Object for http related widget requests
|
| newRSS | () | method |
public function newRSS():URLLoaderRSS Class Factory method
ReturnsURLLoader — RSS Object for RSS related widget requests
|
| setSetting | () | method |
public function setSetting(name:*, data:*, init:Boolean = false):voidSet a widget setting
Parametersname:* — The name of the setting to retrieve
|
|
data:* — The value of the setting
|
|
init:Boolean (default = false) |
See also
var widget; //Widget
addEventListener("widget-loaded",onWidgetLoaded);
function onWidgetLoaded(evt:Event)
{
//your widget has started and is ready for display
var playerid = widget.getSetting("playerid",null);
if (playerid==null)
{
setSetting("playerid","0");
playerid=0;
}
}