|

Once a song has been added, you can change its position or remove it by using the buttons beneath the list.


Tip: You can also rearrange the songs by dragging them up or down with the mouse.


image

image


Three sampl e tunes from the gall ery


5 ) P re ss F 5 t o p rev i e w t h e p r oj ec t . T ry ju m ping b ack a nd f o r t h b e t w ee n t h e p a g e s .

The background music starts up as soon as the application starts, and keeps playing until it closes. Note that jumping to another page doesn't interrupt the music at all...it just keeps on playing, smooth as always.


Even jumping to the video page doesn't stop the background music. When the video starts playing, its audio plays over top of the background music. The video has its own soundtrack, but it just gets mixed together with the background music of the application.


It sounds pretty bad, because the video's audio track and the background music were definitely not meant to be played at the same time. But we can fix that by pausing the background music while the user is on the video page.


6 ) E x i t t h e p rev i e w.

Just click the Exit button or press Alt+F5 to close the application and return to the AutoPlay design environment.


Pausing the Background Audio

There are times when you'll want the background music to stop playing. For instance, if you have a video object that has its own soundtrack, you probably don't want it to clash with the background music, so you'll want to pause the background music while the video is being shown.


In our case, the video is shown while the user is on the Video page, so we need to turn the music off when they reach that page, and turn it back on when they leave it. This is easy to do with a pair of Audio.TogglePlay actions.


image

Tip: You can use this same technique to add a toggle button so the user can turn the music on or off-just in case their taste in music is a bit too different from yours.


1 ) S wi t c h t o t h e V id e o p a g e .

Before you can add any actions to the Video page's events, you need to switch to the page. To do that, just click on the Video page's tab.


2 ) A dd a n A udio.Toggl e P l ay ac t ion t o t h e p a g e ' s On S how eve n t . I n t h e ac t ion ' s p arame t er s , s e t C h a nn e l t o CHANN E L _BACK G R O UND . L eave

t h e s cr ip t e di t o r op e n.

The Audio.TogglePlay action toggles an audio channel's playback between playing and paused. If there is currently audio playing in that channel, the action will pause it; if the audio in that channel is currently paused, the action will un-pause it.


To add the action, double-click on the page surface, and click on the Script tab. In the script editor, click on the On Show tab, and then click the Add Action button to bring up the New Action wizard. Change the category to "Audio," select Audio.TogglePlay from the list, and click Next to edit the action's parameters.


image


In the action parameters, you can specify the channel that you want the action to toggle. In this case, we want to toggle the playback of the background audio channel, so you need to change the Channel setting to CHANNEL_BACKGROUND.


Once you have the action configured, click Finish to close the wizard. The Audio.TogglePlay action will appear in the script editor.


image


image

Note: Don't close the script editor just yet; you need to add an action to the On Close event as well.


|