English 中文(简体)
紧急呼吁书 2.0XML 在某些节点而不是其他节点上工作
原标题:Flash actionscript 2.0 XML parsing works on some nodes, not others

I m从事简易车轮工作。

My problem appears when trying to insert node values as text in my tooltip sub-elements. Here s my xml:

<promotions>        
        <promotion>
            <visuel>/papyrus/8a8b8d2e26fa35b60126faf90a4d002f-20100223141718.gif</visuel>
            <remise>55</remise>

            <libelle>produit 1</libelle>
            <description>contenu test 1</description>
            <dateDebut>22/02/2010</dateDebut>
            <dateFin>10/03/2010</dateFin>
        </promotion>

        <promotion>
            <visuel>/papyrus/8a8b8d2e26fa35b60126faf9a2f30032-20100223141750.gif</visuel>

            <remise>15</remise>
            <libelle>Pneus</libelle>
            <description>Promo sur les pneus</description>
            <dateDebut>01/03/2010</dateDebut>
            <dateFin>01/05/2010</dateFin>
        </promotion>


        <promotion>
            <visuel>/papyrus/8a8b8d2e26fa35b60126fafa1fa5003a-20100223141955.gif</visuel>
            <remise>7</remise>
            <libelle>produit 1</libelle>
            <description>Test promo 1</description>
            <dateDebut>10/01/2010</dateDebut>
            <dateFin>10/03/2010</dateFin>
        </promotion>        
</promotions>

这里还有2号《航空法》,其中它主张装上装货,并插入正确的万诺维奇单和文本。

    xml.onLoad = function(success:Boolean) {
   if(success) {
        var nodes = this.firstChild.childNodes;
        numOfItems = nodes.length;
        for(var i=0;i<numOfItems;i++)
        {
            var t = home.attachMovie("item","item"+i,i+1);
            t.angle = i * ((Math.PI*2)/numOfItems);
            t.onEnterFrame = mover;
            t.icon.inner.loadMovie(nodes[i].childNodes[0].firstChild);      
            t.promo= nodes[i].childNodes[1].firstChild.nodeValue;
            t.produit= nodes[i].childNodes[2].firstChild.nodeValue;
            t.dateDebut= nodes[i].childNodes[4].firstChild.nodeValue;
            t.dateFin= nodes[i].childNodes[5].firstChild.nodeValue;
            t.icon.onRollOver = over;
            t.icon.onRollOut = out;
        }
 } else {
       trace("Unable to load XML");
   }   
}

function over()
{
    home.tooltip.promo.text = this._parent.promo;
    home.tooltip.produit.text = this._parent.produit;
    home.tooltip.tipDebut.text = this._parent.dateDebut;
    home.tooltip.tipFin.text = this._parent.dateFin;
    home.tooltip._x = this._parent._x;
    home.tooltip._y = this._parent._y + (this._parent._height*0.15);
    home.tooltip.onEnterFrame = Delegate.create(this,moveTip);
    home.tooltip._alpha = 100;
}

Results i m having show me each gif picture (wich means i m correctly pointing and loading the childnode), text contents load right ( node[libelle] and node[description]) buit nodes containing numbers or date don t load. Where am I wrong ?

最佳回答

我试图操作你的法典,为我做的是某种工作,尽管我只能猜测一下在什么阶段确定你的内容。

我注意到了一些事情:

  1. The path to each .gif file starts with a / which didn t work so well for me, but as you say, it s working for you...
  2. The item0, item1, item2 movieClips are being added in front of the tooltip clip, so perhaps the images are obscuring your text? (but this could just be the way my stage is set up.)
  3. This might be a dumb question, but have you embedded the full character set for your dynamic textfields? That might explain why letters are appearing but not numbers.

我也不知道您的<代码>mover,outmove Tip正在履行什么职能(请您也说明这些职能)。

这种希望几乎有助于......

问题回答

暂无回答




相关问题
how to represent it in dtd?

I have two element action and guid. guid is a required field when action is add. but when action is del it will not appear in file. How to represent this in dtd ?

.Net application configuration add xml-data

I need to add xml-content to my application configuration file. Is there a way to add it directly to the appSettings section or do I need to implement a configSection? Is it possible to add the xml ...

XStream serializing collections

I have a class structure that I would like to serialize with Xstream. The root class contains a collection of other objects (of varying types). I would like to only serialize part of the objects that ...

MS Word splits words in its XML format

I have a Word 2003 document saved as a XML in WordProcessingML format. It contains few placeholders which will be dynamically replaced by an appropriate content. But, the problem is that Word ...

Merging an XML file with a list of changes

I have two XML files that are generated by another application I have no control over. The first is a settings file, and the second is a list of changes that should be applied to the first. Main ...

How do I check if a node has no siblings?

I have a org.w3c.dom.Node object. I would like to see if it has any other siblings. Here s what I have tried: Node sibling = node.getNextSibling(); if(sibling == null) return true; else ...

Ordering a hash to xml: Rails

I m building an xml document from a hash. The xml attributes need to be in order. How can this be accomplished? hash.to_xml

热门标签