Be a Supporter!

Need help with save states!

  • 267 Views
  • 1 Reply
New Topic
rhys510
rhys510
  • Member since: Feb. 10, 2009
  • Offline.
Forum Stats
Member
Level 25
Game Developer
Need help with save states! Sep. 30th, 2012 @ 05:02 AM

Hey guys once again im back on the NG fourms requesting help on save states ... :/
ok so iv got this ...

onClipEvent(enterFrame){
var savefile = SharedObject.getLocal("yourgamename");
if(this.hitTest(_root.char._x,_root.char._y,true) && (savefile.data.framenum==undefined)){
_root.fade.play();
}else if(this.hitTest(_root.char._x,_root.char._y,true) && !(savefile.data.framenum==undefined)){
number = savefile.data.framenum
_root.gotoAndStop(number);
}
}

this is what dosent work, i have it if the character hits this and the save file.data.framenum = undefined then it does play fade but for some reason when i use this code on a frame:

function onEnterFrame(){
savefile.data.framenum=_currentframe;
savefile.flush();
}

then it dosent work ...
im pretty sure its something to do with this bit

}else if(this.hitTest(_root.char._x,_root.char._y,true) && !(savefile.data.framenum==undefined)){
number = savefile.data.framenum
_root.gotoAndStop(number);
}
}

PLEASE HELP!!!!

Dean
Dean
  • Member since: Feb. 16, 2008
  • Offline.
Forum Stats
Moderator
Level 45
Gamer
Response to Need help with save states! Sep. 30th, 2012 @ 07:08 AM

This belongs in the Flash forum. Also, if you're including code in your post, please make use of the code tags. It makes things far easier to read.


BBS + Chat Moderator - Feel free to send me a PM if you have a problem!
Want to instant message me? [ Skype - DeanNewgrounds ]

BBS Signature