Ver Mensaje Individual
  #1 (permalink)  
Antiguo 21/02/2006, 16:48
vibet
 
Fecha de Ingreso: noviembre-2004
Mensajes: 6
Antigüedad: 19 años, 5 meses
Puntos: 0
Imagenes en tamaño real desde xml

Alguien sabe que propiedad tango que modificar para que al cargar una imagen desde xml me la carge a su tamaño real y no al 50%, uso este código y no doy con ello
Muchas gracias

//FUNCION PARA COMPROBAR SI EL XML HA SIDO CARGADO//
function loadXML(loaded) {
if (loaded) {
//archivo xml cargado
xmlNode = this.firstChild;
image = [];
tit = [];
coment = [];
total = xmlNode.childNodes.length;
for (i=0; i<total; i++) {
image[i] = xmlNode.childNodes[i].childNodes[0].firstChild.nodeValue;
tit[i] = xmlNode.childNodes[i].childNodes[1].firstChild.nodeValue;
coment[i] = xmlNode.childNodes[i].childNodes[2].firstChild.nodeValue;
}
firstImage();
} else {
//archivo xml no cargado
content = "Fichero XML no cargado!";
}
}
//************************************************//
//PRINCIPAL//
xmlData = new XML(); //Nuevo objeto XML
xmlData.ignoreWhite = true; //Ignorar espacios en blanco
xmlData.onLoad = loadXML; //LLamamos a loadXML()
xmlData.load("imagessactual.xml"); //cargamos XML
//*************************************************//
//FUNCION PARA NAVEGAR CON TECLADO//
listen = new Object();
listen.onKeyDown = function() {
if (Key.getCode() == Key.LEFT) {
prevImage();
} else if (Key.getCode() == Key.RIGHT) {
nextImage();
}
};
//************************************************//
//NAVEGACION POR BOTONES//
Key.addListener(listen);
previous_btn.onRelease = function() {
prevImage();
};
next_btn.onRelease = function() {
nextImage();
};
//************************************************//
//PRECARGA DE IMAGENES//
p = 0;
this.onEnterFrame = function() {
filesize = picture.getBytesTotal();
loaded = picture.getBytesLoaded();
preloader._visible = true;
if (loaded != filesize) {
preloader.preload_bar._xscale = 100*loaded/filesize;
} else {
preloader._visible = false;
if (picture._alpha<100) {
picture._alpha += 10;
}
}
};
//**************************************************
//FUNCION AVANZAR IMAGEN//
function nextImage() {
if (p<(total-1)) {
p++;
if (loaded == filesize) {
picture._alpha = 0;
picture.loadMovie(image[p], 1);
tit_txt.text = tit[p];
desc_txt.text = coment[p];
picture_num();
}
}
}
//************************************************//
//FUNCION IMAGEN ANTERIOR//
function prevImage() {
if (p>0) {
p--;
picture._alpha = 0;
picture.loadMovie(image[p], 1);
tit_txt.text = tit[p];
desc_txt.text = coment[p]
picture_num();
}
}
//*************************************************//
//FUNCION QUE CARGA LA PRIMERA IMAGEN//
function firstImage() {
if (loaded == filesize) {
picture._alpha = 0;
picture.loadMovie(image[0], 1);
tit_txt.text = tit[0];
desc_txt.text = coment[0];
picture_num();
}
}
//************************************************//
//FUNCION QUE CONTROLA NUMERACION DE IMAGENES//
function picture_num() {
current_pos = p+1;
pos_txt.text = current_pos+" / "+total;
}
//*************************************************//
//FUNCION PARA DIRECCIONAR A IMAGEN//
descripcion = function()
{
getURL(image[p], "_blank");
}
//*************************************************//
ref_btn.onRelease = descripcion