I developed a puzzle game that when the user complete the level he get a star now if he closed the game the star will be hidden.
so how to let the star saved when the user close the stack!
Please anyone help me, please!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
Code: Select all
# on closestack or closecard:
...
put specialfolderpath("documents) & "/myprefs.txt" into myPrefsFile
put the_Variable_with_the_Highscore into url("file:" & myPrefsFile)
## Done writing to disk!
...
Code: Select all
## on openstack or opencard or whenever you need it
...
put specialfolderpath("documents) & "/myprefs.txt" into myPrefsFile
put empty into mySavedPrefs
## Only read it if the file is present of course!
if there is a file myPrefsFile then
put url("file:" & myPrefsFile) into mySavedPrefs
end if
## Now mySavedPrefs contains NADA (probably the first start of your app) or the saved prefs data.
...
...but I have no idea WHAT exactly you want to store in the preferences?
Code: Select all
set the default folder to specialFolderPath("documents") --tell where to save the file
put tNewData & cr after tCurrentData -- add the new level
put tCurrentData into url "file:myData.txt" --save file
Code: Select all
local tCurrentData -- the variable to save the data in
on preOpenCard
repeat with x = 1 to the number of graphics on this cd
hide graphic "fin" & x --hide all your check-marks *see note below
end repeat
set the default folder to specialFolderPath("documents") --as above we must set where to look for the file
put url "file:myData.txt" into tCurrentData --read the last data file saved
repeat for each line tLine in tCurrentData --read each line and see what is in it
set the visibility of graphic "fin" & tLine to true --- fin is your graphic, tLine will contain the numbers in the list and combine to make fin1, fin2, fin3 visible
end repeat
end preOpenCard
It won't work until you've understood all that I've said.i understood some of what you said but still doesn't work