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].
Olik Valera
on 3/4/10
I have a support ticket.
I installed and configure your flash poll. What amazing product you have created!
Now, it's works perfectly on almost all major browser: safari, opera, firefox, chrome. It's works even on Explorer 6 and 7 but for a odd reason i cant' figure out why it doesn't works at all in Explorer 8. The page stop loading and give me a javascript alert: 'J.Parent node' null.
What i shall do?
Thanx by the way my website is eleccionesparaguay2013.com
Olik Valera
on 4/4/10
Please check the html code and add this
"if(swfmacmousewheel)"
in front of
"swfmacmousewheel.registerObject(attributes.id);".
That should solve the problem.
Happy Easter!!!
on 4/4/10
The code you suggest was already there. I've changed the swfobject.js version 2.1 by a 1.5 version and now it's works well on explorer 8 but it never finish to load on version 7.
The flash poll is on my main site again. You can check the source code if you want in order to detect what's wrong with microsoft internet explorer.
www.eleccionesparaguay2013.com
Thanx!
AWP
on 6/4/10
I made some changes to source code "sample.as", and now it works very well.
See below for the modified source :
package { /* * FLASH IMPORTS */ import com.vuzum.poll.Poll; import flash.display.DisplayObject; import flash.display.Stage; import flash.display.StageScaleMode; import flash.display.StageAlign; import flash.display.MovieClip; import flash.events.Event; /* * OTHER IMPORTS */ import caurina.transitions.*; import caurina.transitions.properties.*; /* * MY IMPORTS */ import com.vuzum.utils.*; /** * THE MAIN CLASS */ public class Sample extends MovieClip { /** * COMPONENT INSIDE */ public var mcPoll : Poll; /** * COMPONENT'S VARS */ public var componentWidth : Number; public var componentHeight : Number; // public var pollId : Number = 0; // private var pathToFiles : String = "swf/votePoll/poll/"; // private var xmlPath : String = "xml/settings.xml"; private var xmlContentPath : String = "xml/content.xml"; // public var checkIpScriptPath : String = "php/checkIP.php"; public var voteScriptPath : String = "php/vote.php"; /** * CONSTRUCTOR */ public function Sample() { // Stage settings /*stage.scaleMode = StageScaleMode.NO_SCALE; stage.align = StageAlign.TOP_LEFT; stage.showDefaultContextMenu = false; */ // init and start the component addEventListener(Event.ADDED_TO_STAGE, init); } /** * INITIALIZE THE APPLICATION */ private function init(e = null) : void { removeEventListener(Event.ADDED_TO_STAGE, init); // READ FLASHVARS // component dimensions componentWidth = Prototypes.readNumberVar(600); componentHeight = Prototypes.readNumberVar(408); // read the poll id pollId = Prototypes.readNumberVar(stage.loaderInfo.parameters.id, pollId); // path to files pathToFiles = Prototypes.readPathTo(stage.loaderInfo.parameters.pathToFiles, pathToFiles); // settings xml path xmlPath = Prototypes.readStringVar(stage.loaderInfo.parameters.xmlPath, xmlPath); // content xml path xmlContentPath = Prototypes.readStringVar(stage.loaderInfo.parameters.xmlContentPath, xmlContentPath); xmlPath = Prototypes.readStringVar(stage.loaderInfo.parameters.xmlPath, xmlPath); // read the path to the php scripts checkIpScriptPath = Prototypes.readStringVar(stage.loaderInfo.parameters.checkIpScriptPath, checkIpScriptPath); voteScriptPath = Prototypes.readStringVar(stage.loaderInfo.parameters.voteScriptPath, voteScriptPath); // SAMPLE INIT OF THE COMPONENT mcPoll.init(componentWidth, componentHeight, pollId, pathToFiles, xmlPath, xmlContentPath, checkIpScriptPath, voteScriptPath); } } // FROM CLASS } // FROM PACKAGEAWP
diegobec
on 16/4/10
i have a little problem, I need to allow multiple votes from the same computer, how i do that?, how can I edit the PHP code to make available this option?
thanks!
on 19/4/10
creartdc
on 11/5/10
on 11/5/10
creartdc
on 12/5/10
on 12/5/10
Bob Hunter
on 21/5/10
How do you start it and reset the votes ?
Thank you in advance for your help !
on 21/5/10
To reset the votes, you need to edit the XML file. For setting the voting period complete, you also need to edit the XML file.
<voting_session openVoting = "true" openVotingMessage = "Please select one option below." closedVotingMessage = "The voting session is closed now." questionResultMessage = "Thank you for your vote!" />on 21/5/10
on 21/5/10
rdagnolo
on 8/6/10
i'm trying to use the poll with a windows hosting, but the votes aren't registered and i just get the server error message. what i have to do? thanks!
on 9/6/10
Please note that in order to receive support from our Development Team you need a Support Ticket:
http://www.flabell.com/buySupportTicke...
venteens
on 2/7/10
I got a questiong regarding the voting poll configuration....
How to set up the poll to reset all IP addresses every 10 hours... ?
It means that every IP address could have the chance to vote once again after 10 hours later.
Thanks in advance
Best regards^^
Josh.
on 5/7/10
You will need to setup a cron job on your server that will call a php script to delete the IP's of the users that voted 10 hours ago.
Obs. The current script doesn't save the time when the user voted, only his IP.
on 6/7/10
...You said "...You will need to setup a cron job on your server that will call a php script to delete the IP's of the users that voted 10 hours ago..."
Do you mean that "vote.php" needs to be set up as Command to run in my cron job?...or Do I need another type of php script for to do that???
Thanks in advance.
Josh.
on 11/7/10
You will need to edit the vote.php file to save the time when the vote has been submited, and create a new script that is called by with Cron Job to delete the data after 10 hours.
ghost77
on 4/7/10
I have one question to ask:
I'm trying to load the preview.swf in my site.swf, using
var myLoader:Loader = new Loader(); addChild(myLoader); var url:URLRequest = new URLRequest("preview.swf"); myLoader.load(url);
But i have this error :
TypeError: Error #1009
Can you help me please ?
on 5/7/10
Can you send me the full error report?
on 5/7/10
TypeError: Error #1009: Cannot access a property or method of a null object reference.
Thanks for the help
on 5/7/10
enakoeln
on 6/7/10
One question: how can I make the poll not show the results by clicking "vote" but just restart the voting or go to another flashframe?
Thank you very much!
on 11/7/10
To add the functions you require you will need to edit the AS3 code. From the files you downloaded open project/source/com/vuzum/poll/Vote.as.
On line 294 you have mcPoll.showResults();. Replace this line of code with a new action, after vote is registered.