Posted by: joyful Jun 3 2011, 12:41 AM
Hey!
I am pretty new to Flash (and AS)... I am trying to display data from a mySQL database in flash...
I have configured my server to pierce xml as PHP... So I have a XML file with all of the data from the database...
I would now like to display this in Flash...
As I said: I really don't know a whole lot of Flash... I am working in AS2.
I have set up a dynamic text box called: "xmlBox"... This is my XML:
CODE
<?php header('Content-type: text/xml'); ?>
<?php
$error = "Couldn't connect".mysql_error();
$connect = mysql_connect("localhost", "root", "") or die($error);
mysql_select_db("mydatabase") or die($error);
?>
<channel>
<?php
$q="SELECT id,title,body,UNIX_TIMESTAMP(pubDate) AS pubDate
FROM mytable ORDER BY pubDate DESC LIMIT 0,15";
$doGet=mysql_query($q);
while($result = mysql_fetch_array($doGet)){
?>
<item>
<title> <?=htmlentities(strip_tags($result['title'])); ?></title>
<description> <?=htmlentities(strip_tags($result['body'],'ENT_QUOTES'));?></description>
<link>http://www.mysite.com/</link>
<pubDate> <?=strftime( "%a, %d %b %Y %T %Z" , $result['pubDate']); ?></pubDate>
</item>
<?php } ?>
</channel>
This works great!
Here is my AS2:
CODE
var myXML = new XML();
myXML.ignoreWhite=true;
myXML.onLoad = function(sucess){
if(sucess){
xmlBox.text=this;
}
}
myXML.load("../blog/blog.xml");
This gives me some bazar combination of letters in the text box:
logllglogogool:oo::llollooloo::llo
I have no clue what this is... When I "trace" "this" it all shows up (all of the xml)...
What are all of those weird letters? How can I just display all of the XML? Is there a simpler way to just display all of my XML?
Thanks in advance!
--
Posted by: joyful Jun 3 2011, 07:07 PM
Anyone?
One thing I noticed:
When I select the "bazar jumbled text" like:
CODE
o:oo
and copy it, then paste it (in text edit). It says this:
CODE
<br /><b>Parse error</b>: syntax error, unexpected & a p o s;
*NOTE* I had to add those spaces after the & because otherwise it makes a: '
So, what I am seeing in my SWF, (and copying) is not actually what the text is (when I paste it)... What does that mean? What Is going on??
Please... Any help?
--
Posted by: joyful Jun 7 2011, 04:08 PM
Hey! Sorry... I am quite new to Flash...
The issue was that text was not set to "TLF"... Once I set it to that, the text worked fine...