Skip to main content
Darshan_Rane
Inspiring
August 22, 2006
Question

Hit Counter using Shared Object

  • August 22, 2006
  • 3 replies
  • 522 views
hi
i am developing hit counter in flash using shared objects.

here is the code.

hitcounter();

function hitcounter():Void {

var lsoNotes:SharedObject = SharedObject.getLocal("counter");
count = lsoNotes.data.hit
lsoNotes.data.hit = Number(count)+1;
hit.text = lsoNotes.data.hit;
lsoNotes.flush();
}


It works fine locally. But doesnt work online. There is a Flash player sysytem setting which allows to write shred object s locally.
but how can we override this on user's computer?

Also can anyone put some light on remote shared object.

thanks
This topic has been closed for replies.

3 replies

Inspiring
August 23, 2006
On Wed, 23 Aug 2006 07:16:11 +0000 (UTC), "Darr_darshan"
<webforumsuser@macromedia.com> wrote:

>yes it will be for each user.
> but i have uploaded this and tried but it doesn't work.
> it work same as javascript cookie for one user.

It works just as a cookie because it is just a Flash "cookie". Nothing
more. How sharedobject could be shared between several users??? It
can't!

If you want a counter -- create a counter! Do not use sharedobject for
that. More exactly, you may use it just to detect unique hosts. But
not for the total count calculation!

Darshan_Rane
Inspiring
August 23, 2006
yes it will be for each user.
but i have uploaded this and tried but it doesn't work.
it work same as javascript cookie for one user.

i think there must be some setting for flash playerto allow write shared objects
kglad
Community Expert
Community Expert
August 23, 2006
post a link to your fla.
kglad
Community Expert
Community Expert
August 22, 2006
what makes you think it doesn't work online?

you know your counter will only be a counter for each user, correct? it will not track the total visits to your swf that contains that code.