Page 1 of 1

Splash Screen...

Posted: Thu Nov 13, 2008 9:44 pm
by TheBigDuck
I was looking for info on a splash screen...

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

Any suggestions?

Posted: Thu Nov 13, 2008 11:25 pm
by andyh1234
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

Posted: Fri Nov 14, 2008 12:28 am
by Mark
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