Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Web Programming > Adobe Web Programming > Flash (all versions)
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Flash (all versions) section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old May 17th, 2006, 09:17 AM
Friend of Wrox
 
Join Date: Nov 2005
Location: Rotterdam, , Netherlands.
Posts: 223
Thanks: 0
Thanked 0 Times in 0 Posts
Default PHP Flash communicatie

Hi,

I need to get data from a database using PHP. Then I want to send this data to flash. To get this data to flash I Know that you can send the variables into the URL. Is this the only way to send data from php to flash.

Thnx

__________________________________________________ ________
This is my junk I'm gona eat it
Reply With Quote
  #2 (permalink)  
Old May 17th, 2006, 10:31 AM
Friend of Wrox
 
Join Date: Jun 2003
Location: Oklahoma City, Oklahoma, USA.
Posts: 249
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Look into using the LoadVars sendAndLoad method, here is s quick sample.

//create LoadVars Variables
var result_lv:LoadVars = new LoadVars();
var send_lv:LoadVars = new LoadVars();

//this is what you want to send to the PHP file
send_lv.YOUR_FORMFIELDNAME = "Whatever_You_Need_To_Send";

//this is where the items are returned from php file
result_lv.onLoad = function(success:Boolean) {
if (success) {
    trace(this.return_info_01);
    trace(this.return_info_02);
    trace(this.return_info_03);
}

//this sends the information to the PHP file, you can also use the GET method
send_lv.sendAndLoad("http://www.website/your_php_file.php", result_lv, "POST");


YOUR PHP FILE SHOULD RECEIVE AND RETURN THIS FORMAT

<?php
//retrieve infor from flash using POST method
$myVar = $_POST['YOUR_FORMFIELDNAME'];

//any processing code you need to do.

echo "&return_info_01=" . urlencode("send_to_flash_01") . "&return_info_02=" . urlencode("send_to_flash_02") . "&return_info_03=" . urlencode("send_to_flash_03");
?>
//warning: any extra return carriages here will be added to the end of the return string


mike
Reply With Quote
  #3 (permalink)  
Old May 18th, 2006, 04:18 AM
Friend of Wrox
 
Join Date: Nov 2005
Location: Rotterdam, , Netherlands.
Posts: 223
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thnx harpua,

Ill try your code

__________________________________________________ ________
This is my junk I'm gona eat it
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to modify flash so it pulls php url every 15 s method Flash (all versions) 4 February 27th, 2007 06:19 PM
PHP Mysql with Flash based display robprell Beginning PHP 0 November 3rd, 2005 10:06 PM
flash php mail xeno Flash (all versions) 1 July 9th, 2005 04:45 PM
flash and PHP.. somebody please help Stevie Flash (all versions) 2 May 20th, 2005 05:21 PM
PHP varibles in FLASH Ashleek007 Beginning PHP 1 November 30th, 2004 12:44 PM



All times are GMT -4. The time now is 03:33 PM.


Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.