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

Ayuda diagramación líquida

Estas en el tema de Ayuda diagramación líquida en el foro de Flash y Actionscript en Foros del Web. Buenas tardes. Soy un poco (muchísimo...) novato en esto de la diagramación y llevo más de dos semanas intentándolo... ahora ya no se ni que ...
  #1 (permalink)  
Antiguo 13/08/2009, 10:26
 
Fecha de Ingreso: agosto-2009
Mensajes: 2
Antigüedad: 14 años, 8 meses
Puntos: 0
Ayuda diagramación líquida

Buenas tardes. Soy un poco (muchísimo...) novato en esto de la diagramación y llevo más de dos semanas intentándolo... ahora ya no se ni que hacer... a ver si me pueden ayudar porque... muchas grácias.

Mi problema es el siguiente (Con AS2): Quiero poner una imagen de fondo que se redimensione según tamaño del navegador y por encima de la imágen que se carguen unos swf externos alineados a la derecha, izquierda, centro, arriba o abajo y que según se cambie el tamaño del navegador estos queden siempre a la derecha, izquierda, centro....

NO HAY MANERA... estoy ya desesperado.

Lo que he hecho es lo siguiente:

En el primer fotograma tengo este código para que me redimensione según tamaño del navegador el fondo que tengo en un mc con el nombre contenidor_fons.


Stage.scaleMode = "noScale";
//-----------------------
var StageWidth:Number = 762;
var StageHeight:Number = 510;
function escalaFondo()
{
if (Stage.width > Stage.height) {
contenidor_fons._width = Stage.width;
contenidor_fons._yscale = contenidor_fons._xscale;
} else {
contenidor_fons._height = Stage.height;
contenidor_fons._xscale = contenidor_fons._yscale;
}
contenidor_fons._x = (StageWidth - contenidor_fons._width) / 2;
contenidor_fons._y = (StageHeight - contenidor_fons._height) / 2;
}
//-----------------------
Stage.addListener(this);
this.onResize = escalaFondo;
escalaFondo();
//-----------------------

En el fotograma 5 tengo este otro código para ver si consigo alinear otros mc donde yo quiera:

Stage.scaleMode = "noScale";
Stage.align = "TL";

ancho_minimo = 762;
alto_minimo = 510;

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) {
// si el valor de this.ajuste_width es un porcentaje
this._width = (_root.ancho*parseInt(this.ajuste_width))/100;
} else {
// si el valor de this.ajuste_width es un número de píxeles
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;
}
}
// ajustes de posicion de los clips
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();
}
};


Bien, el problema es que ambos POR SEPARADO funcionan, el PRIMERO REDIMENSIONA EL FONDO y EL SEGUNDO situa los mc donde le digo poniendo en el mc el seguiente código:
onClipEvent (load) {
this.setAjuste("centrar", "arriba", false, false);
}

Pero cuando estan todos en el ESCENARIO lo que hace es desplazarme el fondo y no redimensionarmelo.

Alguien me podria ayudar??

Muchas grácias.

Voy a tomar un café porqué estoy ya desesperado con este tema.

Gracias de nuevo.
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 02:11.