PDA

View Full Version : Flash variables to php


blink359
10-13-2010, 01:10 PM
Hi there,
I'm trying to pass variables from flash to php, My php is fine its just my actionscript isnt, Im very new to actionscript and do not understand much about it my actionscript code for my submit button is:

on(Release)
{
to = email_to.data; //.data is passing its data from the radio button
email = email_from.text; //.text doesnt pass data
subject = email_subject.text;
message = email_message.text;
LoadVariables("contactus.php", this, "POST");
gotoAndStop(1);

}

I have the actionscript for the variables in this format
Variablethatphpsees = instancename.text/data;
My text inputs are component text inputs and therefore do not have a var: box on the propities.

Also it does not carry out the gotoAndStop(1);

I am running Flash MX 2004 as its all the school has.

If anyone has any information or can help me rewrite my actionscript it will be much appriciated.

Thanks,

Blink359

Eralmidia
10-15-2010, 04:40 AM
Even tho it may be a bit overkill with AMF in this case, I tend to use it a lot anyway. AMF is a very efficient way to send data, especially more complex objects. It basicly builds a bridge between flash and and a db or whatever you would like to do (dispatching an email perhaps ;) ) Check out the videos about either ZendAMF of AmfPHP done by Lee Brimelow at gotoandlearn.com. They make it easy to get started :) And yes, both API's are free.

blink359
10-15-2010, 07:37 AM
I will try that, Thanks