# Local Shared Object Help

**URL:** <https://forum.kirupa.com/t/local-shared-object-help/237291>\
**Category:** flash\
**Created:** [August 29, 2007, 12:22am UTC](https://forum.kirupa.com/t/local-shared-object-help/237291 "2007-08-29T00:22:29Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Flash\_Man1](https://avatars.discourse-cdn.com/v4/letter/f/8797f3/32.png) [@Flash\_Man1](https://forum.kirupa.com/u/Flash_Man1)\
**Post date:** [August 29, 2007, 12:22am UTC](https://forum.kirupa.com/t/local-shared-object-help/237291/1 "2007-08-29T00:22:29Z")

</div>

Hey all,

I am trying to have a local shared object in flash to detect whether a user is a new user or a returning user. If they are a new user i want to do newUser function and if they are a previous user I want to do a previousUser function.

This should all be happening on an onEnterFrame.

Here is my code I have so far:  
[AS]  
//shared object - cookie  
newUser\_test = SharedObject.getLocal(“newUser”);  
newUser.text = newUser\_test.data.title = “new user”;

newUser.text.onEnterFrame = function () {  
newUser.text = “new user”;  
}

newUser.text.onEnterFrame = function(){  
newUser.text = newUser\_test.data.title = “previous user”;  
newUser\_test.flush();  
}

What am I doing wrong??

Thanks in advance!!  
[/AS]
