Widget.onMemoryUpdate

Availability

Flash Player 7 + TheSpringBox 1.1.5

Usage

Widget.onMemoryUpdate = function(isTrigger:Boolean) : Void {
// your statements here
}

Parameters

isTrigger - A Boolean value set to true when this instance of the widget was the one that updated the memory, false when it was not.

Returns

Nothing.

Description

Event handler; invoked when Widget.setMemory() is called. the event is broadcast to all open instances of a particular widget. You may respond to this handler by refreshing your interface to display the most up to date data from the memory using Widget.getMemory().

Example

Create a Widget with a text field txtDebug and a Button btnWrite. Open multiple instances of the widget; the instance on which the button was clicked will display the text from the if part, the others will display the text from the else part.

Widget.onMemoryUpdate = function(isTrigger:Boolean) {
  if(isTrigger)
  {
    txtDebug.text = "I changed the memory.";
  }else{
    txtDebug.text = "I didn't change the memory.";
  }
};
btnWrite.onRelease = function()
{
  Widget.setMemory({test:"test"});
};

See Also

Widget.getMemory(), Widget.setMemory()