Phaser API Documentation

  Version: 
This is a beta release of our new docs system. Found an issue?
Please tell us about it in the #📖-newdocs-feedback channel on the Phaser Discord
Event: CHANGE_DATA
Phaser.Data.Events.CHANGE_DATA
CHANGE_DATA

Description:

The Change Data Event.

This event is dispatched by a Data Manager when an item in the data store is changed.

Game Objects with data enabled have an instance of a Data Manager under the data property. So, to listen for a change data event from a Game Object you would use: sprite.data.on('changedata', listener).

This event is dispatched for all items that change in the Data Manager. To listen for the change of a specific item, use the CHANGE_DATA_KEY_EVENT event.

Parameters:

name type description
parent any

A reference to the object that the Data Manager responsible for this event belongs to.

key string

The unique key of the data item within the Data Manager.

value any

The new value of the item in the Data Manager.

previousValue any

The previous value of the item in the Data Manager.

Since: 3.0.0