使用Actionscript 3连接到数据库 [英] Using Actionscript 3 to connect to a database

查看:303
本文介绍了使用Actionscript 3连接到数据库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在寻找如何基于数据库在闪存中动态创建内容的建议。最初,我想我们将导出数据库到一个XML文件,并使用内置的ActionScript XML解析器来处理,但是XML文件的大小可能会被禁止。

I'm looking for advice on how to dynamically create content in flash based on a database. Initially I was thinking that we would export the database to an XML file and use the built in Actionscript XML parser to take care of that, however the size of the XML file may prove prohibitive.

我已经阅读关于使用中间步骤(PHP,ASP)来检索信息并将其传回Actioncript可以读取的内容,但我不想这样做如果可能的话。有人曾经使用过 asSQL 库吗?

I have read about using an intermediary step (PHP, ASP) to retrieve information and pass it back as something that Actionscript can read, but I would prefer not to do that if possible. Has anyone worked with the asSQL libraries before? Or is there something else that I am missing?

推荐答案

除非你在服务器端运行你的Actionscript ),直接连接到数据库根本不会很聪明。要从客户端ActionScript连接到数据库,您必须打开您的服务器以接受每个人的数据库连接,并且您必须将访问数据存储在swf文件中,这将是一个灾难性的组合,以防有人拆卸swf文件。

Unless you're running your Actionscript on the server side (I doubt that), connecting to a database directly wouldn't be very smart at all. To connect to a database from client side Actionscript you'd have to open your server to accept database connections from everyone, and you'd have to store access data in your swf files and that would be a disastrous combination in case someone disassembles the swf files.

如果XML的大小是禁止的,你总是可以分割它,或者如果不可能,你可以通过PHP从服务器获取数据,在服务器上运行的任何其他东西,例如,您将请求中的相关参数提供给PHP文件,然后服务器端脚本查询数据库,构建XML文本(这是完整数据的一个子集,基于给定参数),可以由Actionscript使用。

If the size of the XML is prohibitive, you can always split it somehow, or if it is impossible, you can get the data from the server through PHP or anything else running on the server, for example, you'd give the relevant parameters in the request to the PHP file and the server side script then queries the database, builds XML text (that is a subset of the complete data, based on the given parameters) that can be consumed by the Actionscript.

这篇关于使用Actionscript 3连接到数据库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