Splash Screen...

LiveCode is the premier environment for creating multi-platform solutions for all major operating systems - Windows, Mac OS X, Linux, the Web, Server environments and Mobile platforms. Brand new to LiveCode? Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
TheBigDuck
Posts: 23
Joined: Tue Nov 11, 2008 5:52 pm
Contact:

Splash Screen...

Post by TheBigDuck » Thu Nov 13, 2008 9:44 pm

I was looking for info on a splash screen...

on stackopen
show window???
wait 5 seconds
close window
end stackopen

Any suggestions?

andyh1234
Posts: 476
Joined: Mon Aug 13, 2007 4:44 pm
Contact:

Post by andyh1234 » Thu Nov 13, 2008 11:25 pm

Id probably set up a separate handler to do whatever you want to do when the splash screen closes, then use the send command to call the handler in 5 seconds, eg.

Code: Select all

on opencard
    send "finishsplash" to me in 5 seconds
end opencard

on finishsplash
   -- do whatever you want,  eg go to the next card, close the stack and open another etc
end finishsplash

Mark
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 5150
Joined: Thu Feb 23, 2006 9:24 pm
Contact:

Post by Mark » Fri Nov 14, 2008 12:28 am

Hi Duck,

Usually, I have a preOpenStack handler in the mainstack of my project, which fist sets up some initial veriables, read the preferences, and starts using libraries. When that's done, I open a splash window. Like Andy, I send a message in a few seconds, which closes the splash window. In the mean time, I continue setting up all other windows and if the splash window hasn't been closed by the user yet, I let the script wait until the splash window is out of the way. I finish the preOpenStack handler with the creation of a new document window, if applicable.

Here's an example, similar to my real scripts.

Code: Select all

on preOpenStack -- at card level, in mainstack
  -- essential setup first
  -- show splash window
  go stack "Splash" as modeless
  send "closeSplash" to cd 1 of stack "Splash" in 4 secs
  -- continue setup here
  -- now wait until splash stack is closed
  if "Splash" is among the lines of the openStack then
    repeat forever with messages
      if not ("Splash is among the lines of the openStacks) then
        exit repeat
     else
       wait 20 millisecs with messages
     end if
  end if
  -- open document window
  go stack "New Document Window"
end preOpenStack
Best,

Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode

Post Reply