?
Solved

PHP into Flash problem

Posted on 2004-11-09
9
Medium Priority
?
158 Views
Last Modified: 2010-04-03
here's the questions thread...

http://www.experts-exchange.com/Web/Web_Languages/PHP/Q_21198924.html

i will accept this question and the other thread if you can help me.

thanks
0
Comment
Question by:jmingo
  • 4
  • 3
8 Comments
 
LVL 11

Expert Comment

by:Buffon
ID: 12542046
Flash:
var vars:LoadVars = new LoadVars();
vars.onLoad = function(success)
{

}
0
 
LVL 11

Expert Comment

by:Buffon
ID: 12542311
try this:

Flash:
var myVar:String = "";
var vars:LoadVars = new LaodVars();
vars.onLoad = function(success)
{
      if (success)
      {
            myVar = this.test;
      }
}
vars.load("test.php");

PHP:
echo "&test=blabla"
0
 

Author Comment

by:jmingo
ID: 12544397
seems like i've tried everything. here is my php code. i'm getting the data out of the database. i'll try the flash code above.

<html>
<head><title>Flash Test</title></head>
<body>

<br><br>

<?php

//phpinfo();

error_reporting(E_ALL);

$user = $HTTP_GET_VARS['user'];
$subject = $HTTP_GET_VARS['subject'];

$link = mysql_connect('localhost', 'mailer', 'mailer321')
   or die('Could not connect: ' . mysql_error());

mysql_select_db('mailer') or die('Could not select database');

$query = "SELECT * FROM email where name = '$user' and subject = '$subject' order by id desc limit 1";
$result = mysql_query($query) or die('Query failed: ' . mysql_error());

while ($rows = mysql_fetch_array($result)) {

$name = $rows['name'];
$email = $rows['subject'];
$content = $rows['content'];

}

print "&name=$name";
print "&email=$email";
print "&content=$content";

mysql_free_result($result);

mysql_close($link);

?>

<div align="center">

<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="760" HEIGHT="430" id="winstorm" ALIGN=""><PARAM NAME=movie VALUE="test.swf?name=<? echo $name ?>&email=<? echo $email ?>&content=<? echo $content ?>"><PARAM NAME=quality VALUE=high><PARAM NAME=bgcolor VALUE=#EEEEEE><EMBED src="test.swf?name=<? echo $name ?>&email=<? echo $email ?>&content=<? echo $content ?>" quality=high bgcolor=#EEEEEE  WIDTH="760" HEIGHT="430" NAME="winstorm" ALIGN="" TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer"></EMBED>
</OBJECT>

</div>

</body>
</html>
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 

Author Comment

by:jmingo
ID: 12544455
tried this code you said below, and nothing different happened.

var myVar:String = "";
var vars:LoadVars = new LaodVars();
vars.onLoad = function(success)
{
     if (success)
     {
          myVar = this.test;
     }
}
vars.load("test.php");
0
 

Author Comment

by:jmingo
ID: 12544614
i tried this very simple script and it didn't work... but it worked on a friends server (that has BSD) but not my mandrake server... do i need to install some module???

<?php
//The value of $x would be printed to the screen but the SWF would not read the data
$x = "Content read from php file";

//The value of $x would be printed to the screen and because of the prefix 'myVar=', the SWF will //interpret this as being the intended value for the variable myVar in the SWF
print "content=$x";
?>
0
 
LVL 11

Expert Comment

by:Buffon
ID: 12548598
0
 

Author Comment

by:jmingo
ID: 12681612
found out what was wrong, it was looking for the php file in the root directory on my webserver.

had to change it to an absolute link in flash

thanks
0
 

Accepted Solution

by:
modulo earned 0 total points
ID: 12704299
Closed, 25 points refunded.

modulo
Community Support Moderator
Experts Exchange
0

Featured Post

Vote for the Most Valuable Expert

It’s time to recognize experts that go above and beyond with helpful solutions and engagement on site. Choose from the top experts in the Hall of Fame or on the right rail of your favorite topic page. Look for the blue “Nominate” button on their profile to vote.

Question has a verified solution.

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

I know the transition can be hard. We got used to the ease of use ActionScript 2 had, but honestly, it became problematic later on, especially if designers were involved in the project and found it easy to add code as they saw fit. So, this artic…
There are times in your Flash CS4 application when you want more than a simple pointer or a hand, and it's hard to find an ideal walk-through to tell you what to do.  I spent a few days recently learning my way around making custom cursors in Flash,…
The goal of the tutorial is to teach the user how to how to record live broadcast.
The goal of the tutorial is to teach the user what frame rate is, how to control it and what effect it has on the video.
Suggested Courses
Course of the Month16 days, 13 hours left to enroll

864 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