# Clear() problem

**URL:** <https://forum.kirupa.com/t/clear-problem/247203>\
**Category:** Uncategorized\
**Created:** [December 19, 2007, 3:35pm UTC](https://forum.kirupa.com/t/clear-problem/247203 "2007-12-19T15:35:16Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![bigbalroo](https://avatars.discourse-cdn.com/v4/letter/b/439d5e/32.png) [@bigbalroo](https://forum.kirupa.com/u/bigbalroo)\
**Post date:** [December 19, 2007, 3:35pm UTC](https://forum.kirupa.com/t/clear-problem/247203/1 "2007-12-19T15:35:16Z")

</div>

hi all,

got a problem getting this to work, seems simple enough…

i have on keyframe one the syntax on the sharedObject:

```auto
var today = new Date();
var so:SharedObject = SharedObject.getLocal("time");
var period = 3600000;
if (loaded == total) {
}
if (!((this.today-this.so.data.val)<this.period)) {
	this.so.data.val = this.today;
	this.so.flush();
	gotoAndPlay(2);
} else {
	this.so.data.val = this.today;
	this.par = "skip";
	this.unloadMovie("http://www.mywebsite.com/popup/pop_up.swf");
}

```

what this code does is create a sharedObject for that user so that the swf will only load after an hour if they return back to the site.

now on the 2nd keyframe i have a button which i have put:

```auto
so.clear();

```

this should work right? but it dosent, where am i going wrong?

any advice or help is much appreciated.

thankyou :} Bigbalroo
