I can save just fine outside the movieclip, but I need to load these things INSIDE movieclip.
My code so far :
Actionscript of “load game” button, makes new saved file if undefined.
on (release) {
if (idlequest.chapter != undefined) {
_root.def = idlequest.data.def;
_root.str = idlequest.data.str;
_root.spd = idlequest.data.spd;
_root.int = idlequest.data.int;
_root.chapter = idlequest.data.chapter;
_root.frames = idlequest.data.frames;
_root.events = idlequest.data.events;
gotoAndStop(4);
//data exists
//do actions
} else {
_root.chapter = 1;
_root.frames = 2;
_root.events = 0;
_root.str = 5;
_root.def = 4;
_root.spd = 4;
_root.int = 3;
_root.quests = 0;
gotoAndStop(4);
//data does not exists
//do actions
}
}
First frame inside the movieclip. If specific value isn’t undefined, loads data and goes to specific frame and stops there.
In other case, sets valuse but doesn’t save and throws
if (_root.frames = undefined) {
_root.def = idlequest.data.def;
_root.str = idlequest.data.str;
_root.spd = idlequest.data.spd;
_root.int = idlequest.data.int;
_root.chapter = idlequest.data.chapter;
_root.frames = idlequest.data.frames;
_root.events = idlequest.data.events;
gotoAndStop(_root.frames);
} else {
_root.chapter = 1;
_root.frames = 2;
_root.events = 0;
_root.str = 5;
_root.def = 4;
_root.spd = 4;
_root.int = 3;
_root.quests = 0;
gotoAndStop(_root.frames);
}
Save button outside the movie clip
on(release){
idlequest.data.frames = _root.frames;
idlequest.data.events = _root.events;
idlequest.data.quests = _root.quests;
idlequest.data.chapter = _root.chapter;
idlequest.data.str = 633;
idlequest.data.def = 222;
idlequest.data.spd = 122;
idlequest.data.int = 3514;
user_so.flush();
}
Yeah, I’m complete noob with Actionscript.