Foros del Web » Creando para Internet » Flash y Actionscript »

cargar imagenes tamaño original

Estas en el tema de cargar imagenes tamaño original en el foro de Flash y Actionscript en Foros del Web. Hola que tal, soy nuevo en este foro y quisiera ver si me podrian ayudar con este problema que tengo. estoy cargando imagenes desde un ...
  #1 (permalink)  
Antiguo 13/01/2010, 10:24
 
Fecha de Ingreso: enero-2010
Mensajes: 1
Antigüedad: 14 años, 3 meses
Puntos: 0
cargar imagenes tamaño original

Hola que tal, soy nuevo en este foro y quisiera ver si me podrian ayudar con este problema que tengo.
estoy cargando imagenes desde un archivo xml hacia flash y tengo un scroll horizontal para ir viendo cada imagen, lo que quiero esque al momento que me muestra las imagenes estean con su ancho original porque el alto es el mismo para todas las imagenes, por ejemplo tengo imagenes de ancho de 500px de 600px, haber si me podrian ayudar con este problema que tengo
Este es mi archivo xml
<?xml version="1.0" encoding="utf-8"?>
<gallery y="5" width="950" height="400" image_width="400" vertical_spacing="10" bar_thickness="7">
<image url="images/03.jpg" />
<image url="images/04.jpg" />
<image url="images/07.jpg" />
<image url="images/08.jpg" />
<image url="images/13.jpg" />
<image url="images/19.jpg" />
<image url="images/26.jpg" />
<image url="images/41.jpg" />
<image url="images/97.jpg" />
</gallery>
cuando quito image_width="400" la imagen que es mas ancha se pone ensima de las demas, y este es mi archivo fla

import mx.transitions.easing.*;

var myGalleryXML = new XML();
myGalleryXML.ignoreWhite = true;
myGalleryXML.load("gallery.xml");

myGalleryXML.onLoad = function() {

_root.gallery_width = myGalleryXML.firstChild.attributes.width;
_root.gallery_height = myGalleryXML.firstChild.attributes.height;
_root.gallery_y = myGalleryXML.firstChild.attributes.y;

_root.spacing = myGalleryXML.firstChild.attributes.vertical_spacin g;
_root.bar_y = Number(_root.gallery_height)+Number(_root.spacing) ;
_root.bar_thickness = myGalleryXML.firstChild.attributes.bar_thickness;
_root.scroller_width = _root.bar_thickness*2;

_root.image_width = myGalleryXML.firstChild.attributes.image_width;

_root.myImages = myGalleryXML.firstChild.childNodes;
_root.myImagesTotal = _root.myImages.length;

createContainer();
callImages();
masking();
scrollbar();
scroller();

};

function createContainer() {
_root.myGallery_mc = _root.createEmptyMovieClip("myGallery_mc", _root.getNextHighestDepth());
_root.myGallery_mc._y = _root.gallery_y;
_root.myGallery_mc._x = (Stage.width-_root.gallery_width)/2;

}

function callImages() {

_root.myImages_mc = _root.myGallery_mc.createEmptyMovieClip("myImages_ mc", _root.myGallery_mc.getNextHighestDepth());

var myMCL:MovieClipLoader = new MovieClipLoader();

for (i=0; i<_root.myImagesTotal; i++) {
imageURL = _root.myImages[i].attributes.url;
image_mc = _root.myImages_mc.createEmptyMovieClip(i, _root.myImages_mc.getNextHighestDepth());
image_mc._x = _root.image_width*i;

myMCL.loadClip(imageURL,image_mc);
}

}
  #2 (permalink)  
Antiguo 13/01/2010, 12:04
Avatar de Lynxcraft  
Fecha de Ingreso: noviembre-2007
Ubicación: yecla murcia
Mensajes: 1.346
Antigüedad: 16 años, 4 meses
Puntos: 51
Respuesta: cargar imagenes tamaño original

Código PHP:
function callImages() {

    
_root.myImages_mc=_root.myGallery_mc.createEmptyMovieClip("myImages_ mc",_root.myGallery_mc.getNextHighestDepth());

    var 
myMCL:MovieClipLoader = new MovieClipLoader();
    var 
tempWidth=0;
    for (
i=0i<_root.myImagesTotali++) {
        
imageURL=_root.myImages[i].attributes.url;
        
image_mc=_root.myImages_mc.createEmptyMovieClip(i,_root.myImages_mc.getNextHighestDepth());
        
image_mc._x=tempWidth;
        
tempWidth+=image_mc._width;
        
myMCL.loadClip(imageURL,image_mc);
    }


no se si funcionara ya que no entiendo muy bien tu codigo XDXD

pero en ves de multiplicar el ancho por las cantidad de imagen mejor es sumar
__________________
Sobran las ideas cuando faltan ganas de trabajar en ellas
Lynxcraft

Etiquetas: imagenes, original, tamaño
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 12:15.