简体   繁体   中英

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.

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. Keep in mind that the flash app is OFF SITE and will be written in 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. You can pass data along as GET, ie:

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. But if the flash file is hosted on another server, then you might run into trouble. You need to create a cross-domain policy file to fix this problem.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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