How can my Vyew plugin communicate with my server?

You may want to send information, like form data, or statistics to your own server for storage in a database.

Allowing server access

First, your server must allow the flash plugin SWF to send information to it, by setting up a crossdomain.xml file on your server. Copy and past this text into a file “crossdomain.xml” at the root http docs of your server.

<allow-access-from domain=”*” secure=”false”/>
<allow-access-from domain=”” secure=”false”/>
<allow-access-from domain=”*” secure=”false”/>

Sending the data

Second, there are many ways to send data to your server, such as LoadVars(), XML(), and AMFPHP.
If you are sending a lot of data, consider using AMFPHP.
LoadVars and XML are easier to impliment for simpler data.
Here’s an example:

var data={
city:”Berkeley, CA”,

var lv=new LoadVars(data);
var result=new LoadVars(); //even if not using it, result object is required
lv.x=1; //add data vars to the LoardVars object

for(var i in data){ //or add an existing object to it

//send data to server via POST (default)

You could then access the variables in php:


More tutorials on LoadVars and XML

Sending data with LoadVars

Using LoadVars with a MySQL Database

Updated: July 6th, 2013 · Tags:

Post your comment here...

This site uses a Hackadelic PlugIn, Hackadelic SEO Table Of Contents 1.6.0.