Opening card not displaying in Simulator
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
Opening card not displaying in Simulator
Hi all,
I have an app in which card 1 does not display when run in the simulator or on the device. I can go to card 2 and then back to card 1 just fine, and I can get card 2 to display as the first card (using "go card 2" in openstack), but for some reason, card 1 does not like to be first. Any ideas what's happening?
Joel
I have an app in which card 1 does not display when run in the simulator or on the device. I can go to card 2 and then back to card 1 just fine, and I can get card 2 to display as the first card (using "go card 2" in openstack), but for some reason, card 1 does not like to be first. Any ideas what's happening?
Joel
Re: Opening card not displaying in Simulator
Hi Joel,
Do you have any scripts that run automatically when the stack opens? Does the first card appear if you disable all these scripts?
Kind regards,
Mark
Do you have any scripts that run automatically when the stack opens? Does the first card appear if you disable all these scripts?
Kind regards,
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
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
Re: Opening card not displaying in Simulator
Hi Mark,
Thanks for your response. I have disabled all stack scripts (preOpenStack and openStack). The problem seems to be in the openCard handler for Card 1.
In an effort to solve this problem, I have created a new stack with only two cards. Card 1 has a single field. Card 2 has a single button with a mouseUp handler to go to Card 1. This is the script:
on preOpenCard
set the visible of fld "start" to false
set the text of fld "start" to "Start"
end preOpenCard
on openCard
local tCount
wait 1 second
set the effectrate to 1000
set the text of fld "start" to "Starting"
show fld "start" with visual effect "dissolve very slow"
repeat with tCount = 1 to 5
wait 500 milliseconds
set the text of fld "start" to the text of fld "start" & "."
end repeat
set the effectrate to 1000
lock screen for visual effect
go card 2
unlock screen with visual effect "dissolve very slow"
end openCard
It runs fine in the IDE. But on the simulator, Card 1 is completely black for the expected duration, and then Card 2 comes up. All functions properly from there on in. Card 1 behaves as expected, and so on.
I'm running LC 5.5.1. and building for iOS 5.0.
Regards,
Joel
Thanks for your response. I have disabled all stack scripts (preOpenStack and openStack). The problem seems to be in the openCard handler for Card 1.
In an effort to solve this problem, I have created a new stack with only two cards. Card 1 has a single field. Card 2 has a single button with a mouseUp handler to go to Card 1. This is the script:
on preOpenCard
set the visible of fld "start" to false
set the text of fld "start" to "Start"
end preOpenCard
on openCard
local tCount
wait 1 second
set the effectrate to 1000
set the text of fld "start" to "Starting"
show fld "start" with visual effect "dissolve very slow"
repeat with tCount = 1 to 5
wait 500 milliseconds
set the text of fld "start" to the text of fld "start" & "."
end repeat
set the effectrate to 1000
lock screen for visual effect
go card 2
unlock screen with visual effect "dissolve very slow"
end openCard
It runs fine in the IDE. But on the simulator, Card 1 is completely black for the expected duration, and then Card 2 comes up. All functions properly from there on in. Card 1 behaves as expected, and so on.
I'm running LC 5.5.1. and building for iOS 5.0.
Regards,
Joel
Re: Opening card not displaying in Simulator
It sounds like visual effect doesn't work on a device.
Try setting the blendLevel instead.
repeat with x = 100 down to 1
set the blendLevel of fld "start" to x
wait 10 milliseconds with messages --may need this or not
end repeat
Simon
Try setting the blendLevel instead.
repeat with x = 100 down to 1
set the blendLevel of fld "start" to x
wait 10 milliseconds with messages --may need this or not
end repeat
Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!
Re: Opening card not displaying in Simulator
Hi Simon,
I wish that was the problem, but it's not. The "visual effect" seems to work fine, as is demonstrated when opening Card 1 from Card 2 (button "Go Card 1"). Revising the code using blendLevel instead does not resolve this problem.
I think I've narrowed it down to this:
If I have "go card 2" in the openCard handler of card 1, the app will not display card 1, but will go to card 2 at the appropriate time, e.g. processing is happening but not visible. I can then navigate back to card 1 in the app and all is properly displayed. A bit more testing is required, e.g. I want to verify that adding a button on card 1 to get to card 2 works.
Seems like a bug to me.
Joel
I wish that was the problem, but it's not. The "visual effect" seems to work fine, as is demonstrated when opening Card 1 from Card 2 (button "Go Card 1"). Revising the code using blendLevel instead does not resolve this problem.
I think I've narrowed it down to this:
If I have "go card 2" in the openCard handler of card 1, the app will not display card 1, but will go to card 2 at the appropriate time, e.g. processing is happening but not visible. I can then navigate back to card 1 in the app and all is properly displayed. A bit more testing is required, e.g. I want to verify that adding a button on card 1 to get to card 2 works.
Seems like a bug to me.
Joel
Re: Opening card not displaying in Simulator
Hi,
It seem that is better with a send in time command, but the "dots adding" are not visible
Did you test it on device ?
Best regards
Jean-Marc
It seem that is better with a send in time command, but the "dots adding" are not visible
Did you test it on device ?
Code: Select all
on preOpenCard
set the visible of fld "start" to false
set the text of fld "start" to "Start"
end preOpenCard
on openCard
local tCount
wait 1 second
set the effectrate to 1000
set the text of fld "start" to "Starting"
show fld "start" with visual effect "dissolve very slow"
repeat with tCount = 1 to 5
wait 500 milliseconds
set the text of fld "start" to the text of fld "start" & "."
end repeat
set the effectrate to 1000
lock screen for visual effect
--•• jmb
send Gocard2 to me in 500 milliseconds
--go card 2
--unlock screen with visual effect "dissolve very slow"
end openCard
on Gocard2
lock screen for visual effect
go card 2
unlock screen with visual effect "dissolve very slow"
end Gocard2
Jean-Marc
https://alternatic.ch
Re: Opening card not displaying in Simulator
All,
Thanks for your continued efforts... But it still isn't working. When I run the following script on the simulator, the screen is blank for 5 seconds, then card 2 is displayed. I can navigate back to card 1 with a button on card 2, and then after 5 seconds will be sent back to card 2 with the gocard2 handler. But the problem remains: card 1 is a blank screen when the stack first opens.
I've revised the code to be in the following extremely basic form in a new mainstack with only two cards. The mainstack has the following script in the card 1 script:
Can somebody try this on their machines and let me know if it's working for you? I'm using a MacBook running Snow Leopard, LC 5.5.1. and building for iOS 5.0.
Thanks,
Joel
Thanks for your continued efforts... But it still isn't working. When I run the following script on the simulator, the screen is blank for 5 seconds, then card 2 is displayed. I can navigate back to card 1 with a button on card 2, and then after 5 seconds will be sent back to card 2 with the gocard2 handler. But the problem remains: card 1 is a blank screen when the stack first opens.
I've revised the code to be in the following extremely basic form in a new mainstack with only two cards. The mainstack has the following script in the card 1 script:
Code: Select all
on openCard
lock screen
unlock screen
wait 5 seconds with messages
send gocard2 to me in 500 milliseconds
end openCard
on gocard2
go card 2
end gocard2
Thanks,
Joel
Re: Opening card not displaying in Simulator
Hi Joel,
OSX 10.6.8, LC 5.02 make this result
Best regards
Jean-Marc
OSX 10.6.8, LC 5.02 make this result
It seem simulator don't work like device. Did you test your script on device ?1. 5 seconds blank
2. Cd 1 appear
3. Cd 2 is open after 500 milliseconds
Best regards
Jean-Marc
https://alternatic.ch
Re: Opening card not displaying in Simulator
Hi...
This works in the iphone simulator... the first card is visible immediately on launch and then after 5 secs goes to card 2>..
I don't understand your use of lock screen ...
Dixie
This works in the iphone simulator... the first card is visible immediately on launch and then after 5 secs goes to card 2>..

