How To: Communicate between Flash AS3 and PHP

Communicate between Flash AS3 and PHP

All the files you need are in a free download on DevelopPHP. PHP has to be on a server. It will not run on a local machine. Type your name. There are two variables which show up in the dialog boxes (which are stacked.) You can change the user name. It sets up a URL request and a URL loader and sends some URL variables and are placed into the value of names and pairs. They get posted to the PHP file. Place the URL reference location of where the PHP files are on your server in the line that says, "now URL request." The two variables that you get back from PHP are on lines 27-31. Put the local variables in Flash on lines 27-28. Then, send them out in the two text fields. The script will only run if the request is sent from flash. When everything is ok, put the user name into a local variable in PHP and print variable one, its variable and an ampersand. Add variable two to the string going to Flash. Send them back to Flash. This can be used to create a login, contact or registration form.

It’s Black Friday week on WonderHowTo! Don’t miss out on all of the big sales in the Gadget Hacks and Null Byte shops. And if you’ve been wanting to take some classes without going into debt, check out our best deals on online courses for a variety of skill sets. Don’t miss out on these huge discounts:

See Gadget Hacks’s top 10 BF sales on online courses (up to 99% off) >

See Null Byte’s top 13 BF sales on online courses (up to 99% off) >

Our Best Phone Hacks

Gadget Hacks' tips — delivered daily.

Be the First to Comment

Share Your Thoughts

  • Hot
  • Latest