Hi,
Yes.
There are a number of ways and I may not cover them all here -
Google is your friend (check the links below):
Using LoadVars.sendAndLoad you can attach variables to the LoadVars
instance, POST the data and get a response back. PHP can process the
POST data as you would normally. To send a response back to Flash, you
have to echo out a query string type response:
echo "num=" .$num ."&result=" $result;
Okay for small amounts of to-and-fro from Flash to PHP...
Use XML sendAndLoad - you will need to parse this in PHP, which can
be a pain unless you have libraries to do this (pear.php.net has a good
parser and there is probably other stuff out there too). Disadvantage
is extra baggage with the XML - if you have a large amount of data and
transfers this could be an issue, but being able to use XML for anything
across the web may outweigh this.
WebServices - there are a number of tools for working with these in
Flash / Flex, I have not done much stuff beyond tutorials, but have a
look...
Flash Remoting with AMFPHP - uses AMF a binary format rather than
XML - you need to install the Flash Remoting components from adobe.
Good for structured programming and lots of client - server
interaction. If you write your PHP "services" nicely, you can use the
AMFPHP extras to generate your ActionScript.
If it's going to be anything other than posting contact forms and
loading a few bits of information, I would look at sendAndLoad. If you
are doing e-commerce, etc. look at AMFPHP or similar, other things will
be in between - blogs, you can use XML to pull the feed so the solution
is fairly clear, Currency calculations - there are webservices for this...
(I noticed that AMFPHP will also deal with XML-RPC and JSON, which I
am not too hot on - maybe someone else can explain :)
Good place to start...
www.sephiroth.it/tutorials.*php* <http://www.sephiroth.it/tutorials.php>
(http://www.google.co.uk/search?hl=en&q=flash+Loadvars+php&btnG=Search&meta=)
www.flash-db.com <http://www.flash-db.com/>
www.amfphp.org <http://amfphp.org/>
http://www.adobe.com/cfusion/search/index.cfm?loc=en_us&term=remoting+components
HTH
Glen
_______________________________________________
[email protected]
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com