Solved

can i pass variable from flash to php?

Posted on 2007-12-07
4
885 Views
Last Modified: 2008-03-26
I have a swf file, that contains 4 buttons, each of them call a seperate but almost similar php file. I'd rather just call one php file, is it possible to do this without passing a variable through the address bar?
0
Comment
Question by:markmchugh
4 Comments
 
LVL 9

Accepted Solution

by:
sognoct earned 250 total points
ID: 20426347
0
 
LVL 37

Assisted Solution

by:CyanBlue
CyanBlue earned 250 total points
ID: 20427532
You basically need to use LoadVars() object to make a call to the PHP script...  If you do that with sendAndLoad() function, a new browser will not open and pass data between Flash and PHP...

A simple sample would be something like this...

CyanBlue
someButton_mc.onPress = function ()
{
   var _lv:LoadVars = new LoadVars();
   _lv.onLoad = function (ok:String)
   {
      if (ok)
      {
         trace("Data send & loaded...");
         trace(this);
      }
      else
      {
         trace("Problem accessing data...");
      }
   }
   _lv.sendAndLoad("file.php", _lv, "POST");
}

Open in new window

0
 
LVL 16

Expert Comment

by:CWS (haripriya)
ID: 21188589
No comment has been added to this question in more than 21 days, so it is now classified as abandoned.

I will leave the following recommendation for this question in the Cleanup topic area:
   Split: sognoct {http:#20426347} & CyanBlue {http:#20427532}

Any objections should be posted here in the next 4 days. After that time, the question will be closed.

cyberwebservice
Experts Exchange Cleanup Volunteer
0
 
LVL 1

Expert Comment

by:Computer101
ID: 21216926
Forced accept.

Computer101
EE Admin
0

Featured Post

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Author Note: Since this E-E article was originally written, years ago, formal testing has come into common use in the world of PHP.  PHPUnit (http://en.wikipedia.org/wiki/PHPUnit) and similar technologies have enjoyed wide adoption, making it possib…
Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
The goal of the tutorial is to teach the user how to how to load their YouTube profile onto Flash Media Live Encoder.

776 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question