2
動作RSS我新的動作,並有一些問題:嵌入在HTML
我已經寫在CS 5.5
使用AS 3.0,當我按Ctrl + Enter是一個RSS閱讀器讀取我的RSS FEAD,
但是當我發佈在HTML中它只是stucks上的圖片(顯示在舞臺上),所以沒有任何+顯示沙箱衝突的錯誤
我已經花光了所有的一天閱讀文檔和了解這是一些與域名限制或一些這樣的事情,但仍然無法理解這樣做究竟是什麼,可以請你幫我
這是我的swf文件
russian.swf
var news_title:Array = new Array();
var news_descr:Array = new Array();
var news_pubdate:Array = new Array();
var rus = "http://news.yandex.ua/index.rss";
test (rus,txt_descr,txt_title);
function test (link,txt_descr,txt_title)
{
var rssLoad:URLLoader = new URLLoader(new URLRequest(link));
rssLoad.addEventListener(Event.COMPLETE, end_rssLoad);
function end_rssLoad(rss_data:Event)
{
var rss_file:XML = new XML(rss_data.target.data);
for each (var item:XML in rss_file.channel.item)
{
news_title.push(item.title);
news_descr.push(item.description);
news_pubdate.push(item.pubDate);
}
show_rss();
}
function show_rss()
{
//number of news in rss field
var i:Number = 0;
//number of loops before update the field
var n:Number = 0;
function assign_rss_textBox()
{
txt_title.htmlText = news_title[i];
var blank_height = txt_descr.height;
txt_descr.htmlText = news_descr[i];
txt_descr.autoSize = "center";
txt_descr.y = txt_descr.y + (blank_height - txt_descr.height)/2;
i+=1;
if (i >= news_title.length)
{
i=0;
n+=1;
if (n > 2)
{
clearInterval(delay_assign_rss_textBox);
}
}
}
assign_rss_textBox();
var delay_assign_rss_textBox = setInterval(assign_rss_textBox,500);
}
}
的代碼,這是html頁面
<html>
<body>
<object width="600" height="125">
<param name="movie" value="russian.swf">
<param name="quality" value="high">
<embed src="russian.swf" quality=high width="600" height="125" ">
</embed>
</object>
</body>
</html>