PDA

View Full Version : [AS3] textInput, get rid of blue border


jewelee
03-14-2009, 04:54 AM
Hi there;
I am stumped. How do you get rid of the blue border around a textInput component? I have got rid of the regular border, but when the user clicks on the text area itself, a blue border shows up. I have been searching, but .....
Also, I would like the cursor to show up to the far left of the text area.
Any help would be greatly appreciated!
Thank you in advance.
Here is the code:


import fl.controls.TextInput;
import flash.events.Event;
import flash.events.TextEvent;
import flash.text.TextFieldAutoSize;
import flash.text.TextFormat;

var textOne:TextInput = new TextInput();
var textOneFormat:TextFormat = new TextFormat();


textOne.setStyle("textFormat", textOneFormat);

addChild(textOne);
var emptySkin:Sprite = new Sprite();
textOne.setStyle("upSkin",emptySkin);//get's rid of border don't know why
textOne.text = "Text one";

textOne.setSize(textOne.textWidth+10, textOne.textHeight+4);

textOne.textField.autoSize = TextFieldAutoSize.LEFT;
textOneFormat.size = 15;

Mazoonist
03-14-2009, 05:01 AM
See if this helps:
http://www.actionscript.org/forums/showthread.php3?t=197364

Edit: sorry for my hasty reply, I didn't realize you were dealing with the component. I'll check it out.

jewelee
03-14-2009, 05:08 AM
Thank you, I am going to try that now.

jewelee
03-14-2009, 05:16 AM
Okay, I used
textOne.focusRect = false;
But I guess I don't understand how to use the functions.
I am so new to as3 that...
I am thinking that maybe I am not including something?
Thank you

jewelee
03-14-2009, 05:17 AM
Oops, just saw your edit. I can wait!! Thank you!

jewelee
03-14-2009, 05:59 AM
Maybe to put this more into context, here is a link to what I am working on:
http://www.teratask.com/dev/gcFormal/gcNewcp
For most of it I have been piecing together tutorials, and using trial and error with the Flash Help. As you can see, I am not very good with graphics, but for now, I just want to focus on functionality. Help???

Mazoonist
03-14-2009, 07:01 AM
You already discovered that this line:
textOne.setStyle("upSkin",emptySkin);
gets rid of the blue border. This next line:
textOne.setStyle("focusRectSkin", emptySkin);
applies your emptySkin sprite to the focusRectSkin as well, which gets rid of the blue border when clicked on.

I assume you meant that you want to put the caret (flashing cursor) in the component without requiring a click by the user. I'll have to work on / research that one some more.

jewelee
03-16-2009, 06:06 AM
Thank you so much Kazoonist. I will
try your suggestions. The code:
textOne.setStyle("upSkin",emptySkin); ,
I found on a website that only had that as it's topic.
I do not understand why it works, I only knw that it does.
I wish I were better with as3 than I am, but thanks to kind people
like you, I am learning.
Thank you for the consideration and your time!