如何从SWF中将存储在变量中的某些分数添加到SQL数据库中? - AS3

时间:2022-11-11 23:48:56

I have a game in SWF with AS3 that scores points and stores it on a variable called "Puntos". Here's how I'm doing it:

我在SWF中使用AS3进行游戏,得分并将其存储在名为“Puntos”的变量上。我是这样做的:

stop();
var puntos:int = new int();


add_puntos.addEventListener(MouseEvent.CLICK, agregar);

function agregar(event:MouseEvent):void
{
    puntos=puntos+3;
    puntos_txt.text=String(puntos);
    trace(puntos);
}

Now, i have to take the result of the variable "puntos" and add it to the absolute score of the player on a SQL Database. ¿How can i do it? :(

现在,我必须获取变量“puntos”的结果并将其添加到SQL数据库中播放器的绝对分数。我该怎么做? :(

UPDATE: Thanks Andrey. Effectively, it's not for mobile. I'm going to try it :)

更新:谢谢安德烈。实际上,它不适用于移动设备。我要试试:)

1 个解决方案

#1


1  

You need backend knowledge in order to save those scores (or if you are working on a mobile - at least SQL knowledge).

您需要后端知识才能保存这些分数(或者如果您正在使用移动设备 - 至少是SQL知识)。

The client part is easy - sending a simple POST request to the server, where all the magic happens. You can see the examples here: http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/net/URLLoader.html#includeExamplesSummary

客户端部分很简单 - 向服务器发送一个简单的POST请求,发生所有魔法。您可以在此处查看示例:http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/net/URLLoader.html#includeExamplesSummary

If you are working on a mobile - things get harder, and you would need go search Google instead :)

如果你正在使用移动设备 - 事情变得更难,你需要去搜索谷歌而不是:)

Edit: Having in mind you are using mobile device, this is for you: http://help.adobe.com/en_US/as3/dev/WS5b3ccc516d4fbf351e63e3d118676a5497-7fb4.html

编辑:请记住,您使用的是移动设备,这适合您:http://help.adobe.com/zh_CN/as3/dev/WS5b3ccc516d4fbf351e63e3d118676a5497-7fb4.html

#1


1  

You need backend knowledge in order to save those scores (or if you are working on a mobile - at least SQL knowledge).

您需要后端知识才能保存这些分数(或者如果您正在使用移动设备 - 至少是SQL知识)。

The client part is easy - sending a simple POST request to the server, where all the magic happens. You can see the examples here: http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/net/URLLoader.html#includeExamplesSummary

客户端部分很简单 - 向服务器发送一个简单的POST请求,发生所有魔法。您可以在此处查看示例:http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/net/URLLoader.html#includeExamplesSummary

If you are working on a mobile - things get harder, and you would need go search Google instead :)

如果你正在使用移动设备 - 事情变得更难,你需要去搜索谷歌而不是:)

Edit: Having in mind you are using mobile device, this is for you: http://help.adobe.com/en_US/as3/dev/WS5b3ccc516d4fbf351e63e3d118676a5497-7fb4.html

编辑:请记住,您使用的是移动设备,这适合您:http://help.adobe.com/zh_CN/as3/dev/WS5b3ccc516d4fbf351e63e3d118676a5497-7fb4.html