# Loading saved data inside movieclip

**URL:** https://forum.kirupa.com/t/loading-saved-data-inside-movieclip/278474
**Category:** flash
**Created:** [December 30, 2008, 8:08pm UTC](https://forum.kirupa.com/t/loading-saved-data-inside-movieclip/278474 "2008-12-30T20:08:46Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![Matoking](https://avatars.discourse-cdn.com/v4/letter/m/838e76/32.png) [@Matoking](https://forum.kirupa.com/u/Matoking)
#### Post date: [December 30, 2008, 8:08pm UTC](https://forum.kirupa.com/t/loading-saved-data-inside-movieclip/278474/1 "2008-12-30T20:08:46Z")

</div>

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.

```auto
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

```auto
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

```auto
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.
