mercredi 25 janvier 2017

AS3/AIR Load/Save Username progress

I am creating an Android application created using Flash AS3. The user will input his/her name, click the previous and next button and press save. After restarting the application, the last frame saved was loaded (with the name). However if I want to input 2nd user with different name and save it in different frame, will the 2nd user's save progress be retained (without deleting the progress of the 1st user?). The problem, when I type the previous user name progress and press load, his saved progress doesn't load. Please help.

I am a newbie in programming. Here is my code so far:


var savedstuff:SharedObject = SharedObject.getLocal("myStuff");

btnSave.addEventListener(MouseEvent.CLICK, SaveData);
btnLoad.addEventListener(MouseEvent.CLICK, LoadData);
btnNext.addEventListener(MouseEvent.CLICK, pageNext);
btnPrev.addEventListener(MouseEvent.CLICK, pagePrev);

function pageNext (e:MouseEvent){

function pagePrev (e:MouseEvent){

function SaveData(MouseEvent){ = nameField.text 
function LoadData(MouseEvent){
 nameField.text =} 

nameField.text =}* 

Aucun commentaire:

Enregistrer un commentaire