Hola! que tal? Queria consultarles como hacer para ajustar este codigo que tengo en as2 para que las fotos (sean cargadas tanto verticales como horizontales) se ajusten al tamaño del movieclip-contenedor para las fotos.

El contenedor es de ancho:380px y alto:250px.

Es decir, lo que los clientes quieren es que las fotos se comporten como hace facebook. Vieron que uno lo unico que hace es subir imagenes (sin importar si son verticales u horizontales) y Facebook te las lleva a un tamaño de alto y ancho "x"??. Bueno, eso es lo que necesitaria para esta galeria de fotos y no se como hacerlo.

me ayudarian?

Gracias!!

Código ActionScript :

function loadXML(loaded) {

if (loaded) {

xmlNode = this.firstChild; //In the first line, I set the variable xmlNode equal to this.firstChild. The reason I am doing this is that I will be using this.firstChild frequently, so assigning that chunk of text to xmlNode simplifies accessing it by mere humans.
image = [];
description = []; //In the next two lines I declare the variables image and description as   arrays. 
total = xmlNode.childNodes.length; //In this line, I set the value of the variable total equal to the total length of the number of childNodes our XML file contains. That helps Flash to keep a digital track of how many images there will be.
for (i=0; i<total; i++) {

image[i] = xmlNode.childNodes[i].childNodes[0].firstChild.nodeValue;
//description[i] = xmlNode.childNodes[i].childNodes[1].firstChild.nodeValue;

}

/*Our task is to come up with a piece of code that will cycle through each node, extract the attribute data (image and caption) from each node, move to the next node, repeat the extraction process, and stop after reaching the "final rung" of the XML ladder.

The code I used is as follows:

*/

firstImage();

} else {

content = "Lo lamentamos, no se pudo encontrar la imagen";

}

}

xmlData = new XML();//Here you assign a variable to the new XML object. The XML object in Flash contains all of the nifty XML features and properties that greatly simplify displaying and modifying XML data in your Flash animation. I am calling my XML object xmlData. 
xmlData.ignoreWhite = true; //When Flash reads an XML file, it reads all the spacing contained in the XML file also. You should almost always use this line to tell Flash to ignore the white spaces such as empty text nodes. Note that the .ignoreWhite property is a part of the xmlData object you declared in the previous line.
xmlData.onLoad = loadXML; //When you are dealing with XML data in Flash, a common mistake is to assume that the XML file is loaded almost immediately. For large XML files, or even smaller XML files over a slow connection, that is hardly the case. Therefore, it is good to create your own event handler to ensure that your XML file is loaded. 
xmlData.load("galeria-eventos.xml"); //In this line I specify the path to the XML file that I am interested in loading.
/////////////////////////////////////
listen = new Object(); ////I create a new object called listen because I want to give this object the properties of a "traditional" object such as a movie clip without actually creating a movie clip and placing it on stage.
listen.onKeyDown = function() {

if (Key.getCode() == Key.LEFT) { //When the left key is pressed, the prevImage() function is called, and when the right key is pressed, the nextImage() function is called.

prevImage();

} else if (Key.getCode() == Key.RIGHT) {

nextImage();

}

};
//The following code is used to help you cycle through the pictures by simply using your left and right arrow keys on your keyboard:
Key.addListener(listen); //This line enables the listen object to react to the onKeyDown handler when a key, in our example, is pressed.
previous_btn.onRelease = function() { //This is the event handler for the listen object. I want this code to execute only when a key is pressed

prevImage();

};
next_btn.onRelease = function() {

nextImage();

};v
/////////////////////////////////////
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;

}

}

};
function nextImage() {

if (p<(total-1)) {

p++;
if (loaded == filesize) {

picture._alpha = 0;
picture.loadMovie(image[p], 1);
desc_txt.text = description[p];
picture_num();

}

}

}
function prevImage() {

if (p>0) {

p--;
picture._alpha = 0;
picture.loadMovie(image[p], 1);
desc_txt.text = description[p];
picture_num();

}

}
function firstImage() {

if (loaded == filesize) {

picture._alpha = 0;
picture.loadMovie(image[0], 1);
desc_txt.text = description[0];
picture_num();

}

}
function picture_num() {

current_pos = p+1;
pos_txt.text = current_pos+" / "+total;

}