I need the reader to continue on the last page he read.

Getting into LiveCode for iOS? Ask your questions here.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
jorgecaballero
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 32
Joined: Mon Nov 26, 2012 6:07 pm

I need the reader to continue on the last page he read.

Post by jorgecaballero » Tue Apr 15, 2014 8:32 pm

I am developing an interactive book

Need will automatically save the progress, I do not want bookmarks,
only to continue at the same point in the story.

I put a progress in a "field" with this code

  put the number of current card into field ID 1035
save this stack


And then I do this to continue reading:

if fld ID 1035 =1 then
go to card cover

else
go to card field ID 1035
end if



This works great on Mac, but does not work in iphone or ipad,
What I have to do to make it work?

Closing the APP on iphone or ipad restarts and is not saved.

I need the reader to continue on the last page he read.


Thanks

Jellicle
Posts: 453
Joined: Thu Feb 24, 2011 11:07 am

Re: I need the reader to continue on the last page he read.

Post by Jellicle » Tue Apr 15, 2014 9:30 pm

On iOS the app binary cannot be changed at runtime. Write the page number out to a text file and read that file on restart.
Gerry
14" MacBook Pro
Former LiveCode developer.
Now recovering.

Simon
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3901
Joined: Sat Mar 24, 2007 2:54 am

Re: I need the reader to continue on the last page he read.

Post by Simon » Tue Apr 15, 2014 10:30 pm

Hi jorgecaballero,
Here is a stack I made for writing out a "Preference file"
myPlants.zip
LC 6.5
(2.21 KiB) Downloaded 258 times
Now that is not exactly what you need but it shows you the steps required to save binary and text files to the "documents" folder (good for both mobile and desktop).

The important thing is that after you have written some text and added a photo that information is saved, when you close the app down those details will be loaded back into the app at startup.

Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!

jorgecaballero
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 32
Joined: Mon Nov 26, 2012 6:07 pm

Re: I need the reader to continue on the last page he read.

Post by jorgecaballero » Tue Apr 15, 2014 10:49 pm

thanks jellicy and Simon

How do I record the number of the card? and how do I bring it to continue on that card?

If you have any example code would help me a lot

Simon
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3901
Joined: Sat Mar 24, 2007 2:54 am

Re: I need the reader to continue on the last page he read.

Post by Simon » Tue Apr 15, 2014 11:08 pm

Well if you check out that stack how do I record the image and text?
There is lots of example code in it.

Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!

jorgecaballero
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 32
Joined: Mon Nov 26, 2012 6:07 pm

Re: I need the reader to continue on the last page he read.

Post by jorgecaballero » Wed Apr 16, 2014 7:49 pm

Thanks Simon,,,, works great.

Post Reply