Skip to main content
dianam81535829
Participating Frequently
January 16, 2018
Question

Animate CC 2018 doesn't seem to play nice with examples of older ActionScript 3

  • January 16, 2018
  • 1 reply
  • 1240 views

I'm using the RadioButton object from the User Interface components but they are way too small. I've found older code to at least try to format the text that I included below, but if I test with it, the code seems to break everything. Any suggestions?

var tf:TextFormat = new TextFormat();

tf.font = "Arial";

tf.size = 20;

this.rb1.setStyle("textFormat", tf);

This topic has been closed for replies.

1 reply

JoãoCésar17023019
Community Expert
Community Expert
January 16, 2018

You can double-click any component and chage its internal graphics.

About the text, try this:

import flash.text.TextFormat;

import flash.text.Font;

var font:Font = new ArialRegular();

var tf:TextFormat = new TextFormat();

tf.size = 20;

tf.font = font.fontName;

txt.defaultTextFormat = tf;

dianam81535829
Participating Frequently
January 16, 2018

Thanks for the feedback. Should I be putting that on a specific layer? I've added it to where the rest of my code lives that controls the action when the radiobuttons are clicked, but when I test it, I just see an empty white screen. As for double-clicking on a component, I've tried that on the stage, in the library and in the components panel and I'm not seeing anywhere to change the graphics.

JoãoCésar17023019
Community Expert
Community Expert
January 16, 2018

The previous code will replace your text code in the same actions frame. Only the import statements must be on top of this same frame, in the first lines.

One thing I forgot to mention is this line:

var font:Font = new ArialRegular();  

ArialRegular is a class for a font that was embedded like this:

- Selecting a text field;

- Going to the Properties panel;

- Choosing "Embed...";

- Choosing "All" in "Character ranges";

- Clicking on the "ActionScript" tab;

- Clicking "Export for ActionScript".

- Typing the name of your font class.

And are you double-clicking the radio button with the Selection Tool and nothing is happening? Can you share a GIF or video?