getSetting()/setSetting()

2 views
Skip to first unread message

greetification

unread,
Apr 14, 2009, 3:21:43 PM4/14/09
to yourminis Developer Network
Hi I was wondering if someone could tell me what I'm doing wrong with
getSetting()/setSetting(). I'm posting the below to the your minis
site, inputting text, but then after refreshing the input values don't
persist. I was told to use getSetting()/setSetting() over a local
shared object, is this true?

Thanks!

There are 2 input fields and 2 buttons on the stage.

Here is the code:
========================================================
import yourminis.api.IWidget;

var widget:IWidget;

btnSet.addEventListener(MouseEvent.CLICK, setText);
btnSet.txtField.text = "SET";
btnSet.txtField.mouseEnabled = false;
btnSet.visible = false;
btnSet.buttonMode = true;


btnGet.addEventListener(MouseEvent.CLICK, getText);
btnGet.txtField.text = "GET";
btnGet.txtField.mouseEnabled = false;
btnGet.visible = false;
btnGet.buttonMode = true;



addEventListener("widget-loaded",onWidgetLoaded);

function onWidgetLoaded(evt:Event){
widget.initWidget(stage.stageWidth, stage.stageHeight, 0xFF0000);
widget.chrome.chromeAlpha = 0;
widget.chrome.shadowEnabled = false;
widget.syndication.buttonMode = 0;

btnSet.visible = true;
btnGet.visible = true;
}

function setText(e:MouseEvent):void {
widget.setSetting("input", input.text);
}

function getText(e:MouseEvent):void {
output.text = widget.getSetting("input", "Nothing Set");
}
========================================================


Gavan Woolery

unread,
Apr 14, 2009, 3:29:16 PM4/14/09
to your...@googlegroups.com
You should use a local shared object if you want the widget to maintain settings locally - for example, if you have a widget, and you want it to save a value when the page is refreshed, then use shared object.  If you want the widget to save the setting when it is copied to a new location (using our syndication panel), use get/setSetting.

greetification

unread,
Apr 14, 2009, 4:26:14 PM4/14/09
to yourminis Developer Network
Thanks!

On Apr 14, 3:29 pm, Gavan Woolery <ga...@goowymedia.com> wrote:
> You should use a local shared object if you want the widget to maintain
> settings locally - for example, if you have a widget, and you want it to
> save a value when the page is refreshed, then use shared object.  If you
> want the widget to save the setting when it is copied to a new location
> (using our syndication panel), use get/setSetting.
>
> On Tue, Apr 14, 2009 at 12:21 PM, greetification
> <greetificat...@gmail.com>wrote:
Reply all
Reply to author
Forward
0 new messages