Ver Mensaje Individual
  #1 (permalink)  
Antiguo 19/05/2008, 22:12
martingb
 
Fecha de Ingreso: julio-2007
Mensajes: 15
Antigüedad: 16 años, 9 meses
Puntos: 0
Exclamación news ticker + actionscript 2.0

Hola amigos,

Tengo un problema con lo siguiente, ya que tome el codigo de prestado y veo que el sistema de orientacion de las noticias va de arriba para abajo y a mi me gustaria que vaya de abajo para arriba como normalmente se ve en todos lados. Probe varias veces cambiar variables y nada. Aca les paso el codigo:

Código:
stop(); noticias = new XML(); noticias.ignoreWhite = true; noticias.onLoad = function (){ totalxml = noticias.getBytesTotal(); cargadoxml = noticias.getBytesLoaded(); porcentajexml = Math.round((cargadoxml/totalxml)*100); if (porcentajexml >= 100) { removeMovieClip(cargando); notis_puerto = new Array(); titulo = new Array(); urls = new Array(); long = noticias.firstChild.childNodes.length; cargarCSS(); } } attachMovie("carga_xml","cargando",2); cargando._x = 45; cargando._y = 94; attachMovie("linea","linea_abajo",5000); linea_abajo._x = 0; linea_abajo._y = 400; noticias.load("noticias.xml"); /*-------------------------------------------------------------------------------*/ /*--------------------- FUNCION PARA CARGAR LA HOJA CSS --------------------*/ /*-------------------------------------------------------------------------------*/ function cargarCSS(){ estailo = new TextField.StyleSheet(); estailo.onLoad = function(){ totalcss = estailo.getBytesTotal(); cargadocss = estailo.getBytesLoaded(); porcentajecss = Math.round((cargadocss/totalcss)*100); if (porcentajecss >= 100) { removeMovieClip(cargando2); _root.createEmptyMovieClip("temp_mc", 7); temp_mc.createTextField ("notis_txt",8,-150,-20,168,16); temp_mc.notis_txt.multiline = true; temp_mc.notis_txt.wordWrap = true; temp_mc.notis_txt.html = true; for (i=0; i<long; i++){ titulo[i] = noticias.firstChild.childNodes[i].attributes.titulo; urls[i] = noticias.firstChild.childNodes[i].attributes.urls; temp_mc.notis_txt.htmlText = "<p class='tit'>"+titulo[i]+"</p><br><p class='txt'>"+noticias.firstChild.childNodes[i].firstChild+"</p>"; notis_puerto[i] = temp_mc.notis_txt.maxscroll-1; } removeMovieClip(_root["temp_mc"]); montarNoticias(); } } attachMovie("carga_css","cargando2",3); cargando2._x = 45; cargando2._y = 94; estailo.load("noticias.css"); } /*-------------------------------------------------------------------------------*/ /*--------------------- FUNCION PARA MONTAR LAS NOTICIAS -------------------*/ /*-------------------------------------------------------------------------------*/ function montarNoticias(){ par = true; for (i=0; i<long; i++){ _root.attachMovie ("caja_info","caja"+i,i*10); _root["caja"+i].colorcaja = new Color(_root["caja"+i].fondo.fondocolor); _root["caja"+i].fondo._height = 16 * notis_puerto[i]; if (par == true){ _root["caja"+i].colorcaja.setRGB(0xFFFFFF); _root["caja"+i].micolor = "0xFFFFFF"; par = false; } else{ _root["caja"+i].colorcaja.setRGB(0xFFFFFF); _root["caja"+i].micolor = "0xFFFFFF"; par = true; } if (altura == undefined){ altura = 0; } else{ altura = altura + _root["caja"+(i-1)].fondo._height; } _root["caja"+i]._x = 0; _root["caja"+i]._y = altura; _root["caja"+i].createTextField("texto_txt",i*37,2,1,168,16 * notis_puerto[i]); _root["caja"+i].texto_txt.html = true; _root["caja"+i].texto_txt.multiline = true; _root["caja"+i].texto_txt.wordWrap = true; _root["caja"+i].texto_txt.border = false; _root["caja"+i].texto_txt.selectable = false; _root["caja"+i].direc_url = urls[i]; _root["caja"+i].texto_txt.styleSheet = estailo; _root["caja"+i].texto_txt.htmlText = "<p class='tit'>"+titulo[i]+"</p><br>"; _root["caja"+i].texto_txt.htmlText += "<p class='txt'>"+noticias.firstChild.childNodes[i].firstChild+"</p>"; } attachMovie("pestana","pestanita",2000); pestanita._x = 0; pestanita._y = 0; siguiente_y = 0; y_arriba = 0; for (i=long; i>0; i--){ if (_root["caja"+i]._y > 400){ siguiente_y = siguiente_y - _root["caja"+i]._height + 1; _root["caja"+i]._y = siguiente_y; } } moverNoticias(); } /*-------------------------------------------------------------------------------*/ /*--------------------- FUNCION PARA MOVER LAS NOTICIAS --------------------*/ /*-------------------------------------------------------------------------------*/ function moverNoticias(){ if (primera_vez == undefined){ _root.onEnterFrame = function(){ for (i=0; i<long; i++){ if (_root["caja"+i]._y > 400){ y_arriba = 0; for (j=0; j<long; j++){ if (_root["caja"+j]._y < 0){ y_actual = _root["caja"+j]._y; if (y_actual < y_arriba){ y_arriba = y_actual; } } } _root["caja"+i]._y = y_arriba - _root["caja"+i]._height + 1; } _root["caja"+i]._y += 1; } } primera_vez = false; } el_fondo.onEnterFrame = function(){ for (i=0; i<long; i++){ _root["caja"+i].onPress = function(){ getURL (this.direc_url, "_blank"); } _root["caja"+i].onRollOver = function(){ this.colorcaja.setRGB(0xCDFBFE); delete _root.onEnterFrame; } _root["caja"+i].onRollOut = function(){ this.colorcaja.setRGB(this.micolor); _root.onEnterFrame = function(){ for (i=0; i<long; i++){ if (_root["caja"+i]._y > 330){ y_arriba = 0; for (j=0; j<long; j++){ if (_root["caja"+j]._y < 0){ y_actual = _root["caja"+j]._y; if (y_actual < y_arriba){ y_arriba = y_actual; } } } _root["caja"+i]._y = y_arriba - _root["caja"+i]._height + 1; } _root["caja"+i]._y += 1; } } } }