[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 298
  • Last Modified:

Remove textarea border

How do I remove the border from this textarea in Flash using AS3?

I really don't know what I am doing and I am just playing around...
var myTextFormat:TextFormat = new TextFormat();
myTextFormat.color = 0xFFFFFF;
myTextFormat.size = 20;

import fl.controls.TextArea;

var feedLabel:TextArea = new TextArea();

feedLabel.move(10,2);
feedLabel.setSize(220,36);
feedLabel.text = "Larry is here!";
feedLabel.setStyle("textFormat",myTextFormat);
feedLabel.condenseWhite = true;
feedLabel.textField.opaqueBackground = 0x5398EE;

addChild(feedLabel);

Open in new window

0
beapit
Asked:
beapit
  • 3
  • 2
1 Solution
 
SemmetjuCommented:

Use TextField.border:
var myTextFormat:TextFormat = new TextFormat();
myTextFormat.color = 0xFFFFFF;
myTextFormat.size = 20;

import fl.controls.TextArea;

var feedLabel:TextArea = new TextArea();

feedLabel.move(10,2);
feedLabel.setSize(220,36);
feedLabel.text = "Larry is here!";
feedLabel.setStyle("textFormat",myTextFormat);
feedLabel.condenseWhite = true;
feedLabel.textField.opaqueBackground = 0x5398EE;
feedLabel.border = false;

addChild(feedLabel);

Open in new window

0
 
beapitAuthor Commented:
With that I get:
1119: access of possibly undefined border through a reference with static type fl.controls:textarea
0
 
SemmetjuCommented:
Ah I was mistaken you should use the TextField class instead, do mind that you will lose some functionality like the scrollbar etc.
var myTextFormat:TextFormat = new TextFormat();
myTextFormat.color = 0xFFFFFF;
myTextFormat.size = 20;

import flash.text.TextField;

var feedLabel:TextField= new TextField();

feedLabel.x = 10;
feedLabel.y = 2;
feedLabel.width = 220;
feedLabel.height = 36;
feedLabel.text = "Larry is here!";
feedLabel.defaultTextFormat = myTextFormat;
feedLabel.condenseWhite = true;
feedLabel.opaqueBackground = 0x5398EE;
feedLabel.border = false;

addChild(feedLabel);

Open in new window

0
 
SemmetjuCommented:
Or even better:

var myTextFormat:TextFormat = new TextFormat();
myTextFormat.color = 0xFFFFFF;
myTextFormat.size = 20;

import fl.controls.TextArea;

var feedLabel:TextArea = new TextArea();

feedLabel.move(10,2);
feedLabel.setSize(220,36);
feedLabel.text = "Larry is here!";
feedLabel.setStyle("textFormat",myTextFormat);
feedLabel.setStyle("focusRectSkin",Sprite);
feedLabel.setStyle("upSkin",Sprite);
feedLabel.condenseWhite = true;
feedLabel.textField.opaqueBackground = 0x5398EE;

addChild(feedLabel);

Open in new window

0
 
beapitAuthor Commented:
That did it, thanks!
0

Featured Post

Take Control of Web Hosting For Your Clients

As a web developer or IT admin, successfully managing multiple client accounts can be challenging. In this webinar we will look at the tools provided by Media Temple and Plesk to make managing your clients’ hosting easier.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now