A Flash Developer Resource Site

Results 1 to 9 of 9

Thread: Simple hit counter - to txt?

  1. #1
    Senior Member
    Join Date
    Jun 2002
    Location
    California
    Posts
    277

    Red face

    Is there any quick and easy way to make a hit counter - maybe one that puts the results in a txt file? I don't own the server so I have no idea what is installed on it - I don't think anything like PHP.



    PS. I want to thank again all the people who have helped me with so many questions I've asked already.

  2. #2
    Member
    Join Date
    Jun 2002
    Posts
    49
    hi

    if u can execute a cgi-script, then it would be possible to make a counter. thats the most common thing i think.

    u should consider using a flash-counter-service. u can find them all over the net for free.

    hope that helps

  3. #3
    Flashkit's Cheerbud LEXGRAPHICS's Avatar
    Join Date
    Dec 2001
    Location
    Miami
    Posts
    250

    Where can i find one

    Where can i find a flash hit counter for free therealBLAER
    ?

  4. #4
    Living Proof mave_the_rave's Avatar
    Join Date
    May 2002
    Location
    East Dulwich
    Posts
    1,006

    counter

    Hi boe_d

    If your SWF is in an HTML file then you can
    get a FREE counter from here:-
    http://www.beseen.com


  5. #5
    the usual
    Join Date
    Jul 2000
    Posts
    1,482
    did you know flashkit has a tutorials section and a movies section - there are a few in there you will need php or chi to run it!

    hth

  6. #6
    Junior Member
    Join Date
    Jun 2002
    Posts
    21
    i'm no flashmaster but from what i have learned earlier today you can use what is said in this post:
    http://board.flashkit.com/board/show...hreadid=331949

    so everytime the movie is loaded it gets the number and adds +1 then it saves it again..
    just a thought... offcourse this is very simple.. users can see this and push the update-button for an hour =) and then the counter is up in 5 miljon hits =)
    but hey, it is a counter anyway! =)

    if someone get it to work feel free to post how you did here..

  7. #7
    Senior Member
    Join Date
    Jun 2002
    Location
    California
    Posts
    277
    Thanks for the ideas

  8. #8
    the usual
    Join Date
    Jul 2000
    Posts
    1,482
    Originally posted by Bjurstrom
    i'm no flashmaster but from what i have learned earlier today you can use what is said in this post:
    http://board.flashkit.com/board/show...hreadid=331949

    so everytime the movie is loaded it gets the number and adds +1 then it saves it again..
    just a thought... offcourse this is very simple.. users can see this and push the update-button for an hour =) and then the counter is up in 5 miljon hits =)
    but hey, it is a counter anyway! =)


    wrong! - that link shows a completely different thing to what was asked so boe_d that won't be any use to you - like i said there are hit counters in the tutorials and movies section

    Bjurstrom - the code shown on that page looks like its using shared objects which are stored on the users hard drive therefore the figures can't be shared with anyone else but the user

    hope that clears something up


  9. #9
    That method is great for cookies - for example if you wanted the user to know that they have visited your site 20 times and their last visit was on June 10,2002...

    What you are looking for is a script that writes to a text file, you can then load the text file and display the data within your flash app. I recommend using PHP, I have been using it for a while now and think it's GREAT... Plus it's free...

    Your PHP code should look something like this:

    <?php
    $file=("counter.txt");
    $fp=fopen("$file", "a+");
    $write=("$visitor");
    fwrite($fp, "$write");
    fclose($fp);
    ?>

    This will take a variable passed from Flash called visitor and write it to the "counter.txt" file. From Flash you would need to load the "counter.txt" then add one (1) to the value read - once this is done you would call the PHP routine and it would update the text file.

    Good Luck!

    Jim Almeida
    http://www.atech-media.com



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center