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

QuickPoll Component Tutorial
 


Use the ThumbGallery Component to add a gallery inside your Flash files. The download comes with sample Flash files to further show how galleries can be set up. Install the Quickpoll component using the instructions that came with the download, then follow the steps below.


Step 1 - Fill out the necessary properties in the Component Inspector
In Flash, drag an instance of the QuickPoll component to the stage.
In the Flash menu, select: Window > Development Panels > Component Inspector.
(or if using Flash 8 select: Window > Component Inspector.) Below is a list of the necessary properties to fill out in the Component Inspector. For a full list of properties for customizing QuickPoll click here.

Property Description
question

Enter the question for the poll

answers

Enter the choices for your poll. To add choices, click on the "+" button.

PHPpath

This is the URL path to the PHP file that you will load to your web server in step 2. Enter the full URL to the location of the PHP file.
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 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.

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.
Publish the Flash file, then load the html, swf and xml file to your web server. Note: These files and the PHP files all 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 properties can be set in the Component Inspector in Flash.

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.
PHP path 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 display after the percentage values when the results are shown
Submit Name, Button Vote Now! Sets the text shown 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 the radial and submit buttons are rolled over.
Color-AnswerText #333333 Text color for the answer choices
Color-QuestionText #333333 Text color for the question
Color-ResultPercent #333333 Text color for the results percentage nuumber
Color-ResultTotal #333333 Text color for the results of the total votes
Color-SubmitText #333333 Text color for the text on the submit button
Color - Selection Mark #333333
Color of the circle or "check mark" which displays when a choice is clicked on.
EmbedFont-AnswerText false Indicates if the answer text should use an embedded font from the Flash library. If true, you must also set the FontFace property to the fonts linkage name.
EmbedFont-QuestionText false Indicates if the question text should use an embedded font from the Flash library. If true, you must also set the FontFace property to the fonts linkage name.
EmbedFont-ResultPercent false Indicates if the result percentage number text should use an embedded font from the Flash library. If true, you must also set the FontFace property to the fonts linkage name.
EmbedFont-ResultTotal false Indicates if the results total number should use an embedded font from the Flash library. If true, you must also set the FontFace property to the fonts linkage name.
EmbedFont-SubmitText false Indicates if the submit button text should use an embedded font from the Flash library. If true, you must also set the FontFace property to the fonts linkage name.
FontBold-AnswerText #333333 Indicates if the answer text should display as bold
FontBold-QuestionText #333333 Indicates if the question text should display as bold
FontBold-ResultTotal #333333 Indicates if the resiults total text should display as bold
FontBold-ResultPercent #333333 Indicates if the results percentage text should display as bold
FontBold-SubmitText #333333 Indicates if the submit button text should display as bold
FontFamily-AnswerText Arial Sets the font face to display for the answer text
FontFamily-QuestionText Arial Sets the font face to display for the question text
FontFamily-ResultTotal Arial Sets the font face to display for the result total text
FontFamily-ResultPercent Arial Sets the font face to display for the result percentage text
FontFamily-Submit Text Arial Sets the font face to display for the submit button text
FontSize-AnswerText 12 Sets the font size for the answer text
FontSize-QuestionText 12 Sets the font size for the question text
FontSize-ResultTotal 11 Sets the font size for the result total text
FontSize-ResultPercent 11 Sets the font size for the result percentage text
FontSize-SubmitText 12 Sets the font size for the submit button text
Vote Count Text 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)
XML Path mypoll.xml Optionl parameter. If left blank, no XML is used. If you specify an XML file, all properties in the XML file will overide the properties defined in the Component Inspector. A template XML file can be found in the Template folder that came with the download.
     

 



Disclaimer and Privacy Policy