How to hold launch image a bit longer?

I’ve just developed a simple native web view and tested on my device with Default.png in place. But the thing is the launch image appears just about 2 seconds.

I want to make it a little longer? Say like 5-6 seconds? How to do so ? Any technique?

I’m using this method but it seem that it doesn’t work well:

launchImage = display.newImage(“Default.png”,true)

local launchImage = function(event)

launchImage:removeSelf()

launchImage = nil

end

timer.performWithDelay(5000, launchImage)

Hope that someone can help me to modify the code.

You’re on the right track. The only issue I see in your code is that you call your image “launchImage” and your function is also called “launchImage”. Change the name of your image to:

local myImage = display.newImage(“Default.png”, true)

Then inside your launchImage function, just change the 2 lines to say myImage instead.

Oh I see. My silly mistake. It works now. But something strange happened when I change the duration. 

When I change the duration from 5000 to 8000 and build it for device, it feels the same way. I still feel like a 2 seconds delay overall.

Do you know why?

You’re on the right track. The only issue I see in your code is that you call your image “launchImage” and your function is also called “launchImage”. Change the name of your image to:

local myImage = display.newImage(“Default.png”, true)

Then inside your launchImage function, just change the 2 lines to say myImage instead.

Oh I see. My silly mistake. It works now. But something strange happened when I change the duration. 

When I change the duration from 5000 to 8000 and build it for device, it feels the same way. I still feel like a 2 seconds delay overall.

Do you know why?