how to match the count and save it?

I’m newbie here and just use Corona a few months ago. I am doing my final year project regarding unlocking the lock screen using tapping count and i hope u can help me a little bit maybe. First of all, i create a scene 2 for set the tapping count and scene 3 for a confirmation tapping count. If the tapping count in scene 3 are match with tapping count in scene 2, it will save how many count that user set as a no.of tapping for unlocking the screen. i faced a problem on how to match and valid the tapping count in scene 2 and 3. i hope u can help me. thank you  :slight_smile:

Hi there,

I would suggest using a myData.lua to store your tap number count. You would first need to require it in both scenes and use an event listener to set you values in myData.lua. If you’re doing this with a next button then it would be rather straight forward, by setting your tap count in myData.lua when the next button is clicked using something in the database like myData.tapValue1 on scene 2, then when your scene 3 loads use the same method but this time use a new value in your database like myData.tapValue2. Again if you are using next buttons when the button is clicked test if myData.tapValue1 == myData.tapValue2 then (Perform Function). You could then lastly use a final value in your database as your confirmed value by using your preform function if your two tap values match to set myData.confirmedTapValue = myData.tapValue1. Bear in mind that all three values will be saved and can be changed in any scene providing it has been required in the scene first.

This is a link to using this type of database:

https://coronalabs.com/blog/2013/05/28/tutorial-goodbye-globals/

Hope this helps,

Matt.

Hi there,

I would suggest using a myData.lua to store your tap number count. You would first need to require it in both scenes and use an event listener to set you values in myData.lua. If you’re doing this with a next button then it would be rather straight forward, by setting your tap count in myData.lua when the next button is clicked using something in the database like myData.tapValue1 on scene 2, then when your scene 3 loads use the same method but this time use a new value in your database like myData.tapValue2. Again if you are using next buttons when the button is clicked test if myData.tapValue1 == myData.tapValue2 then (Perform Function). You could then lastly use a final value in your database as your confirmed value by using your preform function if your two tap values match to set myData.confirmedTapValue = myData.tapValue1. Bear in mind that all three values will be saved and can be changed in any scene providing it has been required in the scene first.

This is a link to using this type of database:

https://coronalabs.com/blog/2013/05/28/tutorial-goodbye-globals/

Hope this helps,

Matt.