First card with visual effect not accessible (SOLVED)

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

Post Reply
Tukcedo
Posts: 65
Joined: Fri Jun 27, 2014 9:43 pm

First card with visual effect not accessible (SOLVED)

Post by Tukcedo » Tue Sep 02, 2014 8:21 pm

Coders, here's another peculiar thing I noticed: I'm trying to create some sort of a splash screen by placing an image on the first card using the same background as the rest and then jump to the next card after a set delay using visual effect:

Code: Select all

on openCard
   visual effect dissolve
   wait 3 seconds
   go to card "MainMenu"
end openCard
1. in the IDE (Ubuntu 14.04 using LCC 6.6.2) this works beautifully BUT even in edit mode the visual effect is activated and there's no way I can edit the card script anymore, it always goes to that next card. How do I now edit this first card's script?

2. On Android the 1st card is presented at only 1/4th of the screen in the top left. The visual effect does happen but only in this much smaller than expected card (it's shown complete, just much smaller). When the visual effect terminates the next card is displayed in the expected size (full screen exactFit as specified in the stack script).

Ideas anyone?
Michel J.L. van der Kleij
Coding to help stray animals in the Philippines
Albert Foundation - http://albert.tukcedo.nl
Aklan Animal Rescue & Rehabilitation Center - http://aarrc.tukcedo.nl

Klaus
Posts: 13828
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: First card ("splash") with visual effect not accessible

Post by Klaus » Tue Sep 02, 2014 8:38 pm

Oops, wrong syntax actually :D

Code: Select all

on openCard
   wait 3 seconds
   lock screen for visual effect
   go card "MainMenu"
   unlock screen with visual dissolve
end openCard

Tukcedo
Posts: 65
Joined: Fri Jun 27, 2014 9:43 pm

Re: First card ("splash") with visual effect not accessible

Post by Tukcedo » Tue Sep 02, 2014 8:40 pm

OK fair enough, now how to get at the code? ;-)
Michel J.L. van der Kleij
Coding to help stray animals in the Philippines
Albert Foundation - http://albert.tukcedo.nl
Aklan Animal Rescue & Rehabilitation Center - http://aarrc.tukcedo.nl

Tukcedo
Posts: 65
Joined: Fri Jun 27, 2014 9:43 pm

Re: First card ("splash") with visual effect not accessible

Post by Tukcedo » Tue Sep 02, 2014 8:50 pm

Got it!! Just disable "messages" from the top menu does the trick ... Thanks for the suggestion Klaus, just about to try that.
Michel J.L. van der Kleij
Coding to help stray animals in the Philippines
Albert Foundation - http://albert.tukcedo.nl
Aklan Animal Rescue & Rehabilitation Center - http://aarrc.tukcedo.nl

Tukcedo
Posts: 65
Joined: Fri Jun 27, 2014 9:43 pm

Re: First card ("splash") with visual effect not accessible

Post by Tukcedo » Tue Sep 02, 2014 9:02 pm

Hmmm unfortunately same thing: 1/4 size first card with the right effect, just wrong size.

I tested a little and it appears that e.g. "iris close" does exactly the same thing. When I use it on the 2nd card to jump to the 3rd, it works well. It appears as if it's the first card (i.e. the opening of the stack?) that is the problem.
Michel J.L. van der Kleij
Coding to help stray animals in the Philippines
Albert Foundation - http://albert.tukcedo.nl
Aklan Animal Rescue & Rehabilitation Center - http://aarrc.tukcedo.nl

Klaus
Posts: 13828
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: First card ("splash") with visual effect not accessible

Post by Klaus » Tue Sep 02, 2014 9:05 pm

Try this approach:

Code: Select all

on openCard
   send "go2next" to me in 3 secs
end openCard

command go2next
   lock screen for visual effect
   go card "MainMenu"
   unlock screen with visual dissolve
end go2next

Tukcedo
Posts: 65
Joined: Fri Jun 27, 2014 9:43 pm

Re: First card ("splash") with visual effect not accessible

Post by Tukcedo » Tue Sep 02, 2014 9:11 pm

Klaus, you are a gem!! That works ...

Still wondering how that makes bringing up that first card any different, but using "send" is a cunning trick indeed :D
Michel J.L. van der Kleij
Coding to help stray animals in the Philippines
Albert Foundation - http://albert.tukcedo.nl
Aklan Animal Rescue & Rehabilitation Center - http://aarrc.tukcedo.nl

Klaus
Posts: 13828
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: First card ("splash") with visual effect not accessible

Post by Klaus » Wed Sep 03, 2014 12:50 pm

Dag Michel,
Tukcedo wrote:Klaus, you are a gem!
I hear that very often... :D
Tukcedo wrote:Still wondering how that makes bringing up that first card any different, but using "send" is a cunning trick indeed :D
I also don't know exactly what happens here, but I think this has to do with the way LC loads its libraries etc... when the stack starts.
Obviously not everything is available yet "on pre-/openstack" and "pre-/opecard" so this trick is only neccessary for the first card of a mainstack :D


Groetjes

Klaus

Tukcedo
Posts: 65
Joined: Fri Jun 27, 2014 9:43 pm

Re: First card ("splash") with visual effect not accessible

Post by Tukcedo » Wed Sep 03, 2014 1:27 pm

Vielen Dank Klaus! ;-)

Yes, the startup obviously has to do with it. Anyway I learned about something nice and practical about "send" in the process :-)

How can I add "Solved" to the title?

Wiederschauen!

Mich.
Michel J.L. van der Kleij
Coding to help stray animals in the Philippines
Albert Foundation - http://albert.tukcedo.nl
Aklan Animal Rescue & Rehabilitation Center - http://aarrc.tukcedo.nl

Klaus
Posts: 13828
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: First card with visual effect not accessible (SOLVED)

Post by Klaus » Wed Sep 03, 2014 1:45 pm

Dag Michel,

I did it :D


Best

Klaus

Post Reply

Return to “Getting Started with LiveCode - Complete Beginners”