Solved

Simple Variable Pass

Posted on 2008-06-26
5
190 Views
Last Modified: 2010-04-21
I have a PHP page (1) within an iFrame.    A click on page 1 loads the iFrame with another PHP page (2) with an SWF contact form.    I need to pass a variable (from 1) using the GET method (or a different method)  to the SWF on page 2.         The variable needs to load into the SWF and change a dynamic text field to its value when the SWF loads.
0
Comment
Question by:homemadebyx
  • 3
  • 2
5 Comments
 
LVL 25

Expert Comment

by:Marcus Bointon
ID: 21883637
Well you need to submit the value to page 2 from a form or link on page 1, which is a simple proposition. On page 2, your swf will be loaded by a PHP script, and it should embed the param that the swf wants within the swf's <object> tag (a 'flashvars' attribute IIRC). So page 2's PHP will have something vaguely like:

<object type="application/x-flash" src="movie.swf">
<param name="flashvars" value="<?php echo $varpassedfrompage1; ?>" />
</object>

I don't remember the exact syntax for flash embedding, but it should not be too dissimilar to this.
0
 
LVL 3

Author Comment

by:homemadebyx
ID: 21887271
thanks Squinky for the hint, but it didn't work.   After further research i found a working solution here,

http://www.experts-exchange.com/Software/Photos_Graphics/Web_Graphics/Macromedia_Flash/Q_22460578.html?sfQueryTermInfo=1+flashvar+get

Thanks for the assistance,

x
0
 
LVL 25

Accepted Solution

by:
Marcus Bointon earned 250 total points
ID: 21887561
What do you mean it didn't work? That answer does exactly what I suggested, embedding the submitted value into a flashvars param tag.
0
 
LVL 25

Expert Comment

by:Marcus Bointon
ID: 21887579
Ah, I just spotted that EE trashed the content that I included in my original post. Thanks EE, great job...
0
 
LVL 3

Author Closing Comment

by:homemadebyx
ID: 31471553
Squinky,

I'm sure you must be right.   It does appear very simular.   I don't know what EE might have done with your solution, but i'd like to make sure credit goes where credit is due.   I really appreciate your help.      

On a side note, i don't know how comfortable you are with actionscript, but i'm struggling to find help on another question,

http://www.experts-exchange.com/Software/Photos_Graphics/Web_Graphics/Macromedia_Flash/Q_23519598.html

Thanks again,

x
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Foreword (July, 2015) Since I first wrote this article, years ago, a great many more people have begun using the internet.  They are coming online from every part of the globe, learning, reading, shopping and spending money at an ever-increasing ra…
This article discusses four methods for overlaying images in a container on a web page
The viewer will learn how to count occurrences of each item in an array.
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

856 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