# Destroy on Unload

### Introduction

The DestroyOnUnload value controls whether music files are destroyed when the Screen is destroyed. This value can be set to false if you want the song to continue playing into the next Screen. For this to occur, the Screen which you are transitioning into must also have a reference to the same Song file.

### Example Implementation

To add a song that plays on two screens:

1. Create two screens (such as GameScreen and PostGameScreen)
2. Drag+drop a .mp3 or .wma file into GameScreen
3. Drag+drop the file from the GameScreen into the PostGameScreen's Files. Be sure that the name of the file is the same in both screens ![SameNamedMp3s.png](/files/Q7Vr706m7JnjNxV3lhfY)
4. Set the "DestroyOnUnload" value to "False" on the Song you want to continue playing. If you set it on both, then you will be able to go back and forth between the two Screens and the song will continue playing. ![DestroyOnUnload.png](/files/3heX2EKCOvYuq4UIh5eB)
5. Write custom code in your game to transition between the two Screens - notice that the song continues to play despite the transition.

Things to remember:

* You do not need to manually play Songs that have been added to Screens through Glue. Doing so may make your song restart.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.flatredball.com/flatredball/glue-reference/files/glue-reference-destroyonunload.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
