简体   繁体   English

您如何通过异地Flash应用程序拨打服务器电话?

[英]How do you make calls to the server from off-site flash app?

In short I'm developing a 'widget' in flash that I would like to implement paypal into but I'm not sure how I could do server checks from the flash file. 简而言之,我正在开发要在其中实现贝宝的Flash中的“小部件”,但不确定如何从Flash文件中进行服务器检查。

What I want to do is when a user clicks a button I want to send form data from the flash file to a php script then send data back to the flash file. 我想做的是,当用户单击一个按钮时,我想将表单数据从Flash文件发送到php脚本,然后再将数据发送回Flash文件。 Keep in mind that the flash app is OFF SITE and will be written in AS3. 请记住,该Flash应用位于OFF站点,将以AS3编写。

I'm having a hard time finding any good material on this subject so I figured I would ask. 我很难找到与此主题有关的任何材料,所以我想问一下。

Thanks 谢谢

You can use URLLoader to load text from a server side script. 您可以使用URLLoader从服务器端脚本加载文本。 You can pass data along as GET, ie: 您可以将数据作为GET传递,即:

http://www.example.com/paypal.php?user=12345&pay=34.56 http://www.example.com/paypal.php?user=12345&pay=34.56

. By off site, do you mean it will be used by other pages, or that it will be hosted on the other pages' server? 通过异地,您是说它会被其他页面使用,还是托管在其他页面的服务器上? The first does not pose a problem if the flash file is hosted on the same domain as the serverside script. 如果Flash文件与服务器端脚本位于同一域中,则第一个不会造成问题。 But if the flash file is hosted on another server, then you might run into trouble. 但是,如果Flash文件托管在另一台服务器上,则可能会遇到麻烦。 You need to create a cross-domain policy file to fix this problem. 您需要创建一个跨域策略文件来解决此问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM