Ver Mensaje Individual
  #1 (permalink)  
Antiguo 19/06/2007, 08:43
Avatar de CREW
CREW
 
Fecha de Ingreso: diciembre-2004
Ubicación: Mi Casa
Mensajes: 793
Antigüedad: 19 años, 4 meses
Puntos: 0
Mantener centrado un MC dentro del Browser...

Mi problema es el siguiente:

Tengo un SWF que se ajusta al tamaño del Browser, es decir se adapta al tamaño del navegador, dentro de este SWF (tamaño 1024 x 760) tengo 2 MC

- 1 movie clip "pie_mc"
- 2 movie clip "galeria_mc"

el "pie_mc" se mantiene al pie del navegador y cuando achico la ventana este se adapta y se mantiene siempre en la misma posición.

Mi problema va en cuanto a "galeria_mc", ya que este debe de mantenerse siempre centrado, independientemente de que si achique o no el navegador, debe de quedar centrado principalmente an cuento al alto.

aqui dejo el codigo que utilizo:

Codigo 1º frame

Stage.scaleMode = "noScale";
Stage.align = "T";
ancho_minimo = 600;
alto_minimo = 400;
clips_ajustables = new Array();
myListener = new Object();
Stage.addListener(myListener);
myListener.onResize = rec;
function rec() {
alto = Stage.height;
if (alto<alto_minimo) {
alto = alto_minimo;
}
ancho = Stage.width;
if (ancho<ancho_minimo) {
ancho = ancho_minimo;
}
for (var g = 0; clips_ajustables[g]; g++) {
clips_ajustables[g].alinear();
}
}
MovieClip.prototype.setAjuste = function(ajuste_x, ajuste_y, ajuste_width, ajuste_height) {
this.ajuste_x = ajuste_x;
this.ajuste_y = ajuste_y;
this.ajuste_width = ajuste_width;
this.ajuste_height = ajuste_height;
this.x0 = this._x;
this.y0 = this._y;
this.w0 = this._width;
this.h0 = this._height;
this.ajustePersonalizado = false;
clips_ajustables.push(this);
this.alinear();
};
MovieClip.prototype.alinear = function() {
if (this.ajuste_width) {
if (this.ajuste_width.indexOf("%") != -1) {
this._width = (_root.ancho*parseInt(this.ajuste_width))/100;
} else {
this._width = this.ajuste_width;
}
}
if (this.ajuste_height) {
if (this.ajuste_height.indexOf("%") != -1) {
this._height = (_root.alto*parseInt(this.ajuste_height))/100;
} else {
this._height = this.ajuste_height;
}
}
if (this.ajuste_x == "izquierda") {
this._x = this.x0;
}
if (this.ajuste_x == "derecha") {
this._x = Math.round(this.x0+(_root.ancho-_root.ancho_minimo));
}
if (this.ajuste_x == "centrar") {
this._x = Math.round((_root.ancho-this._width)*0.5);
}
if (this.ajuste_y == "arriba") {
this._y = this.y0;
}
if (this.ajuste_y == "abajo") {
this._y = Math.round(this.y0+(_root.alto-_root.alto_minimo));
}
if (this.ajuste_y == "centrar") {
this._y = Math.round((_root.alto-this._height)*0.5);
}
if (this.ajustePersonalizado) {
this.ajustar();
}
};


Codigo 2º frame

rec();
stop();


Codigo del "pie_mc"

onClipEvent (load) {
this.piePagina_txt.autosize = "left";
this.x0 = this._x;
this.y0 = this._y;
_root.clips_ajustables.push(this);
ajustePersonalizado = true;
function ajustar() {
this._y = _root.alto-this._height+1;
}
}


Como veran al "galeria_mc" no le puesto ningun codigo, es por eso que necesito su orientación....

Saludos!!!
__________________
_________________________________
Mario Contreras || Diseñador Gráfico + Web:Mi Blog