Help with Splash Screen
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
-
- Posts: 44
- Joined: Sat May 17, 2014 1:48 pm
Help with Splash Screen
Looking at the various forums and on line there seems to be a couple of ways that I could create a splash screen, i.e. just a simple screen that will appear for around 5 seconds when the stack is opened.
I decided to go along the route of creating a card which is Number 1 and called it Splash1, In the Stack Script I have
on openstack
go to card "Splash1"
end openstack
on preOpenStack
mobileSetKeyboardType "decimal"
set the fullscreenmode of me to "exactFit"
end preOpenStack
on keydown k
if k is in "0123456789" then pass keydown
if k is "." then pass keyDown
end keydown
and then on the card Splash1 I have
on openstack
wait 5 seconds
go to "Main Menu"
end openstack
The odd thing is that when the app starts it clearly waits the 5 seconds but instead of showing the card Splash1 it just shows a black screen. After which it then moves onto the Splash Screen permanently, I guess that this is because the Splash1 card is the first in the list.
But why does it show a Black screen and not the actual Splash1 card ?
I decided to go along the route of creating a card which is Number 1 and called it Splash1, In the Stack Script I have
on openstack
go to card "Splash1"
end openstack
on preOpenStack
mobileSetKeyboardType "decimal"
set the fullscreenmode of me to "exactFit"
end preOpenStack
on keydown k
if k is in "0123456789" then pass keydown
if k is "." then pass keyDown
end keydown
and then on the card Splash1 I have
on openstack
wait 5 seconds
go to "Main Menu"
end openstack
The odd thing is that when the app starts it clearly waits the 5 seconds but instead of showing the card Splash1 it just shows a black screen. After which it then moves onto the Splash Screen permanently, I guess that this is because the Splash1 card is the first in the list.
But why does it show a Black screen and not the actual Splash1 card ?
Re: Help with Splash Screen
Hi Dazza,
no idea what i going on there, but here some useful hints:
this is not neccessary at all, since, if not scripted otherwise, the first card is ALWAYS displayed first 
Save a line:
Best
Klaus
no idea what i going on there, but here some useful hints:
Code: Select all
##on openstack
##go to card "Splash1"
##end openstack

Save a line:
Code: Select all
on keydown k
if k is in "0123456789." then pass keydown
end keydown
Code: Select all
on openstack
wait 5 seconds
## WHAT is "Main menu"? A card or a stack?
## You need to tell Livecode! cd = abbrev. for card
go cd "Main Menu"
end openstack
Klaus
-
- Livecode Opensource Backer
- Posts: 10114
- Joined: Fri Feb 19, 2010 10:17 am
Re: Help with Splash Screen
I have a splash screen (admittedly for Mac, Windows and Linux; not building for mobile machines) and it works like this:
I have an image on the first card of my stack; let's call it "SPLOSH", and this code in the openCard script of card number 1
on openCard
set the vis of img "SPLOSH" to true
wait 5 seconds
set the vis of img "SPLOSH" to false
end openCard
I would be grateful if you could give that "a whirl" and let
me know if you end up with a black screen.
I have an image on the first card of my stack; let's call it "SPLOSH", and this code in the openCard script of card number 1
on openCard
set the vis of img "SPLOSH" to true
wait 5 seconds
set the vis of img "SPLOSH" to false
end openCard
I would be grateful if you could give that "a whirl" and let
me know if you end up with a black screen.
Re: Help with Splash Screen
Oh, thank you 

Re: Help with Splash Screen
Hi Dazza,
completely overlooked this one:
This:
Best
Klaus
completely overlooked this one:
This:
should be:dazza the stag wrote:...
and then on the card Splash1 I have
on openstack
wait 5 seconds
go cd "Main Menu"
end openstack
Code: Select all
on openCARD
wait 5 seconds
go cd "Main Menu"
end openCARD
Klaus
-
- Posts: 44
- Joined: Sat May 17, 2014 1:48 pm
Re: Help with Splash Screen
Thanksrichmond62 wrote:I have a splash screen (admittedly for Mac, Windows and Linux; not building for mobile machines) and it works like this:
I have an image on the first card of my stack; let's call it "SPLOSH", and this code in the openCard script of card number 1
on openCard
set the vis of img "SPLOSH" to true
wait 5 seconds
set the vis of img "SPLOSH" to false
end openCard
I would be grateful if you could give that "a whirl" and let
me know if you end up with a black screen.
This is what I did the new card being card id 1282 and I used Klaus new bouquet of flowers and named the file Splosh Is that correct ?
Re: Help with Splash Screen
When it works, then it is correct! 

