how to save toggle button state to localstorage function in html5 canvas?
this.tomboltanam.addEventListener("click", fl_MouseClickHandler_9.bind(this));
function fl_MouseClickHandler_9(){
if(localStorage.getItem(this.currentFrame) == 1){
localStorage.setItem(this.tomboltanam.gotoAndPlay(2));
}
else{
localStorage.setItem(this.tomboltanam.gotoAndPlay(1));
}
}
i have basic knowledge of coding with adobe animate . tomboltanam is the button name , the button is a movieclip with 2 frames in it to simulate a toggle button
if the user clicked which is frame 1 at that current time then play frame 2 which is the pressed button state
else then back to frame 1. And i want to save the button state so that when i refreshed the page the button state will stay the same as last time , i figure out the code through browsing web but it is still not saving as i hope .whats wrong with the code?
