Working with some.data

Hi people
I am trying to learn some about it, i am seeing the tilt monsters code, to learn about this part.
i am trying to create something that i can stop the music on options_screen, and the music dont play on any part of the game and when i am playing, i can pause the game and active again the sound, and the sound will be active for all the screens of the game, other example is, on options_screen i choose the character, and it will appear on the game, the character that i choose.
On tilt monsters he used some like it

local saveChanges = function()  
 Runtime:removeEventListener( "touch", muteUnmute )  
  
 if settingsChanged == true then  
 saveValue( "char.data", charSelection )  
 saveValue( "theme.data", themeSelection )  
 saveValue( "tilt.data", tiltSelection )  
 saveValue( "music.data", musicData )  
 saveValue( "sound.data", soundsData )  
 saveValue( "difficulty.data", diffSelection )  
 end  
 end  

it is a function that will save the values, but i dont know the other part, that is with the if statements etc, and i dont know where i can learn about it, anyone know some place where i can learn about it? or what type of name i should put on the google? [import]uid: 26056 topic_id: 18836 reply_id: 318836[/import]

http://techority.com/2011/04/02/how-to-save-and-load-data-in-your-app/

maybe this will help you
and this site is also a blast: http://learningcorona.com/ [import]uid: 16142 topic_id: 18836 reply_id: 72501[/import]

Thanks for the help, i will learn it :slight_smile: [import]uid: 26056 topic_id: 18836 reply_id: 72515[/import]

you can also use global variables across scenes, declaring them like:
[lua]_G.myVar = false
_G.myOtherVar = “i am variable”
[lua]then you can get access to this variables in any other module\scene, but its not preferable behavior) its up to you [import]uid: 16142 topic_id: 18836 reply_id: 72517[/import]

Thanks again, i am learning it, some great doubts i will post :slight_smile: [import]uid: 26056 topic_id: 18836 reply_id: 72549[/import]

if you need extra help, join us: http://developer.anscamobile.com/forum/2011/12/02/lets-be-friends [import]uid: 16142 topic_id: 18836 reply_id: 72554[/import]