A Flash Developer Resource Site

Results 1 to 14 of 14

Thread: [Help] Game Counter

  1. #1
    Impressive Click swcAndrew's Avatar
    Join Date
    Oct 2004
    Location
    USA
    Posts
    468

    [Help] Game Counter

    I was wondering that could check the statistics of your game by setting up a counter that everytime the game is loaded, it adds a number to a counter that can be viewed by the creator of the game.

    This way when they want to view how many times their game has been played they can just open up that page and view the number. Is this possible? Has it been done before? Would you use php to code something like this?
    Andrew Webster
    Impressive Click

  2. #2
    Hype over content... Squize's Avatar
    Join Date
    Apr 2001
    Location
    Lost forever in a happy crowd...
    Posts
    5,926
    Do you mean a hit counter ? If so they're pretty easy to code, but if you don't want to get your hands dirty with php yourself, there are about a zillion open source counters on the net.

    If you want the counter integrated with Flash, here's an excellent site: http://www.flash-db.com/
    dunno if it's got a hit counter, but it covers all things to do with Flash and server side communication.

    Squize.

  3. #3
    Impressive Click swcAndrew's Avatar
    Join Date
    Oct 2004
    Location
    USA
    Posts
    468
    thanks, yea I meant a hint counter but I tried to be more specific because there are some counters that only show how many times you have played not how many times worldwide.
    Andrew Webster
    Impressive Click

  4. #4
    Senior Member flashisland's Avatar
    Join Date
    Aug 2003
    Posts
    241
    Our Prize Pro flash game uses a sort of 'flash hit counter' to see how often the game has been played each day. It's coded in PHP, and stores all the data in a text database file. It's pretty easy to code, and it's nice to see how many people play the game each day. You can check out the main game at http://www.flashisland.net/prize_pro_scratch.php and the game stats at http://www.flashisland.net/games/scr...demo_stats.php.

  5. #5
    Impressive Click swcAndrew's Avatar
    Join Date
    Oct 2004
    Location
    USA
    Posts
    468
    can you give me the code? Thats exactly what I need.
    Andrew Webster
    Impressive Click

  6. #6
    Senior Member flashisland's Avatar
    Join Date
    Aug 2003
    Posts
    241
    Unfortunately I can’t give out the code for the game counter unless you’re willing to purchase the Prize Pro engine.

    Basically it works the same way as a hit counter. When a person plays the game, a PHP script is called that totals up the plays that day. It should be pretty easy to take a regular hit counter script and convert it to be used in a flash game.

  7. #7
    Impressive Click swcAndrew's Avatar
    Join Date
    Oct 2004
    Location
    USA
    Posts
    468
    if you can't help me than why did you tell me?
    Andrew Webster
    Impressive Click

  8. #8
    Senior Member flashisland's Avatar
    Join Date
    Aug 2003
    Posts
    241
    I'm sorry that I can't give out the source code that was used, but I can outline how it was done a little more if you want to PM or e-mail me. I answered you because of your original request:
    Is this possible? Has it been done before?
    Just wanted to let you know that it is possible with PHP, and that it's not too hard to do.

  9. #9
    Senior Member dogtown08's Avatar
    Join Date
    Jul 2004
    Location
    In a later dimension
    Posts
    201
    I use a 100% free perl script that does everything you need for polling (do a search on polling for more info). It is flash based, and even comes with an example counter that is exactly what you need.

    Download it here: http://www.kessels.com/FlashDB/

  10. #10
    Senior Member
    Join Date
    Feb 2004
    Location
    Australia
    Posts
    156
    @ dogtown08: that looks good, but i've never used perl b4, is it similar to php (i don't think my host runs perl)?

  11. #11
    Impressive Click swcAndrew's Avatar
    Join Date
    Oct 2004
    Location
    USA
    Posts
    468
    do mosts host supppot php and/or pearl?
    Andrew Webster
    Impressive Click

  12. #12
    Senior Member dogtown08's Avatar
    Join Date
    Jul 2004
    Location
    In a later dimension
    Posts
    201
    I dont know any PHP, but if your host supports PHP, they probubly support perl. Plus, you dont need any knowledge of perl to set it up if you know some PHP. Read the instructions on the link I sent you, they are pretty clear.

  13. #13
    Impressive Click swcAndrew's Avatar
    Join Date
    Oct 2004
    Location
    USA
    Posts
    468
    yea, I want to use that but I don't have access to my cgi-bin with the host I am currently using. Does anyone know of any free hosting sites that supports php or pearl?
    Andrew Webster
    Impressive Click

  14. #14
    Senior Member
    Join Date
    Feb 2004
    Location
    Australia
    Posts
    156
    i'm not sure if i'm allowed to post this but we'll see, http://www.100webspace.com/ i used for a while, but it doesn't allow one function of php, to mail to ppl for a forum(or at least i couldn't get it to work) so i switched from them

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