Ask a Question related to Macromedia Flash Data Integration, Design and Development.
-
isle10 #1
displaying mysql info via php in flash
I have a movie sample that I downloaded because I dupoicated the same movie how
I wanted it to look. However when I was done it didn't work. To check if it
was me, I downloaded the exact sample and changed the database info, then
uploaded the page and it still didn't work. I made a move that will get some
variables from a php page, which tapped into a database for the info, and
display the data in a text field. The data doesn't display. Here is the flash
page:
isle10.com/unit.html.
Here is the same php page:
isle10.com/test.php.
Can anyone help me?
Code for php:
<?php
mysql_connect("dbname","dbuname","pwd");
mysql_select_db("whatdb");
$qr = mysql_query("SELECT * FROM unit");
$nrows = mysql_num_rows($qr);
for ($i=0; $i < $nrows; $i++) {
$row = mysql_fetch_array($qr);
echo $row['lastName'].", ".$row['firstName']."<br>";
echo " ".$row['phone']." ".$row['email']."<Br>";
echo " ".$row['picFile'].":
".$row['caption']."<Br><Br>";
}
?>
Now, here is the tutorial site which is here on macromedia:
[url]http://www.macromedia.com/devnet/mx/flash/articles/flashmx_php.html[/url]
action script code:
function showjpg(paramString) {
// get the individual parameters:
// params[0] = picture file name
// params[1] = caption
var params = paramString.split("#");
picHolder.loadMovie(params[0]);
caption.text = unescape(params[1]);
}
function showContent() {
var i;
content.htmlText = "";
for (i=0; i < this.n; i++) {
if (this["picFile"+i] != "") {
content.htmlText += "<b>" + this["firstName"+i] + " " + this["lastName"+i]
+ "</b>" + "<a href='asfunction:showjpg," + this["picFile"+i] + "#" +
escape(this["caption"+i]) + "'> (<font
color='#0000cc'>pic</font>)</a><br>";
} else {
content.htmlText += "<b>" + this["firstName"+i] + " " + this["lastName"+i]
+ "</b><br>";
}
content.htmlText += " " + this["phone"+i] + "<br>";
content.htmlText += " <a href='mailto:" + this["email"+i] + "'>"
+ this["email"+i] + "</a><br><br>";
}
}
// Create new load vars object c for data transfer
var c = new LoadVars();
c.onLoad = showContent;
// define content and actions for each tab
for (var i=65; i<=67; i++) {
this["tab"+chr(i)].letter.text = chr(i);
// when this tab is clicked
this["tab"+chr(i)].onRelease = function() {
// can't use chr(i) here -- must use mc name
c.thisLetter = this._name.substr(3,1);
bigLetter.text = c.thisLetter;
content.htmlText = "Loading data for " + c.thisLetter;
// scope of this function is main timeline so can refer to c directly
c.sendAndLoad("power.php",c,"POST");
}
}
stop();
The php page works just fine without flash, but the flash will not display it.
Can anyone point me in the right direction. I'm using Flash MX. Thanks.
Josh.
isle10 Guest
-
Help with a popup window displaying info from a recordset
Hi I am working on a Shopping cart web site I have set up my database and I have created my page to display items from the database. The fields in... -
Sending form info to mysql
Could anyone advise me of a suitable tutorial to send information, via a form, to mysqldatase. Ideally, im looking for a tut that also encompasses... -
Displaying Images from the Mysql Database
Hi! everyone, i need help with displaying the images from the database. I successfully inserted an image to mysql database by converting it to... -
displaying info from database that was entered in aprevious page
HI All. im using DWMX vbScript + Access i have just made a very simle user registeration form - basic name, add, payment deatails etc using text... -
Displaying images from a MySQL Database
Hi I'm have difficulty displaying images that are stored in a MySQL database. I've tried using the odbc.net provider, the ByteFX provider and the... -
JamesDad #2
Re: displaying mysql info via php in flash
// When you use this syntax to invoke the onLoad function:
c.onLoad = showContent;
// You'll need to use this syntax to define the function:
showContent = function() {
// function body
}
JamesDad Guest
-
isle10 #3
Re: displaying mysql info via php in flash
I already created a function for that:
function showContent() {
var i;
content.htmlText = "";
for (i=0; i < this.n; i++) {
if (this["picFile"+i] != "") {
content.htmlText += "<b>" + this["firstName"+i] + " " + this["lastName"+i]
+ "</b>" + "<a href='asfunction:showjpg," + this["picFile"+i] + "#" +
escape(this["caption"+i]) + "'> (<font
color='#0000cc'>pic</font>)</a><br>";
} else {
content.htmlText += "<b>" + this["firstName"+i] + " " + this["lastName"+i]
+ "</b><br>";
}
content.htmlText += " " + this["phone"+i] + "<br>";
content.htmlText += " <a href='mailto:" + this["email"+i] + "'>"
+ this["email"+i] + "</a><br><br>";
}
}
I also tried the one you showed, still didn't work.
isle10 Guest



Reply With Quote

