| Package | yourminis.api |
| Class | public class Widget |
| Inheritance | Widget flash.display.Sprite |
| Implements | yourminis.api.IWidget |
import yourminis.api.IWidget
var widget:IWidget;
addEventListener("widget-loaded",onWidgetLoaded);
function onWidgetLoaded(evt:Event)
{
widget.initWidget(300,250,0x000000); //Initialize the widget at dimensions of 300x250 with theme color of black
//your widget has started and is ready for display
}
import yourminis.api.IWidget
var widget:IWidget;
var rss;
addEventListener("widget-loaded",onWidgetLoaded);
function onWidgetLoaded(evt:Event)
{
widget.initWidget(300,250,0x000000);
//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, true if the widget is running as an AIR applet
| Widget | ||
| ajax : Boolean [read-only]
ajax widget flag, true if the widget is in the ajax container
| Widget | ||
| allowFullScreen : Boolean
Allow the widget to go into full screen mode if set to true 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
The background color of the widget.
| Widget | ||
| chrome : IChrome [read-only]
Provide access to Chrome API
| Widget | ||
| compiler : Boolean [read-only]
compiler widget flag, true if the widget is in the compiler sandbox on the developer site
| Widget | ||
| content : * [read-only]
Provide read-only access to the content of the widget
| Widget | ||
| debugMode : Boolean
If set to true, the widget will output widget.debug() commands to your browser's debug console.
| Widget | ||
| DROPDOWN_LOADED : String [read-only] Event fired when the Widget dropdown is finished loading
| Widget | ||
| embedded : Boolean [read-only]
embedded widget flag, true if the widget is embedded (not in a sandbox)
| Widget | ||
| guid : String [read-only]
Provide read-only access to the guid setting
| Widget | ||
| height : Number
The height of the widget, in pixels.
| Widget | ||
| hostname : String [read-only]
Provide read-only access to the API hostname
| Widget | ||
| libraries : Object [read-only]
Provide read-only access to the dynamic libraries
| Widget | ||
| LIBRARIES_LOADED : String [read-only] Event fired when the required libraries are finished loading
| Widget | ||
| loading : Boolean
The loading indicator.
| Widget | ||
| macdashboard : Boolean [read-only]
Mac Dashboard(TM) widget flag, true if the widget is on the mac dashboard
| 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, true if the widget is in a sandbox
| Widget | ||
| settings : Object [read-only]
Provides read-only access to the settings array, which stores all of the widget settings
| 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, true if the widget is on a startpage
| 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, true if the widget is in the Flash IDE Widget Test Panel
| 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, true if the widget is on the Vista Sidebar
| 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 on
| Widget | ||
| WIDGET_LOADED : String [read-only] Event fired when the Widget is finished loading
| Widget | ||
| WIDGET_NOTFULLSCREEN : String [read-only] Event fired when fullscreen mode is toggled off
| 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
The width of the widget, in pixels.
| Widget | ||
| yahoo : Boolean [read-only]
Yahoo Widgets(TM) widget flag, true if the widget is running on the Yahoo Widgets platform
| Widget | ||
| Method | Defined by | ||
|---|---|---|---|
|
Widget(__settings:Object, _widgetLocation:String)
| Widget | ||
|
addDropDownItem(title:String, data:Function = null, callback:int = null, nodeNumber:* = -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 | ||
|
getSetting(settingName:String, defaultValue:*):*
Load 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 | ||
|
requireLibrary(libraryName:String, forDomain:String = ""):void
Add a dynamically loaded library to the widget
| Widget | ||
|
setSetting(name:*, data:Boolean, init:* = false):void
Save a widget setting
| Widget | ||
| air | property |
air:Boolean [read-only]Adobe AIR(TM) widget flag, true if the widget is running as an AIR applet
Implementation public function get air():Boolean
| ajax | property |
ajax:Boolean [read-only]ajax widget flag, true if the widget is in the ajax container
Implementation public function get ajax():Boolean
| allowFullScreen | property |
allowFullScreen:Boolean [read-write]Allow the widget to go into full screen mode if set to true 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]The background color of the widget. It is easiest to set this using a hexadecimal value.
Implementation public function get bgcolor():uint
public function set bgcolor(value:uint):void
import yourminis.api.IWidget
var widget:IWidget;
addEventListener("widget-loaded",onWidgetLoaded);
function onWidgetLoaded(evt:Event):void {
widget.debugMode = true;
widget.initWidget(300,250,0x000000);
widget.bgcolor = 0x00FF00;
}
| 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, true if the widget is in the compiler sandbox on the developer site
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]If set to true, the widget will output widget.debug() commands to your browser's debug console.
Implementation public function get debugMode():Boolean
public function set debugMode(value:Boolean):void
See also
| DROPDOWN_LOADED | property |
DROPDOWN_LOADED:String [read-only]Event fired when the Widget dropdown is finished loading
Implementation public function get DROPDOWN_LOADED():String
import yourminis.api.IWidget
var widget:IWidget;
addEventListener("widget-loaded",onWidgetLoaded);
function onWidgetLoaded(evt:Event):void {
widget.addEventListener(widget.DROPDOWN_LOADED,onDropDownLoaded);
widget.debugMode = true;
widget.initWidget(300,250,0x000000);
}
function onDropDownLoaded(evt:Event):void {
widget.addDropDownItem("item 1", "a", myfunction);
widget.addDropDownItem("item 2", "b", myfunction);
widget.addDropDownItem("item 3", "c", myfunction);
widget.addDropDownItem("submenu item 1","d",myfunction,1);
widget.addDropDownItem("submenu item 2","e",myfunction,1);
}
function myfunction(param:String) {
widget.debug(param);
}
| embedded | property |
embedded:Boolean [read-only]embedded widget flag, true if the widget is embedded (not in a sandbox)
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]The height of the widget, in pixels. Note that the actual height of the widget container will be increased by 10 pixels if the drop-shadow is enabled.
Implementation public function get height():Number
public function set height(value:Number):void
See also
| hostname | property |
hostname:String [read-only]Provide read-only access to the API hostname
Implementation public function get hostname():String
| libraries | property |
libraries:Object [read-only]Provide read-only access to the dynamic libraries
Implementation public function get libraries():Object
| LIBRARIES_LOADED | property |
LIBRARIES_LOADED:String [read-only]Event fired when the required libraries are finished loading
Implementation public function get LIBRARIES_LOADED():String
import yourminis.api.IWidget
var widget:IWidget;
addEventListener("widget-loaded",onWidgetLoaded);//We must use a string literal instead of a constant because the event constants are not yet initialized in the widget class
function onWidgetLoaded(evt:Event):void {
widget.initWidget(300,250,0x000000);
widget.requireLibrary("facebook");
widget.addEventListener(widget.LIBRARIES_LOADED, onLibrariesLoaded);
}
function onLibrariesLoaded(evt:Event):void{
widget.libraries.facebook.lib.api_key = "5efb77b97375f66bde1ba5347f1116c8";
widget.libraries.facebook.lib.secret = "5efb77b97375f66bde1ba5347f1116c8"; //fake key and secret
}
| loading | property |
loading:Boolean [read-write]The loading indicator. If set to true, a loading animation will play, and if set to false this animation will not be visible.
Implementation public function get loading():Boolean
public function set loading(value:Boolean):void
import yourminis.api.IWidget
var widget:IWidget;
var counter:uint;
addEventListener("widget-loaded",onWidgetLoaded);
function onWidgetLoaded(evt:Event):void {
counter = 0;
widget.debugMode = true;
widget.initWidget(300,250,0x000000);
widget.loading = true; //turn on the loading indicator
addEventListener(Event.ENTER_FRAME, myloop);
}
function myloop(evt:Event) {
counter++;
if (counter==30) widget.loading=false; //turn off loading indicator after 30 frames.
}
| macdashboard | property |
macdashboard:Boolean [read-only]Mac Dashboard(TM) widget flag, true if the widget is on the mac dashboard
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, true if the widget is in a sandbox
Implementation public function get sandbox():Boolean
| settings | property |
settings:Object [read-only]Provides read-only access to the settings array, which stores all of the widget settings
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
import yourminis.api.IWidget
var widget:IWidget;
addEventListener("widget-loaded",onWidgetLoaded);
function onWidgetLoaded(evt:Event):void {
widget.addEventListener(widget.SETTINGS_UPDATED,onSettingsUpdated);
widget.debugMode = true;
widget.initWidget(300,250,0x000000);
}
function onSettingsUpdated(evt:Event):void {
widget.debug("A setting has been updated");
}
| 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
import yourminis.api.IWidget
var widget:IWidget;
addEventListener("widget-loaded",onWidgetLoaded);
function onWidgetLoaded(evt:Event):void {
widget.addEventListener(widget.STAGE_MOUSEOUT,onWidgetOut);
widget.debugMode = true;
widget.initWidget(300,250,0x000000);
}
function onWidgetOut(evt:Event):void {
widget.debug("The cursor has left the widget area");
}
| 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
import yourminis.api.IWidget
var widget:IWidget;
addEventListener("widget-loaded",onWidgetLoaded);
function onWidgetLoaded(evt:Event):void {
widget.addEventListener(widget.STAGE_MOUSEOVER,onWidgetOver);
widget.debugMode = true;
widget.initWidget(300,250,0x000000);
}
function onWidgetOver(evt:Event):void {
widget.debug("The cursor has entered the widget area");
}
| startpage | property |
startpage:Boolean [read-only]startpage widget flag, true if the widget is on a startpage
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
import yourminis.api.IWidget
var widget:IWidget;
addEventListener("widget-loaded",onWidgetLoaded);
function onWidgetLoaded(evt:Event):void {
widget.addEventListener(widget.SYNDICATION_LOADED,onSyndicationLoaded);
widget.debugMode = true;
widget.initWidget(300,250,0x000000);
}
function onSyndicationLoaded(evt:Event):void {
widget.debug("Syndication Loaded");
}
| testpanel | property |
testpanel:Boolean [read-only]testpanel widget flag, true if the widget is in the Flash IDE Widget Test Panel
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, true if the widget is on the Vista Sidebar
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
import yourminis.api.IWidget
var widget:IWidget;
addEventListener("widget-loaded",onWidgetLoaded);
function onWidgetLoaded(evt:Event):void {
widget.addEventListener(widget.WIDGET_CLOSING,onWidgetClose);
widget.debugMode = true;
widget.initWidget(300,250,0x000000);
}
function onWidgetClose(evt:Event):void {
widget.debug("Widget Closed");
}
| 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
import yourminis.api.IWidget
var widget:IWidget;
addEventListener("widget-loaded",onWidgetLoaded);
function onWidgetLoaded(evt:Event):void {
widget.addEventListener(widget.WIDGET_COPIED,onWidgetCopied);
widget.debugMode = true;
widget.initWidget(300,250,0x000000);
}
function onWidgetCopied(evt:Event):void {
widget.debug("Widget Copied");
}
| WIDGET_FULLSCREEN | property |
WIDGET_FULLSCREEN:String [read-only]Event fired when fullscreen mode is toggled on
Implementation public function get WIDGET_FULLSCREEN():String
import yourminis.api.IWidget
var widget:IWidget;
addEventListener("widget-loaded",onWidgetLoaded);
function onWidgetLoaded(evt:Event):void {
widget.debugMode = true;
widget.allowFullScreen = true; //allows the widget to take up the entire screen
widget.addEventListener(widget.WIDGET_FULLSCREEN,onFullScreen);
widget.addEventListener(widget.WIDGET_NOTFULLSCREEN,onNotFullScreen);
widget.initWidget(300,250,0x000000);
var s = new Sprite();
s.graphics.beginFill(0xFF0000);
s.graphics.drawRect(10,10,100,100);
s.graphics.endFill();
addChild(s);
s.addEventListener(MouseEvent.CLICK, widget.displayFullScreen); //when the sprite s is clicked, fullscreen mode will toggle
}
function onFullScreen(evt:Event):void {
widget.debug("Widget is in fullscreen mode");
}
function onNotFullScreen(evt:Event):void {
widget.debug("Widget is not in fullscreen mode");
}
| WIDGET_LOADED | property |
WIDGET_LOADED:String [read-only]Event fired when the Widget is finished loading
Implementation public function get WIDGET_LOADED():String
import yourminis.api.IWidget
var widget:IWidget;
addEventListener("widget-loaded",onWidgetLoaded);//We must use a string literal instead of a constant because the event constants are not yet initialized in the widget class
function onWidgetLoaded(evt:Event):void {
widget.initWidget(300,250,0x000000);
widget.debugMode = true;
widget.debug("Widget Loaded");
}
| WIDGET_NOTFULLSCREEN | property |
WIDGET_NOTFULLSCREEN:String [read-only]Event fired when fullscreen mode is toggled off
Implementation public function get WIDGET_NOTFULLSCREEN():String
See also
| WIDGET_RESIZED | property |
WIDGET_RESIZED:String [read-only]Event fired when the Widget has been resized
Implementation public function get WIDGET_RESIZED():String
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.width + " by " + widget.height);
}
| WIDGET_THEMED | property |
WIDGET_THEMED:String [read-only]Event fired when the Widget theme has changed
Implementation public function get WIDGET_THEMED():String
import yourminis.api.IWidget
var widget:IWidget;
addEventListener("widget-loaded",onWidgetLoaded);
function onWidgetLoaded(evt:Event):void {
widget.addEventListener(widget.WIDGET_THEMED,onWidgetThemed);
widget.debugMode = true;
widget.initWidget(300,250,0x000000);
}
function onWidgetThemed(evt:Event):void {
widget.debug("Widget Theme Color is: " + widget.widgetColor);
}
| width | property |
width:Number [read-write]The width of the widget, in pixels. Note that the actual width of the widget container will be increased by 10 pixels if the drop-shadow is enabled.
Implementation public function get width():Number
public function set width(value:Number):void
See also
| yahoo | property |
yahoo:Boolean [read-only]Yahoo Widgets(TM) widget flag, true if the widget is running on the Yahoo Widgets platform
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:Function = null, callback:int = null, nodeNumber:* = -1):voidUsed to add items to the dropdown menu.
Parameterstitle:String — The title of the menu item.
|
|
data:Function (default = null) — data object to pass to the callback function.
|
|
callback:int (default = null) — A callback function to call when the item is clicked.
|
|
nodeNumber:* (default = -1) — If a secondary level menu is desired, specify the node of the primary menu to place this item under.
|
See also
| 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. The default is 0x000000.
|
|
css:StyleSheet (default = null) — The StyleSheet of the tooltip's text. The default is null, which is internally re-evaluated as: css.setStyle("tooltip",{fontFamily:'Verdana', fontSize:'9px', color:'#000000', fontWeight:'normal', display:'inline'}).
|
|
delay:int (default = 1000) — The delay in miliseconds before the tooltip appears on hover over. Default is 1000 (one second).
|
* |
import yourminis.api.IWidget
var widget:IWidget;
addEventListener("widget-loaded",onWidgetLoaded);
function onWidgetLoaded(evt:Event) {
widget.initWidget(300,250,0x000000);
var tt:StyleSheet = new StyleSheet();
tt.setStyle("myStyleSheetName",{fontFamily:'Verdana', fontSize:'9px', color:'#FF0000', fontWeight:'normal', display:'inline'});
widget.addTooltip(my_btn,"This is a test ",0x0000FF,0x00FF00,tt);
}
| 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) |
* |
import yourminis.api.IWidget
var widget:IWidget;
addEventListener("widget-loaded",onWidgetLoaded);
function onWidgetLoaded(evt:Event) {
widget.initWidget(300,250,0x000000);
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
import yourminis.api.IWidget
var widget:IWidget;
addEventListener("widget-loaded",onWidgetLoaded);
function onWidgetLoaded(evt:Event):void {
widget.initWidget(300,250,0x000000);
widget.debugMode = true;
widget.debug("Hello World!"); //Prints out to your browser's debug console (i.e. Firebug in Firefox)
}
| displayFullScreen | () | method |
public function displayFullScreen(evt:MouseEvent):*Call this method to set the widget to fullscreen mode
Parametersevt:MouseEvent |
* |
See also
| getSetting | () | method |
public function getSetting(settingName:String, defaultValue:*):*Load a widget setting
ParameterssettingName:String — The name of the setting to retrieve
|
|
defaultValue:* — The default value if the setting does not exist
|
* |
See also
import yourminis.api.IWidget
var widget:IWidget;
addEventListener("widget-loaded",onWidgetLoaded);
function onWidgetLoaded(evt:Event)
{
widget.initWidget(300,250,0x000000);
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
import yourminis.api.IWidget
var widget:IWidget;
addEventListener("widget-loaded",onWidgetLoaded);//We must use a string literal instead of a constant because the event constants are not yet initialized in the widget class
function onWidgetLoaded(evt:Event):void {
widget.initWidget(300,250,0x000000); //Initialize the widget with dimensions 300x250 and theme color of black
}
| 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
import yourminis.api.IWidget
var widget:IWidget;
addEventListener("widget-loaded",onWidgetLoaded);
function onWidgetLoaded(evt:Event) {
widget.initWidget(300,250,0x000000);
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
|
import yourminis.api.IWidget
var widget:IWidget;
addEventListener("widget-loaded",onWidgetLoaded);
function onWidgetLoaded(evt:Event) {
widget.initWidget(300,250,0x000000);
var http = widget.newHTTP();
http.addEventListener(Event.COMPLETE,onHttpLoaded);
http.load(new URLRequest("http://feeds.feedburner.com/yourminis"));
}
function onHttpLoaded(evt:Event) {
var loader:URLLoader = URLLoader(evt.target);
trace(loader.data.toString());
//your code here to handle the loaded data
}
| newRSS | () | method |
public function newRSS():URLLoaderRSS Class Factory method
ReturnsURLLoader — RSS Object for RSS related widget requests
|
See also
var rss;
import yourminis.api.IWidget
var widget:IWidget;
addEventListener("widget-loaded",onWidgetLoaded);
function onWidgetLoaded(evt:Event) {
widget.initWidget(300,250,0x000000);
widget.debugMode = true;
rss = widget.newRSS();
rss.addEventListener(Event.COMPLETE,onRSSLoaded);
var myurl = "http://feeds.feedburner.com/yourminis";
rss.load(new URLRequest(myurl));
//if you wanted to load a feed that required authorization, you would do the following:
//rss.loadRSS("myURL","myUserName","myPassword") where
//"myURL" is a string containing the URL you wish to load
//"myUserName" is a string containing the username to log in with
//"myPassword" is a string containing the password to log in with
}
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/>";
}
widget.debug(str);
}
| requireLibrary | () | method |
public function requireLibrary(libraryName:String, forDomain:String = ""):voidAdd a dynamically loaded library to the widget
ParameterslibraryName:String — The name of the libarary to load ("facebook", "opensocial", etc.)
|
|
forDomain:String (default = "") — The domains for which the widget should load the library. " will always load the library, and if the parameter is omitted, it will default to loading only on the domain associated with the library name (i.e. "facebook.com" for "facebook")
|
See also
import yourminis.api.IWidget
var widget:IWidget;
addEventListener("widget-loaded",onWidgetLoaded);
function onWidgetLoaded(evt:Event)
{
widget.initWidget(300,250,0x000000);
widget.addEventListener(widget.LIBRARIES_LOADED, onLibrariesLoaded);
widget.requireLibrary("facebook",");
}
function onLibrariesLoaded(evt:Event):void{
//widget.libraries.facebook.lib is ready to use
}
| setSetting | () | method |
public function setSetting(name:*, data:Boolean, init:* = false):voidSave a widget setting
Parametersname:* — The name of the setting to retrieve
|
|
data:Boolean — The value of the setting
|
|
init:* (default = false) |
See also
import yourminis.api.IWidget
var widget:IWidget;
addEventListener("widget-loaded",onWidgetLoaded);
function onWidgetLoaded(evt:Event)
{
widget.initWidget(300,250,0x000000);
var playerid = widget.getSetting("playerid",null);
if (playerid==null)
{
setSetting("playerid","0");
playerid=0;
}
}