I want to save x and y position of the mouse every frame in array and copy it to disk with save button, so i could use last movements of mouse when I run program again.
I managed to get position to array, but when save button is clicked, array is saved, and it keep saving it every frame.
Here’s example: save_mouse_pos
Here’s my script:
posArr = new Array()
i = 0
function onEnterFrame(){
posArr* = [_xmouse,_ymouse]
i++
posArr_txt.text = posArr
data_txt.text = SO.data.filename
}
////////// Save Load //////////////////////////////////////////////////
SO = SharedObject.getLocal("savedFile")
save_btn.onRelease = function(){
SO.data.filename = posArr
trace("data saved")
}
Thanks in advance