How do you add a music only for one screen when it is Initialized?

How to add a music only for one screen when it is Initialized.
and the music should stop when it is in screen2?

Please help me if anyone knows.

Thanks :slightly_smiling_face:

blocks

do you want to add long or short music?

The Sound component is recommended for short sound files like sound effects while the Player is recommended for longer sound files like songs

Example Blocks :

blocks

These blocks will start the music at Screen.Initialize, and pause it when Screen2 is opened. When the user goes back to Screen1 the music will continue.

But the user asked

You should close Screen1 when opening Screen2. Only then the music starts again when opening Screen1, because Screen1 is then initialized again.

Or you need this extension to check when the screen goes into the background (screen not visible). Stop the music then, and when Screen1 comes back to the foreground, start the music again.

grafik

2 Likes

Oh sorry my mistake, Example Updated :

blocks (1)

~ Just add [call Player1.Stop] when got to other screen

But, as I said, when Screen2 is closed the app returns to Screen1 (Screen1 comes to the foreground again) and the music will not start again (because Screen1.Initialize is not trggered again).

1 Like

Thanks :slightly_smiling_face:

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.