1. How can I use multiple polls on the same page?
Each poll must have an unique numerical ID, so that you can use as many polls as you want on the same page, or just one. A constraint is that you need to have the file iplist_POLLID.txt in the PHP folder, where POLLID is a number associated to that particular POLL.
Example:
If you have three polls, and their id's are 1, 2 and 3. You will need to create a text file for each: iplist_1.txt, iplist_2.txt, iplist_3.txt.
flashvars.id = "12345";
Each poll will need to have it's id code passed to it correctly in HTML as well.
2. Help! The results don't update.
First of all you need to make sure the folders xml and php have the file permissions set to 755 on the server you upload them.
Also the files content.xml and iplist_12345.txt need to have the same file permissions so they become writeable for the php script.
If this doesn't work, please try 777.
3. I need to allow multiple votes from the same computer. How do i do that?
In order to allow this, we just won't check if the IP of the voter is in the list of stored IPs.
Just comment the following line in index.html (or the html file you embedded the component):
flashvars.checkIpScriptPath = "php/checkIP.php";
*Note: This will allow voting from the same IP, but will also allow voting for the same option multiple times
XML Flash Voting Poll - tips and tricks
Introduction:
This is a fully customizable XML Flash Voting Poll, with support for unlimited questions and answers. Everything is customizable in the XML files, including the question’s height, text color, size and much more.
This XML Flash Voting Poll contains a handful of features and settings. It is easy to use the poll in your Flash projects or as an independent Flash Poll Component on your html based website.
If you want to use the poll in a Flash file, importing it is as easy as moving some actionscript files around and dragging the movieclip containing the poll in your Flash file.
Skinning is very simple as well. To edit the file you don't need any Flash experience, because all the settings are loaded from an external XML file, which you can edit with any text editor. You can change the colors of the elements, the size of the elements, the size of the poll and much more.
As an example, you can set the itemHeight from the XML file and the poll component will automatically resize depending on the number of answers.
The questions and answers are also loaded from an external XML file, so you can add unlimited answers and questions. The user can quickly change the background color of the poll, the background color of the question and of the answers.
The code is very well commented, written following the best OOP practices, and the downloaded file comes with all the assets used to create the XML Flash Voting Poll such as the fonts, the PSD source files, and the fla source file.
Features:
1. Customize the poll through the XML file.
2. Add unlimited questions and answers.
3. Customize the colors from the XML file.
4. Set the size of the questions and answers from the XML file.
5. Supports scrolling.
Folder structure:
Please navigate to the deploy folder, inside the project folder. This folder contains all the files you need to upload to your server to have the XML Flash Voting Poll work. Your server must support PHP.
poll/xml/settings.xml
XML configuration file - This is where you make all changes to the look and feel of your XML Flash Voting Poll.
poll/xml/poll.xml
Questions/Answers XML configuration file - This is where you make all changes to the poll's questions and answers.
js/swfobject.js
Deconcept SWFObject is a small JavaScript file used for embedding Adobe Flash content. The script can detect the Flash plug-in in all major web browsers (on Mac and PC) and is designed to make embedding Flash movies as easy as possible.
js/expressInstall.swf
SWFObject has full support for the Adobe Flash Player Express Install feature. Using expressinstall, your users never have to leave your site to upgrade their Flash Player.
preview.swf
This is the component swf file which is embedded in your website.
index.html
HTML document used to embed the swf file. Please check the source code to see how the variables are passed to the swf file, using any text editor such as Notepad or Textedit.
settings.xml structure:
Below you can see what each of the attributes in the XML file means:
<settings width="560"
height="420"
openVoting="true">
Here you can define the poll width, height, as well as if the voting is opened or has ended. This means you can set the poll to be active on a specified timeframe.
<background strokeColor="0xC8CACC"
fillColor="0xF3F5F5"
contentMargin="15"/>
Sets the poll background stroke color, fill color and width of the content margin.
<question backgroundHeight="50"
backgroundStrokeColor="0xffffff"
backgroundFillGradientBeginColor="0xF3A342"
backgroundFillGradientEndColor="0xEE8631"
titleColor="0xffffff"
titleFontSize="20"
votesTextColor="0x666666"
votesTextFontSize="14"
votesBackgroundFillColor="0xffffff"
votesBackgroundStrokeColor="0xEEEFEF"
votesBackgroundHeight="25"/>
Sets the the question's background height, background stroke color, background fill gradient, title color, title font size, votes text color, votes text font size, votes background color, background stroke color and votes background height.
<list distanceBetweenItems="8"
itemHeight="50"
itemStrokeColor="0xEEEFEF"
itemStrokeOverColor="0xEE8631"
itemFillColor="0xffffff"
itemTextColor="0x000000"
itemTextOverColor="0xEE8631"
itemShapeColor="0x000000"
itemShapeOverColor="0xEE8631"
itemTextFontSize="14"
itemBarHeight="8"
itemBackgroundBarColor="0xF1F2F2"
itemBarColor="0xF7941E"
itemVotesTextColor="0x666666"
itemVotesTextFontSize="14"
itemVotesBackgroundFillColor="0xF3F5F5"
itemVotesBackgroundStrokeColor="0xEEEFEF"
itemVotesBackgroundHeight="25"/>
Sets the distance between answers, the answers height, the stroke color of each item, roll over stroke color, answers fill color, answers text color, item text roll over color, answer's shape color, shape roll over color, text font size, bar height, bar background color, item's text color, item's text font size, item's background stroke color and item's background height.
<scroll backgroundWidth="16"
scrollerWidth="8"
backgroundColor="0x000000"
scrollerColor="0xffffff"/>
Sets the scroll width, background width, scroll background color and scroller's color.
<vote backgroundWidth="60"
backgroundHeight="23"
backgroundStrokeColor="0xC8CACC"
backgroundFillGradientBeginColor="0xE84B14"
backgroundFillGradientEndColor="0xF77E0B"
backgroundFillInactiveColor="0xF3F5F5"
iconColor="0xffffff"
iconInactiveColor="0xD1D3D4"
textColor="0xffffff"
textFontSize="12"
textInactiveColor="0xD1D3D4"
overTextColor="0x333333"
voteText="VOTE"/>
Sets the vote background width, vote background height, vote background stroke color, vote background gradient colors, vote background fill inactive color, icon color, icon inactive color, vote text color, vote text font size, vote text inactive color, vote text over color and the vote text.
<loader color="0xF77E0B"/>
Sets the poll loader color.
<error serverError="Sorry for inconvenience. Please try again later."
votingError="Your vote wasn't registered."
alreadyVoted="You already voted!"
votedMessage="Thank you for your vote!"
textColor="0xE84B14"
textFontSize="12"
visibilityTime="3"/>
Self-explanatory attributes. Basically you add the strings for each textfield, on particular situations.
<voting_message openVoting="Please select one option below."
closedVoting="The voting session is closed. The question was:"/>
Self-explanatory attributes. Basically you add the strings for each textfield, on particular situations.
poll.xml structure:
This xml contains the poll data. It has a node for the question:
<question>Is Flabell the best stock Flash website ?</question>
Several nodes for answers like :
<answer id="111"
votes="246">Yes.</answer>
And also two attributes answer id and votes, where it counts the total number of votes:
<answer id="112"
votes="264">Not yet, but soon will be.</answer>
Flashvars:
In the html file you can set some variables for the poll like dimensions (width and height), the path to the files if you choose to put them in another location rather than the same folder of course, and the poll data xml file.
flashvars.stageW = stageW;
flashvars.stageH = stageH;
flashvars.pathToFiles = "poll/";
flashvars.settingsPath = "xml/settings.xml";
flashvars.xmlPath = "xml/poll.xml";
Support:
If you need any help using the product, please contact us at [email protected].
AWP
on 26/3/10
I modified the xml configuration of elite website but the vote does not start.
If you want i can send you a copy of the screen ?
on 26/3/10
AWP
on 26/3/10
on 26/3/10
AWP
on 26/3/10
on 26/3/10
AWP
on 26/3/10
on 26/3/10
AWP
on 26/3/10
on 26/3/10
AWP
on 2/4/10
Could you explain me how to load your compenent with another movie ( mean's another swf ). Because I still can not run it from another swf in AS3.
Thank you
AWP
on 2/4/10
Do you have another link ?
Thank you
on 2/4/10
AWP
on 2/4/10
on 2/4/10
AWP
on 2/4/10
AWP
on 2/4/10
on 2/4/10
on 2/4/10