# show application splash screen while loading sounds at game start up 

**URL:** <https://forums.solar2d.com/t/show-application-splash-screen-while-loading-sounds-at-game-start-up/299467>\
**Category:** Director Class\
**Created:** [February 13, 2012, 5:09am UTC](https://forums.solar2d.com/t/show-application-splash-screen-while-loading-sounds-at-game-start-up/299467 "2012-02-13T05:09:26Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![test\_driver](https://forums.solar2d.com/letter_avatar_proxy/v4/letter/t/b5e925/32.png) [@test\_driver](https://forums.solar2d.com/u/test_driver)\
**Post date:** [February 13, 2012, 5:09am UTC](https://forums.solar2d.com/t/show-application-splash-screen-while-loading-sounds-at-game-start-up/299467/1 "2012-02-13T05:09:26Z")

</div>

hello developers is there any why to show Loading screen while executing loadSounds function (this is my function that will loads game sounds ) it takes time to be loaded i am using director class  
thanks in advance  
[import]uid: 74537 topic\_id: 21815 reply\_id: 321815[/import]

---

<div class="post-metadata">

**Author:** ![rmbsoft](https://forums.solar2d.com/letter_avatar_proxy/v4/letter/r/8797f3/32.png) [@rmbsoft](https://forums.solar2d.com/u/rmbsoft)\
**Post date:** [February 13, 2012, 5:23am UTC](https://forums.solar2d.com/t/show-application-splash-screen-while-loading-sounds-at-game-start-up/299467/2 "2012-02-13T05:23:50Z")

</div>

Here’s my splash.lua i use for my games.

At the bottom i use a timer.performWithDelay of 2 seconds. You can change that to the time you need to load your sounds/music, before it continues loading the main menu.

[code]  
module(…, package.seeall)

new = function ( params )

* * *

## – Params

* * *

## – Params

* * *

## – Groups

local localGroup = display.newGroup()

* * *

## – Your code here

local background = display.newImage( “splash.jpg”, true )

* * *

## – Inserts

localGroup:insert( background )  
background.alpha = 0

transition.to( background, { time=3000, alpha=1.0} )

local function listener( event )

\_G.BackgroundMusic = audio.loadStream(“audio/music/main.mp3”)  
audio.play( \_G.BackgroundMusic, { channel=0, loops=-1 } )  
\_G.MainSound = audio.loadSound(“main.mp3”)  
\_G.GameSound = audio.loadSound(“game.mp3”)

director:changeScene( “menu”, “Fade” )  
end

timer.performWithDelay(3000, listener,1)

* * *

## – MUST return a display.newGroup()

return localGroup

end  
[/code] [import]uid: 50459 topic\_id: 21815 reply\_id: 86611[/import]

---

<div class="post-metadata">

**Author:** ![test\_driver](https://forums.solar2d.com/letter_avatar_proxy/v4/letter/t/b5e925/32.png) [@test\_driver](https://forums.solar2d.com/u/test_driver)\
**Post date:** [February 13, 2012, 5:56am UTC](https://forums.solar2d.com/t/show-application-splash-screen-while-loading-sounds-at-game-start-up/299467/3 "2012-02-13T05:56:49Z")

</div>

duplicated post [import]uid: 74537 topic\_id: 21815 reply\_id: 86617[/import]

---

<div class="post-metadata">

**Author:** ![test\_driver](https://forums.solar2d.com/letter_avatar_proxy/v4/letter/t/b5e925/32.png) [@test\_driver](https://forums.solar2d.com/u/test_driver)\
**Post date:** [February 13, 2012, 5:57am UTC](https://forums.solar2d.com/t/show-application-splash-screen-while-loading-sounds-at-game-start-up/299467/4 "2012-02-13T05:57:52Z")

</div>

thanks @rmbsoft [import]uid: 74537 topic\_id: 21815 reply\_id: 86616[/import]
