Comunidad de diseño web y desarrollo en internet online

Poner TOPE a la "diagramacion liquida"

Citar            
MensajeEscrito el 13 Oct 2009 01:34 pm
Hola, estoy haciendo una web con diagramacion liquida, pero tengo un problema, y es que si la resolución de la pantalla es muy pequeña, la recolocación de los elementos, en mi caso, el mc central, se me "monta" encima del menú. Quisiera saber cómo puedo ponerle un tope a la recolocación de mi mc, de modo que cuándo llegue a la posición y=100, éste no suba más (para que no tape el menú) y salga un scroller en el navegador para poder desplazarse por la zona que no se ve.

Os adjunto una imagen para mejorar mi explicación:
(La linea roja es el tope que le quiero poner, como podéis ver ahora mismo el mc se sube encima )


El as que me coloca dicho mc es éste:

Código ActionScript :

//temp_mc es el mc principal y content_width es el ancho del mc
_root.temp_mc._x = (Stage.width/2)-(content_width/2);
_root.temp_mc._y = (Stage.height/2)-(content_height/2);


¿Alguién sabe como se podría hacer? Muchas gracias por vuestro tiempo.

Por Hapki

Claber

268 de clabLevel



 

firefox
Citar            
MensajeEscrito el 13 Oct 2009 03:44 pm
Te servira un if else

if (_root.temp_mc._y>=100)
_root.temp_mc._y = (Stage.height/2)-(content_height/2);
else
_root.temp_mc._y = 100

o asi

_root.temp_mc._y = (_root.temp_mc._y>=100) ? (Stage.height/2)-(content_height/2) : 100;

;)

Por comicSans

Claber

151 de clabLevel



 

firefox
Citar            
MensajeEscrito el 13 Oct 2009 07:47 pm
Gracias por tu pronta respuesta, pero sigue sin funcionarme, por si he fallado en algo al escribir el code q me das, te lo pego aqui tal y como lo he puesto:

Código ActionScript :

if(_root.temp_mc._y>=110){
   _root.temp_mc._x = (Stage.width/2)-(content_width/2);
   _root.temp_mc._y = (Stage.height/2)-(content_height/2);
}else{
   _root.temp_mc._y=110;
   }


Pero sigue igual, no "coge ese tope" ni scroll ni nada :S
También probé con el segundo code que me das y tampoco.

:S

Por Hapki

Claber

268 de clabLevel



 

firefox
Citar            
MensajeEscrito el 15 Oct 2009 02:38 pm
Hola, y estas usando el object Listener?

Código PHP :

// PRUEBA CONDICIONANDO LOS ELEMENTOS AL STAGE
stageListener.onResize = function()
 {
 var w:Number = Stage.width, h:Number = Stage.height;
 // Los elementos se dimensionan mientras Stage width > 640y height > 480
 if (w<640) { w = 640; }
 if (h<480) { h = 480; }
 _root.temp_mc._y = (h/2)-(content_height/2);
 // algo asi, aqui stage no sera menor a 480
}


espero te sirva, Salu2!

Por comicSans

Claber

151 de clabLevel



 

firefox
Citar            
MensajeEscrito el 16 Oct 2009 10:10 pm
Perdona no he podido contestar antes... a ver, mira yo lo tengo así, (probando como bien me dices);

Código ActionScript :

setup_position = function () {
    var w:Number = Stage.width, h:Number = Stage.height; 

    if (w<640) { w = 640; } 
    if (h<480) { h = 480; } 
    _root.temp_mc._y = (h/2)-(content_height/2)
}
Stage.addListener(re_size);
var re_size:Object = new Object();
re_size.onResize = function() {
   setup_position();
};


Y sigue sin funcionar... jo... no tiene que ser tan dificil... que torpe q estoy jolines :(

Por Hapki

Claber

268 de clabLevel



 

firefox

 

Cristalab BabyBlue v4 + V4 © 2011 Cristalab
Powered by ClabEngines v4, HTML5, love and ponies.