Load/Save Event

This is the sub event that will be triggered by certain loading and saving functions.

This event will be triggered by certain functions related to loading and saving buffers to files, as well as when loading or unloading audio from memory. The event itself will contain the built in async_load DS map which will be populated by the keys required for the specific function. These are listed below.

NOTE: The variable async_load is only valid in the asynchronous events, as the ds_map that is points to is created at the start of the event, then deleted again at the end, with this variable being reset to a value of -1 for all other events.


When you use the functions buffer_save_async() or buffer_load_async() an asynchronous event will be triggered when the data transfer has been completed. This event will populate the async_load map with the following key/value pairs

  1. "id": the ID of the async function as returned by the function used.
  2. "status": will return true if the data was saved/loaded correctly, and false otherwise.

This permits you to poll the saving/loading progress and display a message or change rooms etc... when the process is complete.

Audio Groups

When working with Audio Groups, you can load them an unload them from memory using the functions audio_group_load() and audio_group_unload(). When using the load function, it will trigger this event when the full set of audio files set for the group has been loaded into memory and will populate the map with the following key/value pairs:

  1. "type": this tells us the type of event being called and will be "audiogroup_load" for loading audio.
  2. "group_id": will return the ID of the audio group that has been loaded (as defined in the Global Game Settings Audio Groups Tab)

When all audio has been loaded for a group, this event will trigger and it can then be used to change rooms, or play a music track etc...

Back: More About Async Events
Next: Audio Recording Event
© Copyright YoYo Games Ltd. 2018 All Rights Reserved