正如标题所说,我正在我的网页中加载一个 Flash,当我调用LoadVars()时,它会使网页崩溃。
这是我的代码:
闪光
lv = new LoadVars();
lv.onLoad = onLoadCallBack;
lv.load("php/flash_getitems.php");
function onLoadCallBack(succes){
if(succes){
t = lv[this.totalItems];
for(i = 1; i<= t; i++){
key = this.itemName + "" + i;
itemList.addItemAt(i, key);
}
}
}
stop();
php
INCLUDE 'connector.php';
$query = mysql_query("SELECT * FROM shop");
$totalrows = mysql_num_rows($query);
echo "&totalItems=$totalrows";
while($row = mysql_fetch_assoc($query)){
$id = $row['id'];
$item = $row['item'];
$desc = $row['description'];
$price = $row['price'];
echo "&itemName$id=$item";
echo "&price$id=$price";
echo "&desc$id=$desc";
}
这将返回像
&itemName1=First Item&price1=100&desc1=description
这样的值,依此类推,id 较高