I tried posting this in the PHP section but didn’t get a reply I was looking for… I think it has to do more with Flash than PHP anyway. But anyway I have this voting project I’ve been working on where the user chooses 6 of 12 options and then hits a submit button and the info in theory would send to a PHP file and then onto a database. I’m not making the PHP though, just the flash part of the project, and the guy who is working on the PHP is saying that he isn’t receiving the info even though I thought I was pretty much done with it on my end. Here’s my actionscript:
var myLv:LoadVars = new LoadVars();
var resultArray:Array = ["empty"];
var totalPressed:Number = 0;
stop();
for (i=1;i<13;i++) {
this["box"+i].id = i;
this["box"+i].onRelease = function() {
judgeAmount(this,this.id);
};
resultArray.push(0);
};
function judgeAmount(box:MovieClip,idNo:Number):Void {
if (box._currentframe == 2) {
totalPressed--;
resultArray[idNo] = 0;
this["box"+idNo].voting = 0;
box.gotoAndStop(1);
}
else {
if (totalPressed < 6) {
box.gotoAndStop(2);
resultArray[idNo] = 1;
this["box"+idNo].voting = 1;
totalPressed++;
}
};
if (totalPressed == 6)
{
submit._alpha = 100;
submit.enabled = true;
}
else
{
submit._alpha = 0
submit.enabled = false;
}
}
submit.onRelease = function():Void
{
sendVars();
_root.gotoAndStop(2);
}
myLv.onLoad = function():Void
{
trace("data sent");
}
function sendVars():Void
{
var len:Number = resultArray.length;
for (i=1;i<len;i++)
{
myLv["var"+i]=resultArray*;
}
myLv.sendAndLoad("myphp.php",myLv,"POST");
}
The movieclips that people click on to vote are named box1, box2 and so on. I thought it would be as easy as something like this in the PHP:
$box1 = $_POST[“box1”];
But I guess that isn’t working. If anyone could help it would be greatly appreciated, thanks!