Solved

Using flash button to pass variables from one url to another with php and post

Posted on 2009-04-10
3
435 Views
Last Modified: 2013-11-11
I have a web page (home.php)  that is receiving parameters via POST from a calling url.  On home.php is an embedded swf file that has a "continue" button that needs to call another url with the POSTED parameters.
I am totally clueless when it comes to actionscript (or javascript for that matter), but pick my way through html and php pretty well, including form data.  
1.   What code (html or php PLEASE???) do I need to play the swf on home.php so it can pass the variables?
2.  What is the actionscript code on the button within the swf to call the url nextpage.php with the variables - I don't care if they go in the url as
               nextpage.php?name=yourname&email=whatever
or some other way where nextpage.php has to fetch them with a POST
I have it coded to use a button outside the swf file, but my boss is very unhappy about it - he wants it to work from a button within the swf - and after all, he is the boss.  
I will be eternally grateful if someone could spell this out for me, and promise to pay it forward when the opportunity arises.  Many thanks.  
home.php
<?
$name = $_POST['name'];
$email = $_POST['from'];
?>
<html>
<body>
<table >
   <tr>
      <td>
      <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" 	width="890" height="500" >
    <param name=movie value="EZHAP_test.swf" />
     <param name=quality value=high />
     <param name=bgcolor value=#8b9fa0/> 
      <embed src="EZHAP_test.swf"  quality=high bgcolor=#8b9fa0  width="890"  height="500" swLiveConnect=true id="about"  type="application/x-shockwave-flash"   pluginspage="http://www.macromedia.com/go/getflashplayer"></embed>
        </object>
     </td>		
  </tr>
<tr>
  <td>
  <table>
  <form accept-charset="UTF-8" action="nextpage..php"  method="post" >
     <tr>
       <td>
       <input type="hidden" name="name" value="<?php echo $name?>" />
       <input type="hidden" name="email" value="<?php echo $email?>" />
       <input name="submit" type="image" src="images/button_continue.jpg" >
      </td>
   </tr>
   </form>
</table>
</body>
</html>

Open in new window

0
Comment
Question by:roxanne728
[X]
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
  • 2
3 Comments
 
LVL 8

Accepted Solution

by:
wal_toor earned 500 total points
ID: 24137235
Hellow roxanne,

You will have to use flashvars to pass variables to a swf file. See the adobe documentation about this:

http://kb.adobe.com/selfservice/viewContent.do?externalId=tn_16417

If you are using ActionScript 2 you can use this actionscript on a button

on(release){
trace("do whatever with: "+_root.name);
trace("do whatever with: "+_root.email);
}

Hope this works for you.

greetz,
walter
0
 
LVL 8

Assisted Solution

by:wal_toor
wal_toor earned 500 total points
ID: 24137326
Wait... i have build a little demo for you to examine:

http://www.zoetebroodjes.nl/downloads/flashvars_php/flashvars.php

download

http://www.zoetebroodjes.nl/downloads/flashvars_php/flashvars.zip

build in CS3 and AS2

greetz,
walter
0

Featured Post

Instantly Create Instructional Tutorials

Contextual Guidance at the moment of need helps your employees adopt to new software or processes instantly. Boost knowledge retention and employee engagement step-by-step with one easy solution.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
SCCM 2012 - Deploy Flash 16 7,134
Youtube video error 30 869
How to convert image files to a movie file 6 114
adobe flash plugin has crashed while listening to pandora 2 85
This is a very simple example to help those of you who are still migrating from AS2 to AS3 understand the redesigned event model in AS3. In AS2.0, event functions (that is, the function to be performed when an event is fired) were stored as a pro…
In my long career of working as an actionscript developer, I had spent sleepless night often working hard to solve some small problems which actually took a lot of my development time; later found out the solutions to be a line or two. Here are s…
The goal of the tutorial is to teach the user how to how to record live broadcast.
This Micro Tutorial will teach to how to utilize bit rate in Adobe Flash Media Live Encoder.

737 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