can i pass variable from flash to php?

Posted on 2007-12-07
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?
Question by:markmchugh
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions

Accepted Solution

sognoct earned 250 total points
ID: 20426347
LVL 37

Assisted Solution

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...

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

Open in new window

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.

Experts Exchange Cleanup Volunteer

Expert Comment

ID: 21216926
Forced accept.

EE Admin

Featured Post

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

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

Things That Drive Us Nuts Have you noticed the use of the reCaptcha feature at EE and other web sites?  It wants you to read and retype something that looks like this. Insanity!  It's not EE's fault - that's just the way reCaptcha works.  But it i…
The last time I worked with Flash and Socket connections was in AS1. A recent project required flash connecting to a Socket, and sending receiving information - we figured it would be easy enough - we all know about the socket policy documents and c…
The goal of the tutorial is to teach the user how to select the video input device. Make sure you have an input device that in connected and work and recognized by Adobe Flash Media Live Encoder and select it in the “video input” menu.
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

691 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