Ir para conteúdo

POWERED BY:

Arquivado

Este tópico foi arquivado e está fechado para novas respostas.

Godoi

[Resolvido] Background do texto selecionado

Recommended Posts

Eai povo.. beleza?/

 

queria a ajuda de vocês pra seguinte questão..

 

tenho um texto dinamico no meu palco(com funco branco).. esse texto é selecionavel.. então quando eu seleciono a parte selecionada fica com o background preto e as letras em branco certo??

 

como eu faço pra mudar essas cores?? jah caçei em tudo que é lugar e não achei nada!

 

quem puder me dar uma luz ai.

 

Abraços!!!

Compartilhar este post


Link para o post
Compartilhar em outros sites

UUUUUoooouuuuuu....

 

vlw fii.. hehe.. tava doido com isso.. dessa vez eu realmente admito.. vacilei no google.. resolvo muita coisa lah..

 

mas vlw a ajuda!

 

Abraços...

Compartilhar este post


Link para o post
Compartilhar em outros sites

Eai berseck... beleza?/

 

tem um problema.. não entendi os 3 ultimos links.. mas o primeiro so da pra AS1...

 

eu achei um codigo que resolve o problmea.. so que ele ta setado pra quem usa Flex!! e eu to usando Flash... pode me ajudar a traduzir??

 

package funcoes {
import flash.events.FocusEvent;
 
import mx.controls.ComboBox;
import mx.controls.NumericStepper;
import mx.controls.TextArea;
import mx.controls.TextInput;
import mx.core.Application;
import mx.core.UITextField;
import mx.styles.StyleManager;
 
public class TextInputSelector {
 
/*
. 
.USAGE:
. 
.<mx:TextInput
.focusIn="TextInputSelector.tFin(event)"
.focusOut="TextInputSelector.tFou(event)"
./>
 
*/
 
//setting up some vars for customization</code>
public static var fieldHighLight:Number = 0xFFFF00;
public static var fieldTextHighLight:Number = 0x000000;
 
public static function tFin(e:FocusEvent):void{
if (e.target is UITextField){
 
if (UITextField(e.target).owner is TextInput){
TextInput( UITextField(e.target).owner ).setStyle( "backgroundColor" , Number(fieldHighLight));
TextInput(UITextField(e.target).owner ).setStyle( "color", Number(fieldTextHighLight));
}
 
if (UITextField(e.target).owner is TextArea){
TextArea(UITextField(e.target).owner ).setStyle( "backgroundColor" , Number(fieldHighLight));
TextArea(UITextField(e.target).owner ).setStyle( "color" , Number(fieldTextHighLight));
}
 
if (UITextField(e.target).owner.parent is ComboBox){
ComboBox(UITextField(e.target).owner.parent ).setStyle( "backgroundColor" , Number(fieldHighLight));
ComboBox(UITextField(e.target).owner.parent ).setStyle( "color" , Number(fieldTextHighLight));
Application.application.callLater( function(e:FocusEvent): void{ UITextField(e.target).setSelection( 0 , UITextField(e.target).length);},[e]);
}
 
if (UITextField(e.target).owner.parent is NumericStepper){
NumericStepper(UITextField(e.target).owner.parent ).setStyle( "backgroundColor" , Number(fieldHighLight));
NumericStepper(UITextField(e.target).owner.parent ).setStyle("color" , Number(fieldTextHighLight));
}
}
}

public static function tFout(e:FocusEvent):void{
 
if (e.target is UITextField){
if (UITextField(e.target).owner is TextInput){
TextInput(UITextField(e.target).owner ).setStyle( "backgroundColor", StyleManager.getStyleDeclaration('TextInput').getStyle('backgroundColor'));
TextInput(UITextField(e.target).owner ).setStyle( "color", StyleManager.getStyleDeclaration('TextInput').getStyle('color'));
}
 
if (UITextField(e.target).owner is TextArea){
TextArea(UITextField(e.target).owner ).setStyle( "backgroundColor", StyleManager.getStyleDeclaration('TextInput').getStyle('backgroundColor'));
TextArea(UITextField(e.target).owner ).setStyle( "color", StyleManager.getStyleDeclaration('TextInput').getStyle('color'));
}
 
if (UITextField(e.target).owner.parent is ComboBox){
ComboBox(UITextField(e.target).owner.parent ).setStyle( "backgroundColor" ,  StyleManager.getStyleDeclaration('TextInput').getStyle( 'backgroundColor' ));
ComboBox(UITextField(e.target).owner.parent ).setStyle( "color" ,  StyleManager.getStyleDeclaration('TextInput').getStyle('color'));
}
 
if (UITextField(e.target).owner.parent is NumericStepper){
NumericStepper(UITextField(e.target).owner.parent ).setStyle( "backgroundColor", StyleManager.getStyleDeclaration('TextInput').getStyle( 'backgroundColor' ));
NumericStepper(UITextField(e.target).owner.parent ).setStyle( "color", StyleManager.getStyleDeclaration('TextInput').getStyle('color'));
}
}
}
}
}

Compartilhar este post


Link para o post
Compartilhar em outros sites

×

Informação importante

Ao usar o fórum, você concorda com nossos Termos e condições.