ok miren primero antes k nada el fabuloso XML
Código XML :
<imagnes>
<img titulo="Thunder" ur="im0.jpg"/>
<img titulo="Futurama" ur="im1.jpg"/>
<img titulo="Bart" ur="im2.jpg"/>
<img titulo="Bart & Homero" ur="im3.jpg"/>
<img titulo="Mono" ur="im4.jpg"/>
<img titulo="Mono #2" ur="im5.jpg"/>
<img titulo="Futurama #2" ur="im6.jpg"/>
<img titulo="Stewie" ur="im7.jpg"/>
</imagnes>
despues en flash krear dos textos dinamicos y a uno ponerle en nombre de instancia t y al otro en var: des
y krear dos botones uno k es el de siguiente y otro k es el de atras ( nota ) no hagan botones ok son solo dos clips de pelicula y en nombre de isntancia pongales al k dara en la foto siguiente "nex" y al de foto atras "prev"
y aki va el fabuloso script
es para AS2.0 ok
Código ActionScript :
num=0
_root.createEmptyMovieClip("img",1)
_root.img._x=0
_root.img._y=0
xml = new XML()
xml.ignoreWhite=true
xml.onLoad=function(ok){
if (ok){
tot=xml.firstChild.childNodes.length
mostrar()
}else
trace ("error")
}
xml.load("imagenes.xml")
pre.onRelease=function(){
if (num==0){
num=tot-1
mostrar()
}else{
num--
mostrar()
}
}
nex.onRelease=function(){
if (num==tot-1){
num=0
mostrar()
}
else{
num++
mostrar()
}
}
function mostrar(){
_root.img.loadMovie (xml.firstChild.childNodes[num].attributes.ur)
des=xml.firstChild.childNodes[num].attributes.titulo
t.text=num+1 + "/" + tot
}ok espero este script sea de su ayuda cualkier duda kedo a su dispocision saludos
http://www.miltonomar.com