Usamos cookies para medir audiência e melhorar sua experiência. Você pode aceitar ou recusar a qualquer momento. Veja sobre o iMasters.
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!!!
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...
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){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'));
}
}
}
}
}
Olha achei que não dava pra fazer...
Mas depois de bater uma pergunta no google... veio a resposta O_O
http://ericlin2.tripod.com/select/selectt.html
http://hosted.zeh.com.br/mctween/
http://groups.google.com/group/macromedia.flash.actionscript/browse_thread/thread/0d9cf0080c0b5bb0
http://actionscriptexamples.com/2008/12/23/getting-the-currently-selected-color-as-a-hexadecimal-value-on-a-colorpicker-control-in-flash-using-actionscript-30/
E veja que são todos exemplos diferentes ;)
Abraços