as 与 xml

//as 代码::

var myxml:XML = new XML();
myxml.ignoreWhite = true;
myxml.onLoad = function() {
 var temp_ar = this.firstChild.childNodes;
 var container:MovieClip = _root.createEmptyMovieClip("container", 0);
 container._x = 5;
 container._y = 5;
 danru = true;
 danchu = false;
 var i = 0;
 container._alpha = 0;
 _root.onEnterFrame = function() {
  if(container._alpha>0&&danchu){
   container._alpha-=5;
   
   };
   if(container._alpha<0){
     container.loadMovie(temp_ar[i].attributes.path);
    //container._alpha=90;
    if(i==4){
     i=0;
     };
     i++;
    danru=true;
    danchu=false;
    }
   if(container._alpha<100&&danru){
    container._alpha+=5;
    }else{
     danru=false;
     danchu=true
     }
  
 };
};
myxml.load("photo.xml");


//xml 代码:


<?xml version ="1.0" standalone="yes" ?>
<photo>
    <photo path="a1.jpg" jieshao="zhenzhai"/>
    <photo path="a2.jpg" jieshao="liaozhenxin"/>
    <photo path="a3.jpg" jieshao="webcss"/>
    <photo path="a4.jpg" jieshao="webcss"/>
    <photo path="a5.jpg" jieshao="webcss"/>
</photo>

你可能感兴趣的:(xml)