Comunidad de diseño web y desarrollo en internet online

CARGAR HTML EN UN TEXTO DINAMICO MEDIANTE UN BOTON EN FLASH

Citar            
MensajeEscrito el 05 Feb 2009 05:05 am
HOLA :D , SOY NUEVO EN EL FORO Y HACE YA UN TIEMPO ANDO BUSCANDO SOLUCION A UNA NECESIDAD QUE TENGO PARA PODER MEJORAR EL ASPECTO DE UNA PAGINA WEB
MI CONSULTA PUNTUALMENTE ES LA SIGUIENTE:
TENGO 3 ARCHIVOS HTML (UNO SE LLAMA inicio.html Y LOS OTROS 2 ej01.html Y ej02.html), 2 BOTONES Y UN CUADRO DE TEXTO DINAMICO
LO QUE HAGO AL PRINCIPIO, ES CARGAR EL ARCHIVO inicio.html EN EL TEXTO DINAMICO PERO LO QUE NECESITO HACER ES QUE, AL PRECIONAR EL BOTON1 ME CARGUE EN EL TEXTO DINAMICO, EL CONTENIDO DE ej01.html.... LO MISMO CON EL BOTON2..

EL CODIGO QUE TENGO ES EL SIGUIENTE:
EL CUADRO DE TEXTO ESTA DEFINIDO CON EL NOMBRE text_txt
AL INICIAR EL SWF, CARGO LAS VARIABLES EN EL FOTOGRAMA 1

var myStyle:TextField.StyleSheet = new TextField.StyleSheet();
myStyle.load("sample.css");
text_txt.styleSheet = myStyle;

text_txt.multiline= true;
text_txt.wordWrap = true;
text_txt.html = true;

var story:XML = new XML();
story.ignoreWhite = true;
story.load("inicio.html");
story.onLoad = function () {
text_txt.htmlText = story;
}


AHORA NECESITO QUE ME DEN UNA MANO EN COMO DEBO HACER PARA QUE EL BOTON1 LLAME A ej01.html Y LO CARGUE DENTRO DEL TEXTO DINAMICO...
DESDE YA AGRADEZCO TODA SUGERENCIA QUE ME AYUDE A SOLUCIONAR ESTA NECESIDAD. EN CASO DE HABER ALGUNA SOLUCION MAS PRACTICA, LE AGRADEZCO A TODO AQUEL QUE ME GUIE, YA QUE POR AHORA SON SOLO 2 BOTONES, PERO EN UN FUTURO PIENSO IR AGREGANDOLE MAS...
UN ABRAZO A TODOS LOS DE LA COMUNIDAD CRISTALAB :)

Por elvalu1984

1 de clabLevel



 

firefox
Citar            
MensajeEscrito el 05 Feb 2009 06:28 am
bueno, primero que nada no escribas todo en mayusculas, es como si gritaras. segundo, agrega las siguientes lineas:

Código ActionScript :

boton_mc1.onRelease = function( Void ):Void
{
    story.load("ej01.html");
}
boton_mc2.onRelease = function( Void ):Void
{
    story.load("ej02.html");
}


Puedes ver los patrones entre ese codigo "boton_mc1" "ej01.html", con eso en un futuro podras hacer un for this["boton_mc"+i], Suerte.

Por LongeVie

Claber

1741 de clabLevel

1 tutorial

Genero:Masculino  

En un lugar, re moto.

firefox
Citar            
MensajeEscrito el 05 Feb 2009 03:06 pm
hola, las disculpas por escribir en mayusculas, como dije soy nuevo y no conozco bien las reglas que rigen en el foro....
con respecto al codigo que me pasaste, las puse dentro del fotograma 1, no me tira ningun error pero tampoco hace nada., luego lo puse dentro del boton (boton_mc1 como vos lo llamaste) y tampoco hace nada...
Por favor, si podes y no es molestia, explicame un poquito mas detallado o probalo vos y luego pase tu codigo final.
Desde ya muchas gracias por la buena predisposicion.. Un abrazo!!! :wink:

Por elvalu1984

1 de clabLevel



 

firefox
Citar            
MensajeEscrito el 05 Feb 2009 07:50 pm
hola, mmm, esto funciona:

Código ActionScript :

text_txt.multiline= true;
text_txt.wordWrap = true;
text_txt.html = true;

var story:XML = new XML();
story.ignoreWhite = true;
story.load("inicio.html");
story.onLoad = function () {
     text_txt.htmlText = this;
}
boton_mc1.onRelease = function( Void ):Void 
{ 
    story.load("ej01.html"); 
} 
boton_mc2.onRelease = function( Void ):Void 
{ 
    story.load("ej02.html"); 
}


Estas seguro que el problema no es con tus htmls?

Por LongeVie

Claber

1741 de clabLevel

1 tutorial

Genero:Masculino  

En un lugar, re moto.

firefox

 

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