Return to same card in app
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
Return to same card in app
I'm probably just overlooking it in the forums/manual, but what code do I need to enter (and where), to have my user return to the same card in the app once they leave? (ie: press Home button twice or click on link that exits app to Safari)
Thanks bunches!
-Tester2
Thanks bunches!
-Tester2
Re: Return to same card in app
Tester 2...
I have attached a stack that contains 3 cards... If you leave the stack say on card 2, when you open the stack again you will be taken to card 2 , or whichever card you chose to leave the stack.
Scripts are in the stack script...
hope it helps...
Dixie
I have attached a stack that contains 3 cards... If you leave the stack say on card 2, when you open the stack again you will be taken to card 2 , or whichever card you chose to leave the stack.
Scripts are in the stack script...
hope it helps...
Dixie
- Attachments
-
- whichOne.livecode.zip
- (1.87 KiB) Downloaded 283 times
Re: Return to same card in app
Dixie,
Thanks so much for the sample file!
I'm currently dissecting it, and came across a question.
You use the following in the stack script:
put URL "file:trackCard" into whichCard
go card whichCard
Is "whichCard" a custom property or field...and how is it defined?
Thanks so much!
-Tester2
Thanks so much for the sample file!

I'm currently dissecting it, and came across a question.
You use the following in the stack script:
put URL "file:trackCard" into whichCard
go card whichCard
Is "whichCard" a custom property or field...and how is it defined?
Thanks so much!
-Tester2
Re: Return to same card in app
It's simply a variable. You know about variables, don't you?
14" MacBook Pro
Former LiveCode developer.
Now recovering.
Former LiveCode developer.
Now recovering.
Re: Return to same card in app
tester2..
every time a user visits a card, the number of that card is written to the file 'trackCard'. (see the openCard handler). When the stack is restarted the number of the card that was last put into the file 'trackCard' is placed into a variable, which I called, whichCard...
Then the user is taken to that card with
be well,
Dixie
Code: Select all
if there is a file "trackCard" then
put URL "file:trackCard" into whichCard
go card whichCard
end if
Then the user is taken to that card with
Code: Select all
go card whichCard
Dixie
Re: Return to same card in app
Ahh...it makes sense now.
Is there a way that the file 'trackCard' gets reset?
Like, say I restart my phone...is there a way to tell this file to clear itself, so that the app opens as if it was the first time the user opened it?
Thanks.
-Tester2
Is there a way that the file 'trackCard' gets reset?
Like, say I restart my phone...is there a way to tell this file to clear itself, so that the app opens as if it was the first time the user opened it?
Thanks.
-Tester2
Re: Return to same card in app
Tester2...
There is no way to do this with liveCode as your 'app' lives in its own 'sandbox'...
Dixie
There is no way to do this with liveCode as your 'app' lives in its own 'sandbox'...
Dixie