Code: Select all
on openCard
--lock screen
--unlock screen
--wait 5 seconds with messages
send gocard2 to me in 5000 milliseconds
end openCard
on gocard2
go card 2
end gocard2
Dixie
Re: Opening card not displaying in Simulator
Hi Dixie,
In some other testing, the use of lock/unlock generate a screen draw for me. After your post I tried again. It seems to work if you leave lock/unlock in, but comment out the "wait 5 seconds with messages" remark. I've also noticed "wait" in a repeat loop seems to cause problems. Not sure why, and maybe someone can explain this. What is the best way to create a pause in a loop?
Hi Jean-Marc,
I'll try on the device and report back.
Thanks.
Joel
In some other testing, the use of lock/unlock generate a screen draw for me. After your post I tried again. It seems to work if you leave lock/unlock in, but comment out the "wait 5 seconds with messages" remark. I've also noticed "wait" in a repeat loop seems to cause problems. Not sure why, and maybe someone can explain this. What is the best way to create a pause in a loop?
Hi Jean-Marc,
I'll try on the device and report back.
Thanks.
Joel
Re: Opening card not displaying in Simulator
Hi Joel,
Best regards
Jean-Marc
Here is a stack with a kind of timer for 5 seconds (but it is not an exemple of swiss precisions, the result should be between 5000 and 5015 millisecondsWhat is the best way to create a pause in a loop?

Best regards
Jean-Marc
- Attachments
-
- SimpleTimePendingLoop.livecode.zip
- (1.34 KiB) Downloaded 331 times
https://alternatic.ch
-
- Posts: 14
- Joined: Wed Dec 13, 2006 6:09 am
Re: Opening card not displaying in Simulator
Did you ever get a good solution to this problem? I have the exact same problem and it does seem to be related to "wait". I downloaded the time pending loop example and get it. But, it seems like "wait" should not cause this problem and there is a simpler solution I have not figured out yet.
Thanks.
Thanks.