Embed PHP in Flash?

Hi,

I just bought a email + attachment script at http://www.phpscriptlab.com/phpscripts/power-contacts.html .

Everything works fine, the only problem is that it’s on a separate .php file. Is there any way I could like load the .php page or embed the code in flash ? I tried to loadmovie the .swf but it obviously didn’t work.

Thanks alot for the help !

You’ll have to send requests to the server to run your php script via http or a socket (http is easier by far). A good way for you to do this would be to use the URLLoader class in flash:

http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/flash/net/URLLoader.html

When you want to send an email, send a request to the server with URLLoader and then check the response. Have your php script indicate success/failure and then your flash app will know what happened.

Problem solved !

I didn’t use your method, but still thank you alot for your time and help.

I’ve got another problem with that script. I have to #include the action.as for the buttons to works. The only problem is that it only work the 1 time, lets say I stay on the site and return to that page it wont work.

So is there a way to like uninclude or undeclare or reload the action.as when I open that page ??

Thanks alot!
H

When you include an actionscript file in your swf, it adds it to the swf at export, just like the external file was part of the swf to begin with. Thus, you won’t have to work with two files, just one swf. If you are uploading an external as file to your webserver, your wasting your time. :beer: