Banner

Sponsor

Login


Welcome Back!
Guest
Guest

Register

Lost your password?

62 users online



Flash not loading

Flash not loading

Currently viewing this thread: 1 (0 members and 1 guests)


james182

james182

Neverside Newbie
Status: Offline!

Flash not loading

ok my PHP page gets the data from MYSQL and displays it as XML.

Problem is that flash wont display it.

Flash Code:

Code:

projlistXml = new XML();
projlistXml.ignoreWhite = true;
projlistXml.onLoad = function() {
var _l1 = this.firstChild;
var _l3;
var _l2;
var listTotal;
var listNew;
listTotal = _l1.childNodes[0].attributes.count;
for (i=0; i<listTotal; i++) {
_l3 = _l1.childNodes[0].childNodes[i].childNodes;
_l2 = _l1.childNodes[0].childNodes[i].attributes.id;
weblist.attachMovie("listMC", "w"+i, i);
myItem = weblist["w"+i];
myItem._y = i*16;
myItem.itemName.htmlText = _l3;
myItem.clickID = _l2;
}
// end of for
listTotal = _l1.childNodes[1].attributes.count;
for (i=0; i<listTotal; i++) {
_l3 = _l1.childNodes[1].childNodes[i].childNodes;
_l2 = _l1.childNodes[1].childNodes[i].attributes.id;
printlist.attachMovie("listMC", "p"+i, i);
myItem = printlist["p"+i];
myItem._y = i*16;
myItem.itemName.htmlText = _l3;
myItem.clickID = _l2;
}
// end of for
listTotal = _l1.childNodes[2].attributes.count;
for (i=0; i<listTotal; i++) {
_l3 = _l1.childNodes[2].childNodes[i].childNodes;
_l2 = _l1.childNodes[2].childNodes[i].attributes.id;
motionlist.attachMovie("listMC", "m"+i, i);
myItem = motionlist["m"+i];
myItem._y = i*16;
myItem.itemName.htmlText = _l3;
myItem.clickID = _l2;
}
};
projlistXml.load("../portfolio.php");

PHP Code: (works 100%)
This is how PHP displays XML:

<?xml version="1.0" encoding="ISO-8859-1" ?>
<content>
<websites count="3">
<project id="3">HOLDEN</project>
<project id="2">HAWK</project>
<project id="1">EXPRESS</project>
</websites>
<print count="3">
<project id="4">PRINTEX</project>
<project id="8">ONLINE PRINT</project>
<project id="6">WHIRLWIND PRINT</project>
</print>
<motion count="2">
<project id="7">MOTION CITY</project>
<project id="5">FOX INTERACTIVE</project>
</motion>
</content>

PHP:

<?php 

header
("Content-type: text/xml"); 

$host "localhost"
$user ""
$pass ""
$database "flashdb"

mysql_connect($host$user$pass) or die("Could not connect to host."); 
mysql_select_db($database) or die("Could not find database."); 

$xml_output "<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?>\n"
$xml_output .= "<content>\n"

    
//website
    
$query "SELECT * FROM portfolio WHERE category='website' ORDER BY date DESC"
    
$result mysql_query($query) or die("Data not found."); 
    
$count mysql_num_rows($result);
    
    
$xml_output .= "\t<websites count='$count'>\n";
    
for(
$x $x mysql_num_rows($result) ; $x++){ 
    
$row mysql_fetch_assoc($result); 
       
$xml_output .= "\t\t<project id=\"".$row['id']."\">"$row['company'] ."</project>\n";
    }
    
$xml_output .= "\t</websites>\n"
    
    
//print
    
$query "SELECT * FROM portfolio WHERE category='print' ORDER BY date DESC"
    
$result mysql_query($query) or die("Data not found."); 
    
$count mysql_num_rows($result);
    
    
$xml_output .= "\t<print count='$count'>\n";
    
for(
$x $x mysql_num_rows($result) ; $x++){ 
    
$row mysql_fetch_assoc($result); 
       
$xml_output .= "\t\t<project id=\"".$row['id']."\">"$row['company'] ."</project>\n";
    }
    
$xml_output .= "\t</print>\n";
    
    
//motion
    
$query "SELECT * FROM portfolio WHERE category='motion' ORDER BY date DESC"
    
$result mysql_query($query) or die("Data not found.");
    
$count mysql_num_rows($result);
    
    
$xml_output .= "\t<motion count='$count'>\n";
    
for(
$x $x mysql_num_rows($result) ; $x++){ 
    
$row mysql_fetch_assoc($result);
    
    
$xml_output .= "\t\t<project id=\"".$row['id']."\">"$row['company'] ."</project>\n";
    }
    
$xml_output .= "\t</motion>\n";
$xml_output .= "</content>"

echo 
$xml_output
?>

Last edited by james182, July 21st, 2005 12:52 AM (Edited 1 times)

devonair

devonair

Neverside Newbie
Status: Offline!

have you tried tracing all the variables in your onLoad function? Do the movie clips get attached? Just trying to figure out if it's just a simple path problem to your text field or a more serious problem of the xml not being read correctly (may be the ISO encoding)..

___________________

obod | weapons of mass dysfunction

james182

james182

Neverside Newbie
Status: Offline!

here is the flash file for you to get a better under standing..

Attachments:

worklow.fla 626.5 Kb, 77 views

devonair

devonair

Neverside Newbie
Status: Offline!

has this script been decompiled??

___________________

obod | weapons of mass dysfunction

james182

james182

Neverside Newbie
Status: Offline!

only the script.
The file works fine if you have the portfolio.php with xml data in it, not php generated xml.
do you know why im have problems with it??

devonair

devonair

Neverside Newbie
Status: Offline!
Originally posted by james182:

only the script.

Still - that is copyrighted intellectual material.. I guess the best thing I can say is, at least is ain't mine - although that would make it easier to help..

___________________

obod | weapons of mass dysfunction

james182

james182

Neverside Newbie
Status: Offline!

Why did you ask if it was decompiled??? The correct answer is NO i comment part of my scripts sometimes, the reason i said "only the script" was to see the response i would get. Decompling is not illegal they are more for educational purposes if you want to know how they did that then have a look and learn from it.

So is anyone willing to help me..????

Quick Jump:

Main Navigation


Site & Graphic Design by Aeon Tan
Developed by Jeremie Pelletier & Scott Roach


NeverAPI generated this page in 0.0103 seconds.