Help with Splash Screen

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

dazza the stag
Posts: 44
Joined: Sat May 17, 2014 1:48 pm

Help with Splash Screen

Post by dazza the stag » Sat May 31, 2014 4:56 pm

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 ?

Klaus
Posts: 14205
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Help with Splash Screen

Post by Klaus » Sat May 31, 2014 5:05 pm

Hi Dazza,

no idea what i going on there, but here some useful hints:

Code: Select all

##on openstack
  ##go to card "Splash1"
##end openstack
this is not neccessary at all, since, if not scripted otherwise, the first card is ALWAYS displayed first :D

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
Best

Klaus

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 10114
Joined: Fri Feb 19, 2010 10:17 am

Re: Help with Splash Screen

Post by richmond62 » Sat May 31, 2014 5:09 pm

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.

[-hh]
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2262
Joined: Thu Feb 28, 2013 11:52 pm

Re: Help with Splash Screen

Post by [-hh] » Sat May 31, 2014 5:19 pm

Klaus,
  • NEW TOPSCORE .... 6000
    Flowers for you !
flowers4Klaus.jpg
shiftLock happens

Klaus
Posts: 14205
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Help with Splash Screen

Post by Klaus » Sat May 31, 2014 5:47 pm

Oh, thank you :D

Klaus
Posts: 14205
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Help with Splash Screen

Post by Klaus » Sat May 31, 2014 5:50 pm

Hi Dazza,

completely overlooked this one:

This:
dazza the stag wrote:...
and then on the card Splash1 I have
on openstack
wait 5 seconds
go cd "Main Menu"
end openstack
should be:

Code: Select all

on openCARD
   wait 5 seconds
   go cd "Main Menu"
end openCARD
Best

Klaus

dazza the stag
Posts: 44
Joined: Sat May 17, 2014 1:48 pm

Re: Help with Splash Screen

Post by dazza the stag » Sat May 31, 2014 6:15 pm

richmond62 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.
Thanks

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
Screen Shot 2014-05-31 at 18.13.00.png
Is that correct ?

Klaus
Posts: 14205
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Help with Splash Screen

Post by Klaus » Sat May 31, 2014 6:41 pm

When it works, then it is correct! :D

dazza the stag
Posts: 44
Joined: Sat May 17, 2014 1:48 pm

Re: Help with Splash Screen

Post by dazza the stag » Sat May 31, 2014 6:52 pm

Klaus wrote:When it works, then it is correct! :D
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 line

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

dazza the stag
Posts: 44
Joined: Sat May 17, 2014 1:48 pm

Re: Help with Splash Screen

Post by dazza the stag » Sat May 31, 2014 10:17 pm

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

Simon
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3901
Joined: Sat Mar 24, 2007 2:54 am

Re: Help with Splash Screen

Post by Simon » Sat May 31, 2014 10:28 pm

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
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!

dazza the stag
Posts: 44
Joined: Sat May 17, 2014 1:48 pm

Re: Help with Splash Screen

Post by dazza the stag » Sat May 31, 2014 10:34 pm

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
Screen Shot 2014-05-31 at 22.32.14.png
Simon - thanks - yes i believe that it is all like you say - I have attached a screenshot just in case i am misunderstanding you.

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

Simon
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3901
Joined: Sat Mar 24, 2007 2:54 am

Re: Help with Splash Screen

Post by Simon » Sat May 31, 2014 11:18 pm

.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 used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!

dazza the stag
Posts: 44
Joined: Sat May 17, 2014 1:48 pm

Re: Help with Splash Screen

Post by dazza the stag » Sat May 31, 2014 11:33 pm

Simon 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
Sorry 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

Simon
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3901
Joined: Sat Mar 24, 2007 2:54 am

Re: Help with Splash Screen

Post by Simon » Sun Jun 01, 2014 1:34 am

Make a copy and start deleting cards until it's small enough to post and still shows the error.

Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!

Post Reply