Comunidad de diseño web y desarrollo en internet online

Mantener estado activo de botones swf en html

Citar            
MensajeEscrito el 21 Sep 2009 06:16 am
He aquí el problema: tengo una pagina creada en html con una plantilla y sus respectivas secciones. Así mismo tengo tambien creado una botonera en flash con movie clips.( con estados rollover, rollout y activo y q funciona perfectamente en flash) insertado en mi plantilla... el problema es q cuando llamo a cada sección con cada uno de los botones de mi swf no me respeta el estado "activo" y la botonera se vuleve a cargar. Lo q deseo es q al estar en cada seccion el boton correspondiente se quede presionado.

He leido q unas opciones es utilizar frames pero dicen q existe el problema de la barra y eso honestamente me desanima. en fin..gracias por la pronta respuesta.


aquí les dejo el link de como se ve el problema:
[url=http://www.bkn-studio.com/botonera][/url]

aqui les dejo el codigo de mis botones de flash:

Código ActionScript :

inicio.onRollOver = function() {
   this.gotoAndStop("sobre");
};

inicio.onRollOut = function() {
   this.gotoAndStop("fuera");
};

inicio.onRelease = function() {
   nosotros.enabled = true;
   nosotros.gotoAndStop("fuera");
   this.gotoAndStop("activo");
   this.enabled = false;
   valores.enabled = true;
   valores.gotoAndStop("fuera");
   this.gotoAndStop("activo");
   this.enabled = false;
   productos.enabled = true;
   productos.gotoAndStop("fuera");
   this.gotoAndStop("activo");
   this.enabled = false;
   clientes.enabled = true;
   clientes.gotoAndStop("fuera");
   this.gotoAndStop("activo");
   this.enabled = false;
   beneficio.enabled = true;
   beneficio.gotoAndStop("fuera");
   this.gotoAndStop("activo");
   this.enabled = false;
   contacto.enabled = true;
   contacto.gotoAndStop("fuera");
   this.gotoAndStop("activo");
   this.enabled = false;
   
   getURL("index.html", "_self")
};



//

nosotros.onRollOver = function() {
   this.gotoAndStop("sobre");
};

nosotros.onRollOut = function() {
   this.gotoAndStop("fuera");
};

nosotros.onRelease = function() {
   inicio.enabled = true;
   inicio.gotoAndStop("fuera");
   this.gotoAndStop("activo");
   this.enabled = false;
   valores.enabled = true;
   valores.gotoAndStop("fuera");
   this.gotoAndStop("activo");
   this.enabled = false;
   productos.enabled = true;
   productos.gotoAndStop("fuera");
   this.gotoAndStop("activo");
   this.enabled = false;
   clientes.enabled = true;
   clientes.gotoAndStop("fuera");
   this.gotoAndStop("activo");
   this.enabled = false;
   beneficio.enabled = true;
   beneficio.gotoAndStop("fuera");
   this.gotoAndStop("activo");
   this.enabled = false;
   contacto.enabled = true;
   contacto.gotoAndStop("fuera");
   this.gotoAndStop("activo");
   this.enabled = false;
   
   getURL("nosotros.html", "_self")
};


//
valores.onRollOver = function() {
   this.gotoAndStop("sobre");
};

valores.onRollOut = function() {
   this.gotoAndStop("fuera");
};

valores.onRelease = function() {
   inicio.enabled = true;
   inicio.gotoAndStop("fuera");
   this.gotoAndStop("activo");
   this.enabled = false;
   nosotros.enabled = true;
   nosotros.gotoAndStop("fuera");
   this.gotoAndStop("activo");
   this.enabled = false;
   productos.enabled = true;
   productos.gotoAndStop("fuera");
   this.gotoAndStop("activo");
   this.enabled = false;
   clientes.enabled = true;
   clientes.gotoAndStop("fuera");
   this.gotoAndStop("activo");
   this.enabled = false;
   beneficio.enabled = true;
   beneficio.gotoAndStop("fuera");
   this.gotoAndStop("activo");
   this.enabled = false;
   contacto.enabled = true;
   contacto.gotoAndStop("fuera");
   this.gotoAndStop("activo");
   this.enabled = false;
   
   getURL("valores.html", "_self")
};


//
productos.onRollOver = function() {
   this.gotoAndStop("sobre");
};

productos.onRollOut = function() {
   this.gotoAndStop("fuera");
};

productos.onRelease = function() {
   nosotros.enabled = true;
   nosotros.gotoAndStop("fuera");
   this.gotoAndStop("activo");
   this.enabled = false;
   valores.enabled = true;
   valores.gotoAndStop("fuera");
   this.gotoAndStop("activo");
   this.enabled = false;
   inicio.enabled = true;
   inicio.gotoAndStop("fuera");
   this.gotoAndStop("activo");
   this.enabled = false;
   clientes.enabled = true;
   clientes.gotoAndStop("fuera");
   this.gotoAndStop("activo");
   this.enabled = false;
   beneficio.enabled = true;
   beneficio.gotoAndStop("fuera");
   this.gotoAndStop("activo");
   this.enabled = false;
   contacto.enabled = true;
   contacto.gotoAndStop("fuera");
   this.gotoAndStop("activo");
   this.enabled = false;
   
   getURL("productos.html", "_self")
};


//
clientes.onRollOver = function() {
   this.gotoAndStop("sobre");
};

clientes.onRollOut = function() {
   this.gotoAndStop("fuera");
};

clientes.onRelease = function() {
   nosotros.enabled = true;
   nosotros.gotoAndStop("fuera");
   this.gotoAndStop("activo");
   this.enabled = false;
   valores.enabled = true;
   valores.gotoAndStop("fuera");
   this.gotoAndStop("activo");
   this.enabled = false;
   productos.enabled = true;
   productos.gotoAndStop("fuera");
   this.gotoAndStop("activo");
   this.enabled = false;
   inicio.enabled = true;
   inicio.gotoAndStop("fuera");
   this.gotoAndStop("activo");
   this.enabled = false;
   beneficio.enabled = true;
   beneficio.gotoAndStop("fuera");
   this.gotoAndStop("activo");
   this.enabled = false;
   contacto.enabled = true;
   contacto.gotoAndStop("fuera");
   this.gotoAndStop("activo");
   this.enabled = false;
 
   getURL("clientes.html", "_self")
};


//
beneficio.onRollOver = function() {
   this.gotoAndStop("sobre");
};

beneficio.onRollOut = function() {
   this.gotoAndStop("fuera");
};

beneficio.onRelease = function() {
   nosotros.enabled = true;
   nosotros.gotoAndStop("fuera");
   this.gotoAndStop("activo");
   this.enabled = false;
   valores.enabled = true;
   valores.gotoAndStop("fuera");
   this.gotoAndStop("activo");
   this.enabled = false;
   productos.enabled = true;
   productos.gotoAndStop("fuera");
   this.gotoAndStop("activo");
   this.enabled = false;
   clientes.enabled = true;
   clientes.gotoAndStop("fuera");
   this.gotoAndStop("activo");
   this.enabled = false;
   inicio.enabled = true;
   inicio.gotoAndStop("fuera");
   this.gotoAndStop("activo");
   this.enabled = false;
   contacto.enabled = true;
   contacto.gotoAndStop("fuera");
   this.gotoAndStop("activo");
   this.enabled = false;
   
   getURL("beneficio.html", "_self")
};



//
contacto.onRollOver = function() {
   this.gotoAndStop("sobre");
};

contacto.onRollOut = function() {
   this.gotoAndStop("fuera");
};

contacto.onRelease = function() {
   nosotros.enabled = true;
   nosotros.gotoAndStop("fuera");
   this.gotoAndStop("activo");
   this.enabled = false;
   valores.enabled = true;
   valores.gotoAndStop("fuera");
   this.gotoAndStop("activo");
   this.enabled = false;
   productos.enabled = true;
   productos.gotoAndStop("fuera");
   this.gotoAndStop("activo");
   this.enabled = false;
   clientes.enabled = true;
   clientes.gotoAndStop("fuera");
   this.gotoAndStop("activo");
   this.enabled = false;
   beneficio.enabled = true;
   beneficio.gotoAndStop("fuera");
   this.gotoAndStop("activo");
   this.enabled = false;
   inicio.enabled = true;
   inicio.gotoAndStop("fuera");
   this.gotoAndStop("activo");
   this.enabled = false;
   
   getURL("contacto.html", "_self")
};

Por Pachino

9 de clabLevel



 

firefox
Citar            
MensajeEscrito el 21 Sep 2009 08:47 pm
Hummm, te maleaste poniendo todo tu AS, bastaba con un boton como ejemplo, en fin, la posible solucion implica editar tanto el código HTML como tu AS, aqui te va:

En el HTML de cada página ponle lo siguiente dentro de la etiqeuta que llama a tu SWF:

Código HTML :

<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0' width='740' height='160'> 
<param name='movie' value='media/botonera.swf?activo=pagina_activa_actualmente'> 
<param name='quality' value='high'> 
<embed src='media/botonera.swf?activo=pagina_activa_actualmente' quality='high' pluginspage='http://www.macromedia.com/go/getflashplayer' type='application/x-shockwave-flash' width='740' height='160'></embed> 
</object>

Notese que en la parte donde dice [i]param name="movie"[i] al final de la direccion añadimos una variable llamada "activo" y le dimos el valor "pagina_activa_actualmente" igualmente añadimos este par de "variable=valor" al final del parametro SRC de la etiqueta EMBED, esta variable puede ser elida por tu SWL de la siguiente manera.

En tu SWF al final de todo tu código pon:

Código ActionScript :

$activo = _root.activo;
if ($activo=='nosotros'){
  nosotros.gotoAndStop("activo");
} else if ($activo=='lo_que_sea') {
  lo_que_sea.gotoAndStop("activo");
}


Pruebalo y de ahi nos cuentas como te fue.

Por NeoCesar

Claber

1415 de clabLevel

14 tutoriales

Genero:Masculino  

Algun lugar dentro de la Matrix (Lima - Perú)

msie8

 

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