Copy link to clipboard
Copied
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);
Copy link to clipboard
Copied
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;
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
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?
Copy link to clipboard
Copied
Here are three screenshots. I think I'm really missing something or we're talking about different things. I hope these help show what I'm trying to do.
This is how I'm setting up the radiobuttons. I need to make the round clickable button bigger and also the text that accompanies that. Double-clicking one of the gray "RadioButton" boxes on the stage doesn't bring up and more configurable options.
As it is by default, it looks like this when I test it:
Below is where I'm putting the code. Obviously that's wrong because I just get a blank screen when I test it.
Copy link to clipboard
Copied
Oh I see.
You are working with a Canvas document and JavaScript.
As you posted in the ActionScript 3 subforum and took as an example a AS3 code, I assumed you were working with AS3.
To style components, you can use css.
Copy link to clipboard
Copied
I've fought with this for hours and radio buttons in Animate don't seem to completely respond to css. I was able to create a straight HTML file with the settings I want but when I tried to integrate it into Animate the radio buttons did spread apart like the button was bigger but it never rendered the graphic of the circle bigger and I have no idea how I'd get the <label> to format like I did in the HTML file so I guess I'll create my own and not use what's provided by Animate. I do appreciate your time on this.
Copy link to clipboard
Copied
I understand.
And I do think it's the best to create the graphics from scratch in Animate especially because this is one of the most powerful weapons of this software and what justifies using it instead of a pure code HTML5/DOM solution.
Find more inspiration, events, and resources on the new Adobe Community
Explore Now