Creating a Web Poll in Flash MX 2004: Pt. I Support

In this series of tutorials, we're going to create a very basic poll application in Flash MX 2004. The poll will ask a question and show a list of radio buttons containing responses. The user will select a response, vote and then view a simple chart showing all the responses received so far. This application could be useful for an Intranet or even a web site.

We'll want to ask new poll questions from time to time so we'll read in the poll details from an external source. We could use a text file, an XML file or a database to store the information. Using one of these sources means that we won't have to open the Flash file and republish it each time we change the question. We can just update the source and the Flash movie will update automatically.

This first tutorial will look at how you could load content from all three sources and is written for ActionScript 2.0. We'll build functions to read in the poll details and display them in a Flash movie. We'll add radio buttons to the stage dynamically.

Part two of the tutorial will deal with collecting the vote, displaying a simple chart and updating the results, while the third part of the tutorial will recreate the poll application using the new AS 2.0 classes and will provide a great introduction to working with classes in Flash MX 2004.

Please note if you want to work with a database or update the poll results, you'll need some kind of web server and a server-side language like PHP, Cold Fusion, ASP or ASP.NET. Because I'm an ASP.NET developer, this part of the tutorial will use ASP.NET, IIS 5 with .NET, and Access for the back-end.

All the source code is available for download.

$2.89
- OR -

Sas Jacobs

Sas JacobsHello. I'm the Principal of Anything Is Possible, an Australian web development business specialising in web applications development and training. I'm interested in using Flash with dynamic content and I've presented at a number of International conferences on topics relating to applications development, XML and scripting components. I have recently released my second print book Beginning XML with DOM and Ajax to match the first one - Foundation XML for Flash. I have a business web site
and a personal web site.

See All Postings From Sas Jacobs >>