|
-
Embedding fonts to Combo Box
Hello,
I have a combo box under a mask and I've done some research and discovered that I need to embed the fonts in to it in order for the text to show. I don't want to embed my own fonts, I just want to use the basic default font and get this working, yet I can't seem to find any tutorials that tell you how to do this, they all seem to be about setting the font colour, size and type.
What's the quickest and easiest method to just get my text visible?
Thanks!
-
-
Thanks for your help. I'm having a problem with it though. My code is:
Code:
var isFont:Font = new Font1();
var isFormat:TextFormat = new TextFormat();
isFormat.font = isFont.fontName;
isFormat.size = 12;
shop_mask.shop_mc.tShirtColour.defaultTextFormat = isFormat;
shop_mask.shop_mc.tShirtColour.embedFonts = true;
and I'm getting the error:
ReferenceError: Error #1056: Cannot create property defaultTextFormat on fl.controls.ComboBox.
at indoorshredwebsite_fla::MainTimeline/indoorshredwebsite_fla::frame1()
Any ideas?
-
Senior Member
If tShirtColour is your combobox then try
tShirtColour.textField
- The right of the People to create Flash movies shall not be infringed. -
-
I changed the code to:
Code:
var isFont:Font = new Font1();
var isFormat:TextFormat = new TextFormat();
isFormat.font = isFont.fontName;
isFormat.size = 12;
shop_mask.shop_mc.tShirtColour.textField.defaultTextFormat = isFormat;
shop_mask.shop_mc.tShirtColour..textField.embedFonts = true;
and received:
ReferenceError: Error #1056: Cannot create property defaultTextFormat on fl.controls.TextInput.
at indoorshredwebsite_fla::MainTimeline/indoorshredwebsite_fla::frame1()
-
Senior Member
That was my mistake. You can do it like this as one way:
myCombo.textField.setStyle("textFormat",isFormat);
myCombo.textField.textField.embedFonts = true;
The first textfield is the textinput and the second is the actual textfield.
- The right of the People to create Flash movies shall not be infringed. -
-
Thank you for that, it doesn't return any errors which is good!
But sadly the combo box doesn't display the text. It shows the text in the drop-down sections, but not in the box next to the little arrow. Masks and combo boxes are difficult partners!
Any ideas?
-
Senior Member
This does it:
myCombo.textField.setStyle ("textFormat",isFormat);
- The right of the People to create Flash movies shall not be infringed. -
-
Sorry cancerinform, you're really helpful but I'm not following you very well.
The code I have is:
Code:
var isFont:Font = new Font1();
var isFormat:TextFormat = new TextFormat();
isFormat.font = isFont.fontName;
isFormat.size = 12;
shop_mask.shop_mc.tShirtColour.textField.setStyle("textFormat",isFormat);
shop_mask.shop_mc.tShirtColour.textField.textField.embedFonts = true;
Which manages to display the options when i click the drop-down menu on the combo box, however doesn't display them in the combo box's main window when chosen.
(The comboBox is called tShirtColour in the properties window).
-
Senior Member
I tested it and the textfield, which shows up, when the combobox loads (not the drop-down) had the embedded font on my computer.
- The right of the People to create Flash movies shall not be infringed. -
-
Well for some reason it's still not working for me. I removed the mask and it works fine, but when the mask is re-applied to the layer, the text just isn't there. I tried to upload an example file which shows my problem but I can't seem to get the .fla under 300kb, which is probably due to the font or component pieces. Instead I've uploaded it elsewhere. If you could take a look I'd appreciate it 
http://www.megaupload.com/?d=93LG3PEY
-
Senior Member
You did not say you have a mask. The mask has to be made with AS.
- The right of the People to create Flash movies shall not be infringed. -
-
Yeah I did :P
Thanks for your help dude! I'll do a bit of googling for using AS3 to mask.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|