2 Replies Latest reply on Apr 29, 2011 7:57 AM by bborland2010

    Counting in Flash

    bborland2010

      I would like to build a poll question for a website and what I would like to do is to list 3 cars using the radio buttons. when the user submits hisor hers pick it would add 1 to that cars count and the page would show a photo of the car that currently has the most votes. I am thinking of using a var for each car but I am having problems scripting. originally I was doing something like

       

      var pinto:Number = 0;

       

      on frame 1 but then I thought everytime someone goes to the site it will reset the number to 0 and the count would start over. I know this is a newbie question but any help I could get I would appreciate.

        • 1. Re: Counting in Flash
          Ned Murphy Adobe Community Professional & MVP

          You'll need to have some form of a database in order to keep a tally of results.  It could be as simple as a textfile where you update it or as complicated as a full blown database.  In either case you need to involve server-side scripting, such as PHP because Flash alone cannot write to files or interact directly with a database.

           

          It can be a fairly cmplicated task for someone new, especially if you have little programming experience.  Your best bet will be to search Google for tutorials.  Try using search terms like "AS2 read data file" and "AS2 write data file"

          • 2. Re: Counting in Flash
            bborland2010 Level 1

            Thanks Ned, I will check it out. I am not new at programming and I work with flash often (mostly websites) but the counting thing was throwing me . I use PHP for my forms in flash, I just wasn't sure if I was missing a easier way to do it (PHP is my weak point). Thanks again for your help I appreciate it.