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

Formating a dynamic text (box) [AS2]

Guru ,
Jan 21, 2013 Jan 21, 2013

Hi,

I have a button called B and a dynamic text box called T

How can I make the text box

     1) change it's fill color?

     2) change it text font?

     3) change the text font style to bold or to regular?

     4) put a colored stroke around the frame?

To place text in the frame upon click of the button I would use

B.onRelease = function() {T.text = "foo"};

Also Is there a way of changing the color of a button on clicking or passing over it?

I need to do this in AS2

Thanks in advance

Trevor

TOPICS
ActionScript
1.3K
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

LEGEND , Jan 21, 2013 Jan 21, 2013

To manipulate the text/font in the textfield you need to use the TextFormat class and the setTextFormatmethod of the TextField.  The help documentation should have examples if you look there, and you should be able to find helpful information using Google.  Here's a link to the TextFormat class that some one has on the web: http://docs.brajeshwar.com/as2/TextFormat.html

To change the characteristics of the textfield as far as background and border colors go, the TextField class has properties for

...
Translate
LEGEND ,
Jan 21, 2013 Jan 21, 2013

To manipulate the text/font in the textfield you need to use the TextFormat class and the setTextFormatmethod of the TextField.  The help documentation should have examples if you look there, and you should be able to find helpful information using Google.  Here's a link to the TextFormat class that some one has on the web: http://docs.brajeshwar.com/as2/TextFormat.html

To change the characteristics of the textfield as far as background and border colors go, the TextField class has properties for those that you can set.  Here is a link to the same site as linked above but to the TextField class information.

http://docs.brajeshwar.com/as2/TextField.html

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
Guru ,
Jan 21, 2013 Jan 21, 2013

Thanks a lot Ned

I fixed up the Font issues from your link and will look at the other link later.

Any answer regarding the button changing color?

Trevor

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
LEGEND ,
Jan 21, 2013 Jan 21, 2013

If the button is a Button symbol, you can have a rollover effect for it by changing the contents of what is inside the Over frame in the button's inner timeline.  But that will change back when you rollout.

If you want the button to change to a different color and stay that way either due to clicking it or rolling over it, then you need to use a movieclip symbol instead of a button symbol and write the code to control how the movieclip behaves as a button.

You can find tutorials for that if you search Google using terms like "AS2 movieclip as button tutorial"

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
Guru ,
Jan 21, 2013 Jan 21, 2013
LATEST

Thanks

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