QuickPoll Template Tutorial
QuickPoll Component Tutorial
Skinning the QuickPoll Component
Actionscript options
Requirements


QuickPoll Template Tutorial
 


The QuickPoll Template includes the files you need to create a stand-alone poll or a poll to add to your HTML pages. You do not need the Flash application to use the QuickPoll Template. There are 3 templates included in the download. Select one of the templates and follow the steps below.


Step 1 - Fill out the necessary properties in the XML file
Open the file named "polldata.xml" in a HTML or text editor. This is the file you edit to customize the poll. Fill out the required properties listed below. For a full list of properties for customizing QuickPoll click here. To download a sample XML file click here.

Parameter in XML Description
<question>Enter question here</question>

Enter the question for the poll.

<answers>
<a>Choice one</a>
<a>Choice two</a>
<a>Choice three</a>
</answers>

Enter the choices for the poll. Each choice is represented in the <a> tag. To add choices, add another row like this: <a>next choice</a>

<phpPath>http://domain.com/quickPoll.php
</phpPath>

This is the URL path to the PHP file that you loaded to your web server in Step 2. Enter the full URL to the location of the PHP file.
<uniquePollName>poll_1</uniquePollName>

This can be set to any name. It CANNOT contain spaces. You can leave as is OR if you are showing more than one poll, be sure to give this parameter a unique name for each poll for the following reason. This name is used to set a Flash cookie and is used by PHP to create a text file to store poll data. For example, if you set the name as "poll_1" a file named "poll_1.txt" will automatically be created in the same directory as the PHP file. To clear your poll data, simply delete this file from your server. The next time a vote is submitted, the file will be recreated and the poll will be reset to "0".

<onlyOneVote>true</onlyOneVote> If set to "true", a user is only allowed to vote once. The next time they visit the poll, they will be shown the results of the poll and not allowed to vote again. Setting this parameter to "false" is useful when testing your poll. Remember to set this back to "true" when loading to your web site, if this is the desired behavior.


Step 2 - Upload the PHP file and set permissions.

In the Template folder, find the file named "quickPoll.php". Upload this file to a folder on your web server. You then need to set the Permissions (chmod) of this folder. Note: Set the permissions on the folder not the file. To do this, open your FTP application and right click on the folder that contains the PHP file. Depending on your FTP application select either: "Permissions", "Properties" or "Attributes". This will open a window similar to the image on the right. Place a check mark in each box or type in the permissions "777". If you are having problems changing permissions, contact your hosting service and make sure they allow you to set permissions on folders. You can also find more information by clicking here.



Step 3 - Load the files to your web server.
Load the html, swf and xml file to your web server. Note: These files and the PHP files need to be placed on the same server.

Step 4 - Test
In a browser, type in the URL where you placed the html file. Then test the poll. If you see an error message after you make a vote, make sure you have followed Step 2 carefully. If properly set up, you will see the results of your poll.

About testing the poll on your local machine.
You can also test the poll on your local machine by opening the file "quickPoll.html" into your web browser. When testing locally, you may get a pop-up indicating a security error. If so, click on "settings." This will take you to a Macromedia security settings page. In the box in the center of the page, click on "Edit Locations" and then "Add Location." Copy the path in the bottom field and paste into the top field labeled: "Trust this location." Click "Confirm." Then restart your browser and test the poll again. These steps are necessary in order to bypass Flash's security setting when testing locally. You do not need to do this when testing on your web server.


Complete List of Properties
 


The following is a list of all the properties and their descriptions. These are the properties you set in the XML file.

Parameter sample value Description
Question Do you like QuickPoll? Enter the Question of your poll
Answers Yes,No,Maybe Enter the choices for you poll. To add choices, click on the "+" button.
phpPath http://www.domain.com/quickPoll.php This is the path to the PHP file that you loaded to your web server in Step 1. If you want to test Quickpoll from your local machine, make sure you enter the full URL to the location of the PHP file.
uniquePollName quickPoll_v1

This can be set to any name. It CANNOT contain spaces. You can leave as is OR if you are showing more than one poll, be sure to give this parameter a unique name for each poll for the following reason. This name is used to set a Flash cookie and is used by PHP to create a text file to store poll data. For example, if you set the name as "poll_1" a file named "poll_1.txt" will automatically be created in the same directory as the PHP file. To clear your poll data, simply delete this file from your server. The next time a vote is submitted, the file will be recreated and the poll will be reset to "0".

onlyOneVote true If set to "true", a user is only allowed to vote once. The next time they visit the poll, they will be shown the results of the poll and not allowed to vote again. Setting this parameter to "false" is useful when testing your poll. Remember to set this back to "true" when loading to your web site, if this is the desired behavior.
percentDecimalPlaces 1 Sets decimal places shown for the percentage values. For example, if set to "0" the percent would look like 20% or if set to "1" the percent would look like: 20.4%
showVoteCount true If set to "true" the number of votes will be displayed after the percentage values when the results are shown
submitButtonName Vote Now! Sets the text displayed in the submit button
defaultAnswer true Determines if the first answer should initially be selected. If set to false, no answer will be selected. Default is true
answerSpacing 4 Sets the space between answers. Default is 2
submitOffsetX 2 sets the X position of the submit button . Default is 0
submitOffsetY 2 sets the Y position of the submit button. Default is 0
baseColor #000000 Sets the base color for the visual elements. To set text color, see below.
rollOverColor #FF0000 Sets the color that displays when radial and submit buttons are rolled over
answerColor #333333 Text color for the answer choices
questionColor #333333 Text color for the question
resultColor #333333 Text color for the results percentage nuumber
resultNumColor #333333 Text color for the results of the total votes
buttonColor #333333 Text color for the text on the submit button
selectionColor #333333 Color of the circle or "check mark" which displays when a choice is clicked on.
answerBold #333333 Indicates if the answer text should display as bold
questionBold #333333 Indicates if the question text should display as bold
resultBold #333333 Indicates if the resiults total text should display as bold
resultNumBold #333333 Indicates if the results percentage text should display as bold
buttonBold #333333 Indicates if the submit button text should display as bold
answerFontFamily Arial Sets the font face to display for the answer text
questionFontFamily Arial Sets the font face to display for the question text
resultFontFamily Arial Sets the font face to display for the result total text
resultNumFontFamily Arial Sets the font face to display for the result percentage text
buttonFontFamily Arial Sets the font face to display for the submit button text
answerFontSize 12 Sets the font size for the answer text
questionFontSize 12 Sets the font size for the question text
resultFontSize 11 Sets the font size for the result total text
resultNumFontSize 11 Sets the font size for the result percentage text
buttonFontSize 12 Sets the font size for the submit button text
VoteCountText votes

This is the text displayed after the "total votes" number on the results screen. For example, (20 votes). If you left this parameter blank, it would be displayed as (20)

     

 



Disclaimer and Privacy Policy