-
- Posts: 44
- Joined: Sat May 17, 2014 1:48 pm
Re: Help with Splash Screen
Lol - but it doesn't quite, yes I do get that screen up with the flowers on but i was expecting it to move to the next card after 5 seconds but it doesn't it just remains on that card. I have tried adding the lineKlaus wrote:When it works, then it is correct!
Go to card "Main Menu"
both before and after the end Opencard command but that doesn't seem to do anything
And the reason I asked was what I had done correct was that surely by putting that photo onto card 1 it was going to show anyway as you mentioned earlier - so I couldn't see the relevance of "set the vis of ing" etc, I therefore wanst sure that i had followed the instructions properly
Sorry for being such a newbie but I seemed to be doing really well and then decided to add what seemed to be a really simple splash screen and the whole thing has gone pear shaped ! lol
-
- Posts: 44
- Joined: Sat May 17, 2014 1:48 pm
Re: Help with Splash Screen
Here is an update on the issue after several more hours of "playing"
I added
on openCard
set the vis of img "Splosh.jpg" to true
wait 5 seconds
set the vis of img "Splosh.jpg" to false
Go to card "Main Menu"
end open card
to the first card. If I double click on the first card in the application Browser it does as I would expect, I have also added a button onto another card that takes me to this same initial card so that I can see how it performs getting to it from a different method and that works ok too.
However when i run it through the iPhone simulator I get the black screen again instead of viewing the lovely flowers. Using the button i created on another card in the same stack to take me to that card again works fine though the simulator.
So any other ideas on why I am getting this black screen instead of the flowers ?
I do seem to have solved the issue of moving on to the next card though - thank you
I added
on openCard
set the vis of img "Splosh.jpg" to true
wait 5 seconds
set the vis of img "Splosh.jpg" to false
Go to card "Main Menu"
end open card
to the first card. If I double click on the first card in the application Browser it does as I would expect, I have also added a button onto another card that takes me to this same initial card so that I can see how it performs getting to it from a different method and that works ok too.
However when i run it through the iPhone simulator I get the black screen again instead of viewing the lovely flowers. Using the button i created on another card in the same stack to take me to that card again works fine though the simulator.
So any other ideas on why I am getting this black screen instead of the flowers ?
I do seem to have solved the issue of moving on to the next card though - thank you
Re: Help with Splash Screen
Is "Splosh.jpg" on cd 1?
From the other card with the button "go to cd 1" should show you the flowers, if not then something is wrong.
Simon
From the other card with the button "go to cd 1" should show you the flowers, if not then something is wrong.
Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!
-
- Posts: 44
- Joined: Sat May 17, 2014 1:48 pm
Re: Help with Splash Screen
Simon - thanks - yes i believe that it is all like you say - I have attached a screenshot just in case i am misunderstanding you.Simon wrote:Is "Splosh.jpg" on cd 1?
From the other card with the button "go to cd 1" should show you the flowers, if not then something is wrong.
Simon
As i said the button works to take me to that card it is just when i open the app in the simulator it doesn't appear properly at the beginning - as a splash card
Re: Help with Splash Screen
.Hi,
Ok this has gone on long enough for a simple splash screen.
First check that your stack scripts don't point you to cd Splash1 or anything else.
Then post your stack.
Simon
Ok this has gone on long enough for a simple splash screen.
First check that your stack scripts don't point you to cd Splash1 or anything else.
Then post your stack.
Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!
-
- Posts: 44
- Joined: Sat May 17, 2014 1:48 pm
Re: Help with Splash Screen
Sorry SimonSimon wrote:.Hi,
Ok this has gone on long enough for a simple splash screen.
First check that your stack scripts don't point you to cd Splash1 or anything else.
Then post your stack.
Simon
I have deleted any test cards just to ensure they were not messing anything up and there is nothing on the stack
Just tried to attach the zipped file and it says its too big - not my day ! it says max file size is 256kb
Re: Help with Splash Screen
Make a copy and start deleting cards until it's small enough to post and still shows the error.
Simon
Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!