as3 は次のとおりです。
import flash.events.MouseEvent;
import flash.net.URLLoader;
import flash.net.URLRequest;
import flash.net.URLVariables;
import flash.net.URLLoaderDataFormat;
import flash.net.URLRequestMethod;
import flash.events.Event;
import flash.display.MovieClip;
wheeler.guide.visible = false;
center.addEventListener(MouseEvent.CLICK, rotateHorizontal);
Stop_mc.addEventListener(MouseEvent.CLICK, stopspin);
function rotateHorizontal(e:MouseEvent):void
{
stage.addEventListener(Event.ENTER_FRAME,spinner);
}
var mcbtn:MovieClip;
var prizes:Array = new Array(0,180,0,40,30,0,80,75,0,10,0,25,120,0);
var prizewon:int;
for (var i:int=0; i<14; ++i)
{
mcbtn = wheeler["btn" + (i + 1)];
if (! mcbtn || ! prizes[i])
{
continue;
}
mcbtn.txt.text = "Earn " + String(prizes[i]) + " messages";
}
function spinner(e:Event)
{
wheeler.rotationZ += 15;
pointer_txt.text = " ";
if (wheeler.rotationZ > 360)
{
wheeler.rotationZ = wheeler.rotationZ - 360;
}
//trace(wheeler.rotationZ);
}
function completed(event:Event):void
{
if (event.target.data.success == "true")
{
trace("Completed");
}
}
function stopspin(e:Event):void
{
var txt:String;
stage.removeEventListener(Event.ENTER_FRAME,spinner);
prizewon = -1;
prizewon = (14 - Math.floor(wheeler.rotationZ / (360 / 14)));
if (prizes[prizewon - 1])
{
txt = "You have earned " + prizes[prizewon - 1] + " Messages";
}
else
{
txt = "You have earned no Messages";
}
pointer_txt.text = txt;
var phpVar:URLVariables = new URLVariables();
phpVar.code_txt = code_txt.text;
phpVar.name_txt = name_txt.text;
phpVar.phone = phone_txt.text;
phpVar.Result = pointer_txt.text;
var phpLoader:URLLoader = new URLLoader(phpFileRequest);
var phpFileRequest:URLRequest = new
URLRequest("http://localhost/spin_webapp/deposit.php");
phpFileRequest.method = URLRequestMethod.POST;
phpFileRequest.data = phpVar;
phpLoader.dataFormat = URLLoaderDataFormat.VARIABLES;
phpLoader.addEventListener(Event.COMPLETE,completed);
phpLoader.load(phpFileRequest);
}