GuttoSP 2 Denunciar post Postado Agosto 22, 2007 Uma tabela é criada com esse action, e a idéia era de que ao se passar o mouse em cima de alguma CÉLULA, toda a LINHA alterasse de cor, mas só a célula em questão muda de cor... var back_ground:String = '0xFFCC00'; var back_ground2:String = '0xFFEDA4'; var a:Number = 0; var b:Number = 5; var col1:Number = 75; var col2:Number = 75; var col3:Number = 75; var col4:Number = 75; var col5:Number = 75; var estilo:TextFormat = new TextFormat(); //estilo.selectable = false; estilo.font = "Verdana"; estilo.size = 10; estilo.bold = false; estilo.color = 0x000000; estilo.underline = false; while (a < b) { if (a == 0) { this.createTextField('credito_' + a,1,0,0,col1,18); this['credito_' + a].text = "CRÉDITO"; this['credito_' + a].background = true; this['credito_' + a].backgroundColor = back_ground; this['credito_' + a].setTextFormat(estilo); this.createTextField('consorcio_' + a,2,(this['credito_' + a]._x + this['credito_' + a]._width + 1),0,col2,18); this['consorcio_' + a].text = "CONSÓRCIO"; this['consorcio_' + a].background = true; this['consorcio_' + a].backgroundColor = back_ground; this['consorcio_' + a].setTextFormat(estilo); //this['consorcio_' + a].on(release) { trace('opa'); } this.createTextField('entrada_' + a,3,(this['consorcio_' + a]._x + this['consorcio_' + a]._width + 1),0,col3,18); this['entrada_' + a].text = "ENTRADA"; this['entrada_' + a].background = true; this['entrada_' + a].backgroundColor = back_ground; this['entrada_' + a].setTextFormat(estilo); this.createTextField('divida_' + a,4,(this['entrada_' + a]._x + this['entrada_' + a]._width + 1),0,col4,18); this['divida_' + a].text = "DÍVIDA"; this['divida_' + a].background = true; this['divida_' + a].backgroundColor = back_ground; this['divida_' + a].setTextFormat(estilo); this.createTextField('compre_' + a,5,(this['divida_' + a]._x + this['divida_' + a]._width + 1),0,col5,18); this['compre_' + a].text = "COMPRE"; this['compre_' + a].background = true; this['compre_' + a].backgroundColor = back_ground; this['compre_' + a].setTextFormat(estilo); } else { var mc = this.createEmptyMovieClip('mc_' +a, 1414); var credito = mc.createTextField('credito_' + a,100 + a,0,(20 * a),col1,18); credito.text = "CRÉDITO"; credito.background = true; credito.backgroundColor = back_ground2; credito.setTextFormat(estilo); this.createTextField('consorcio_' + a,200 + a,(this['credito_' + a]._x + this['credito_' + a]._width + 1),(20 * a),col2,18); this['consorcio_' + a].text = "CONSÓRCIO"; this['consorcio_' + a].background = true; this['consorcio_' + a].backgroundColor = back_ground2; this['consorcio_' + a].setTextFormat(estilo); this.createTextField('entrada_' + a,300 + a,(this['consorcio_' + a]._x + this['consorcio_' + a]._width + 1),(20 * a),col3,18); this['entrada_' + a].text = "ENTRADA"; this['entrada_' + a].background = true; this['entrada_' + a].backgroundColor = back_ground2; this['entrada_' + a].setTextFormat(estilo); this.createTextField('divida_' + a,400 + a,(this['entrada_' + a]._x + this['entrada_' + a]._width + 1),(20 * a),col4,18); this['divida_' + a].text = "DÍVIDA"; this['divida_' + a].background = true; this['divida_' + a].backgroundColor = back_ground2; this['divida_' + a].setTextFormat(estilo); this.createTextField('compre_' + a,500 + a,(this['divida_' + a]._x + this['divida_' + a]._width + 1),(20 * a),col5,18); this['compre_' + a].text = "COMPRE"; this['compre_' + a].background = true; this['compre_' + a].backgroundColor = back_ground2; this['compre_' + a].setTextFormat(estilo); mc.onRollOver = function() { credito.backgroundColor = '0xffffff'; } mc.onRollOut = function() { credito.backgroundColor = '0x00ff00'; } } a++; } Compartilhar este post Link para o post Compartilhar em outros sites
Weverton N 0 Denunciar post Postado Agosto 24, 2007 Amigo: var back_ground:String = '0xFFCC00'; var back_ground2:String = '0xFFEDA4'; var a:Number = 0; var b:Number = 5; var col1:Number = 75; var col2:Number = 75; var col3:Number = 75; var col4:Number = 75; var col5:Number = 75; var estilo:TextFormat = new TextFormat(); //estilo.selectable = false; estilo.font = "Verdana"; estilo.size = 10; estilo.bold = false; estilo.color = 0x000000; estilo.underline = false; while (a < b) { if (a == 0) { this.createTextField('credito_' + a,1,0,0,col1,18); this['credito_' + a].text = "CRÉDITO"; this['credito_' + a].background = true; this['credito_' + a].backgroundColor = back_ground; this['credito_' + a].setTextFormat(estilo); this.createTextField('consorcio_' + a,2,(this['credito_' + a]._x + this['credito_' + a]._width + 1),0,col2,18); this['consorcio_' + a].text = "CONSÓRCIO"; this['consorcio_' + a].background = true; this['consorcio_' + a].backgroundColor = back_ground; this['consorcio_' + a].setTextFormat(estilo); //this['consorcio_' + a].on(release) { trace('opa'); } this.createTextField('entrada_' + a,3,(this['consorcio_' + a]._x + this['consorcio_' + a]._width + 1),0,col3,18); this['entrada_' + a].text = "ENTRADA"; this['entrada_' + a].background = true; this['entrada_' + a].backgroundColor = back_ground; this['entrada_' + a].setTextFormat(estilo); this.createTextField('divida_' + a,4,(this['entrada_' + a]._x + this['entrada_' + a]._width + 1),0,col4,18); this['divida_' + a].text = "DÍVIDA"; this['divida_' + a].background = true; this['divida_' + a].backgroundColor = back_ground; this['divida_' + a].setTextFormat(estilo); this.createTextField('compre_' + a,5,(this['divida_' + a]._x + this['divida_' + a]._width + 1),0,col5,18); this['compre_' + a].text = "COMPRE"; this['compre_' + a].background = true; this['compre_' + a].backgroundColor = back_ground; this['compre_' + a].setTextFormat(estilo); } else { var mc = this.createEmptyMovieClip('mc_' +a, 1414); mc.A=a; var credito = mc.createTextField('credito_' + a,100 + a,0,(20 * a),col1,18); credito.text = "CRÉDITO " + a; credito.background = true; credito.backgroundColor = back_ground2; credito.setTextFormat(estilo); this.createTextField('consorcio_' + a,200 + a,(this['credito_' + a]._x + this['credito_' + a]._width + 1),(20 * a),col2,18); this['consorcio_' + a].text = "CONSÓRCIO " + a; this['consorcio_' + a].background = true; this['consorcio_' + a].backgroundColor = back_ground2; this['consorcio_' + a].setTextFormat(estilo); this.createTextField('entrada_' + a,300 + a,(this['consorcio_' + a]._x + this['consorcio_' + a]._width + 1),(20 * a),col3,18); this['entrada_' + a].text = "ENTRADA " + a; this['entrada_' + a].background = true; this['entrada_' + a].backgroundColor = back_ground2; this['entrada_' + a].setTextFormat(estilo); this.createTextField('divida_' + a,400 + a,(this['entrada_' + a]._x + this['entrada_' + a]._width + 1),(20 * a),col4,18); this['divida_' + a].text = "DÍVIDA " + a; this['divida_' + a].background = true; this['divida_' + a].backgroundColor = back_ground2; this['divida_' + a].setTextFormat(estilo); this.createTextField('compre_' + a,500 + a,(this['divida_' + a]._x + this['divida_' + a]._width + 1),(20 * a),col5,18); this['compre_' + a].text = "COMPRE " + a; this['compre_' + a].background = true; this['compre_' + a].backgroundColor = back_ground2; this['compre_' + a].setTextFormat(estilo); mc.onRollOver = function() { rollOverLine(this.A) } mc.onRollOut = function() { rollOutLine(this.A) } } a++; } function rollOverLine(A){ credito.backgroundColor = '0xffffff'; _root["consorcio_"+A].backgroundColor = '0xffffff'; _root["entrada_"+A].backgroundColor = '0xffffff'; _root["divida_"+A].backgroundColor = '0xffffff'; _root["compre_"+A].backgroundColor = '0xffffff'; } function rollOutLine(A){ credito.backgroundColor = '0xFFEDA4'; _root["consorcio_"+A].backgroundColor = '0xFFEDA4'; _root["entrada_"+A].backgroundColor = '0xFFEDA4'; _root["divida_"+A].backgroundColor = '0xFFEDA4'; _root["compre_"+A].backgroundColor = '0xFFEDA4'; } Compartilhar este post Link para o post Compartilhar em outros sites
GuttoSP 2 Denunciar post Postado Agosto 24, 2007 Realmente agora muda a cor da linha, antes era só da célula. Mas só muda a cor da última linha, e não de qualquer linha que passar o mouse Compartilhar este post Link para o post Compartilhar em outros sites