Page 2 of 2

Re: how to save the game score on close card

Posted: Tue Dec 25, 2012 1:28 pm
by ahmedinvent24BUSGdU9
Hi, Simon
i wrote that code to read a text and it works
but in graphic or image it doesn't work

please how can i let it works with an image

Code: Select all

on saveTaskList
   put specialFolderPath("documents") & "/ahmed.txt" into tFilePath
   put field "name" of this stack into url ("file:" & tFilePath) 
end saveTaskList

on readTaskList
   put specialFolderPath("documents") & "/ahmed.txt" into tFilePath
   set the cText of this stack to url ("file:" & tFilePath)
   put the cText of this stack into field "name" 
end readTaskList

on preOpenCard
   readTaskList
end preOpenCard

Re: how to save the game score on close card

Posted: Tue Dec 25, 2012 2:39 pm
by Thierry
ahmedinvent24BUSGdU9 wrote:
i wrote that code to read a text and it works
but in graphic or image it doesn't work

Code: Select all

   put field "name" of this stack into url ("file:" & tFilePath) 
Hi,

Instead of "file:", use "binfile:" for any binary files.

HTH

Thierry

Re: how to save the game score on close card

Posted: Tue Dec 25, 2012 6:17 pm
by Simon
Hi Ahmed,
I have some questions for you.
What is actually stored in cText?
Did you personally purchase LC?
Did you personally install the Android SDK? If not you then who?

Good start on writing and reading a file! But I think that only your name is stored in ahmed.txt, nothing about "levels passed".
From the code you have provided I see no attempt at manipulating graphics. How is hiding/un-hiding graphics supposed to work if there is no code?
The second part of my previous answer gives you the code for displaying the graphics but I do not see any attempt on your part to implement it.
I'll give you a hint for adding levels to your text file, from your puzzle_sample:

Code: Select all

on mouseUp
   move graphic "ln" to the points of graphic "ln1"
   wait 0.2 sec 
   answer "Complete" with "OK" --Now would be a good time!
   wait 0.1 sec
   go card 1 show graphic "fin1"
end mouseUp
Please stop replying with general
... it doesn't work
Show me the code that doesn't work and I'll help you.
I tell you what, I asked you in my previous post to look up a few things in the dictionary. Please list them with a one line explanation of what they do and I'll give you another hint.

Simon