# Flash not reading dynamic content

**URL:** https://forum.kirupa.com/t/flash-not-reading-dynamic-content/16963
**Category:** programming
**Created:** [March 30, 2003, 9:03pm UTC](https://forum.kirupa.com/t/flash-not-reading-dynamic-content/16963 "2003-03-30T21:03:28Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![Rolf](https://avatars.discourse-cdn.com/v4/letter/r/94ad74/32.png) [@Rolf](https://forum.kirupa.com/u/Rolf)
#### Post date: [March 30, 2003, 9:03pm UTC](https://forum.kirupa.com/t/flash-not-reading-dynamic-content/16963/1 "2003-03-30T21:03:28Z")

</div>

Hi,  
I’m new to loading dynamic content, so i made a test file.  
I’ve given a dynamic textfield the variable name “msg” and converted it into a movieclip symbol. This is all there is on the stage.  
Attached to this movieclip is the following action:

_onClipEvent (load) {  
LoadVariables (“message.txt”,this);  
}_  
In the same directory where the published .swf resides i have a textfile called message.txt, and it’s contents shows up perfecty in this .swf

BUT:  
Now i want to load data from MySQL via PHP, instead of loading it from the textfile, so in the actionscript I change the .txt extension into .php (the name of the PHP-file is also “message”) This php-file resides in the same directory as the textfile, and register\_globals is on in my php.ini file. Still my .swf does not show anything! Why???  
When i check the file “message.php” in my webbrowser it perfectly retrieves the data from my (local)database, showing:  
msg=Contents+from+database. So that seems to work. But flash does’nt show anything.

This is the message.php file i’m using:  
\*\<title\>Uit No Hands/DevShed\</title\>\<?  
// message.php

// open connection to database  
$connection = mysql\_connect(“localhost”, “root”, “rolf”) or die  
(“Unable to connect!”);  
mysql\_select\_db(“rolf”) or die (“Unable to select database!”);

// formulate and execute query  
$query = “SELECT testveld FROM test”;  
$result = mysql\_query($query) or die("Error in query: " .  
mysql\_error());

// get row  
$row = mysql\_fetch\_object($result);

// print output as form-encoded data  
echo “msg=” . urlencode($row-\>testveld);

// close connection  
mysql\_close($connection);  
?\>\*

Hope someone can help!

Rolf

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [March 30, 2003, 9:17pm UTC](https://forum.kirupa.com/t/flash-not-reading-dynamic-content/16963/2 "2003-03-30T21:17:42Z")

</div>

try  
echo “&msg=” . urlencode($row-\>testveld);

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [March 30, 2003, 9:32pm UTC](https://forum.kirupa.com/t/flash-not-reading-dynamic-content/16963/3 "2003-03-30T21:32:01Z")

</div>

Thanks for your reply. I tried it, but this literaly results in :  
\*" . urlencode($row-\>testveld);

// close connection  
mysql\_close($connection);  
?\> \*

Any other suggestions?

Rolf

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [March 31, 2003, 8:18pm UTC](https://forum.kirupa.com/t/flash-not-reading-dynamic-content/16963/4 "2003-03-31T20:18:19Z")

</div>

$msg="&msg=" . urlencode($row-\>testveld);  
echo $msg;  
maybe…?

what you get with  
echo $row ?

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [April 1, 2003, 10:30am UTC](https://forum.kirupa.com/t/flash-not-reading-dynamic-content/16963/5 "2003-04-01T10:30:09Z")

</div>

echo “&msg=” . urlencode ($row-\>testveld); was the solution.

Thanx!
