以文本方式查看主题

-  中文XML论坛 - 专业的XML技术讨论区  (http://bbs.xml.org.cn/index.asp)
--  『 XML源码及示例(仅原创和转载) 』  (http://bbs.xml.org.cn/list.asp?boardid=32)
----  flash+xml怎么转化成中文?  (http://bbs.xml.org.cn/dispbbs.asp?boardid=32&rootid=&id=69958)


--  作者:小美女
--  发布时间:11/30/2008 5:20:00 PM

--  flash+xml怎么转化成中文?
flash中的代码如下:
function opennews () {
 newslist = new XML ();
 newslist.load ("xmlNews.xml");
 newslist.ignoreWhite = true;
 var item_spacing = 140;
 var item_cont = 1;
 NewsUp.bt._visible = false;
 NewsUp.back._alpha = 20;
 alphaValUp = 20;
 NewsDown.bt._visible = false;
 NewsDown.back._alpha = 20;
 alphaValDown = 20;
 loadingNews._alpha = 100;
 newslist.onLoad = function (success) {
  if (success) {
   if (this.getBytesLoaded () == this.getBytesTotal ()) {
    ZigoEngine.doTween (loadingNews,'_alpha',0,1,"easeOutExpo");
    var news:XMLNode = this.firstChild;
    numberOfItems = news.childNodes.length;
    ZigoEngine.doTween (NewsDown.back,'_alpha',100,1,"easeOutExpo",0,function () {
    alphaValDown = 100;
    NewsDown.bt._visible = true;
    });
    for (i = 0; i < numberOfItems; i++) {
     var itemDate = news.childNodes[i].childNodes[0].childNodes[0].nodeValue;
     var itemTitle = news.childNodes[i].childNodes[1].childNodes[0].nodeValue;
     var itemTopic = news.childNodes[i].childNodes[2].childNodes[0].nodeValue;
     var itemDescription = news.childNodes[i].childNodes[3].childNodes[0].nodeValue;
     var itemImage = news.childNodes[i].childNodes[4].childNodes[0].nodeValue;
     var itemURL = news.childNodes[i].childNodes[5].childNodes[0].nodeValue;
     //
     var item_mc = anchorNews.attach.attachMovie ("caixaNews", "caixaNews" + item_cont, item_cont);
     item_mc._y = Math.floor ((item_cont * item_spacing) - item_spacing);
     item_cont++;
     item_mc.xDate.htmlText = itemDate;
     item_mc.xTitle.htmlText = itemTitle;
     item_mc.xDescription.htmlText = itemTopic;
     item_mc.xImage.loadMovie (itemImage);

     item_mc.bt.instance_date = itemDate;
     item_mc.bt.instance_title = itemTitle;
     item_mc.bt.instance_desc = itemDescription;
     item_mc.bt.instance_image = itemImage;
     item_mc.bt.instance_url = itemURL;

     item_mc.bt.onRelease = function () {
      ZigoEngine.doTween (background.backgroundFilter,'_alpha',70,1,"easeOutExpo");
      blackLayer._visible = true;
      bigBox._visible = true;
      ZigoEngine.doTween (bigBox,'_alpha',100,2,"easeOutExpo");
      bigBox.date.text = this.instance_date;
      bigBox.title.text = this.instance_title;
      bigBox.desc.htmlText = this.instance_desc;
      bigBox.image.loadMovie (this.instance_image);
      bigBox.scroller._visible = (bigBox.desc.maxscroll > 1);

      if (alphaValDown != 20) {
       ZigoEngine.doTween (NewsDown.back,'_alpha',20,2,"easeOutExpo");
       alphaValDown = 100;
      }
      if (alphaValUp != 20) {
       ZigoEngine.doTween (NewsUp.back,'_alpha',20,2,"easeOutExpo");
       alphaValUp = 100;
      }
      if (this.instance_url == undefined) {
       bigBox.visitWebsite._visible = false;
      }
      else {
       websiteURL = this.instance_url;
       bigBox.visitWebsite._visible = true;
       bigBox.visitWebsite.bt.onRelease = function () {
        getURL (websiteURL, "_blank");
       };
      }
     };

     for (j = 4; j < numberOfItems; j++) {
      ZigoEngine.doTween (anchorNews.attach["caixaNews" + j],'_y, Blur_blurX, Blur_blurY',[Math.floor (1500), 0, 500],0,"easeOutExpo");
     }
     array = 3;
     myListenerload.onResize ();
     positions ();
    }
   }
  }
 };
}


--  作者:小美女
--  发布时间:11/30/2008 5:22:00 PM

--  
外部xml文档如下:
<?xml version="1.0" encoding="ISO-8859-1" ?>
<newsList>
 <news>
  <date><![CDATA[01-01-2010]]></date>
  <title><![CDATA[Lorem ipsum dolor sit amet]]></title>
  <topic><![CDATA[Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos hymenaeos.]]></description>
  <source>xmlNews/img1.jpg</source>
  <url>http://www.triworks.net</url>
 </news>
 
--  作者:小美女
--  发布时间:11/30/2008 5:28:00 PM

--  
我在flash里面改了:
function opennews () {
System.useCodepage = true;          这里是加上去的
newslist = new XML ();
在xml文档改成了了:
<?xml version="1.0" encoding="gb2312" ?>
或是<?xml version="1.0" encoding="UTF-8" ?>
都无法显示中文,我打上中文字就都是?????号
请问各位高手怎么解决这个问题??
或联系我QQ:532102159 注名xml  谢谢
W 3 C h i n a ( since 2003 ) 旗 下 站 点
苏ICP备05006046号《全国人大常委会关于维护互联网安全的决定》《计算机信息网络国际联网安全保护管理办法》
46.875ms