Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

how to set the BACKGROUND transparency of a textfield.

Enthusiast ,
Jun 08, 2008 Jun 08, 2008
i have a actionscript 3.0 class TextArea which extends Sprite.
it includes a TextField within it.

in my site, i have used this object over an image.
now my requirement is that i need to make the background of textarea semi-transparent so that text could be read easily, and image is visible a bit.
setting the alpha property makes text transparent too.

pls somebody help me.
TOPICS
ActionScript
1.4K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Enthusiast , Jun 10, 2008 Jun 10, 2008
i made it with help of one of my collegue:

var mybg:Sprite = new Sprite();
mybg.graphics.beginFill(clr, 0.7);
mybg.graphics.drawRect(textArea.x-56,textArea.y-60,textArea.width+10,-(textArea.height+10));
mybg.graphics.endFill();
addChildAt(mybg,0);//add at the most back position.

//where textArea is the textfield object.
Translate
Community Expert ,
Jun 08, 2008 Jun 08, 2008
you have to fake it. add a sprite behind your textfield and assign its color/alpha to suit your needs.
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Jun 08, 2008 Jun 08, 2008
quote:

Originally posted by: kglad
you have to fake it. add a sprite behind your textfield and assign its color/alpha to suit your needs.


actually i was doing in flex before this.
i dont know what is sprite and other stuffs.

my class extends sprite and adds a TextField Child.
hence, as much i can understand is there is already a sprite.

can u pls elaborate how to change your suggestion to CODE so that i can try.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jun 09, 2008 Jun 09, 2008
Hi,
hope its not too late..
i found this answer on other forum, hope this solves it..

"You need to use the "Alpha" setting. Convert your shape or image into a symbol ( if you havent done alredy) and then select your symbol on the stage. After it is selected look in the properties inspector and click the colour dropdown bar and select Alpha. Choose from 1-100 as 1 being completely invisible and 100 being solid."
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Jun 10, 2008 Jun 10, 2008
i made it with help of one of my collegue:

var mybg:Sprite = new Sprite();
mybg.graphics.beginFill(clr, 0.7);
mybg.graphics.drawRect(textArea.x-56,textArea.y-60,textArea.width+10,-(textArea.height+10));
mybg.graphics.endFill();
addChildAt(mybg,0);//add at the most back position.

//where textArea is the textfield object.
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jun 10, 2008 Jun 10, 2008
LATEST
great.
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines