Link to home
Start Free TrialLog in
Avatar of jhaley-telecomtv
jhaley-telecomtvFlag for United Kingdom of Great Britain and Northern Ireland

asked on

embedFont = true causes the text to disappear in flash

Hi guys,

I am currently building a dynamic carousel type project in flash. It's run via an XML file. So I am dynamically creating everything including a text field which sits underneath the image. The problem is this. As the text field is dynamic, i need to dynamically set/embed the font (Helvetica). I have create a new font in my library and given it the linkage name fHelvetica.

Below is the code with which I am attempting to set the textfields formatting.

On runtime, the text within the text area does not display if i have embedFont=true. If i set it to false, it does not recognise fHelvetica and just displays in Times New Roman (default).

Any help would be amazing, really in a rush to get this fixed now.
// Style vars
var oFontStyle:Font = new fHelvetica();
var oBoothTitleFormat:TextFormat=new TextFormat();
oBoothTitleFormat.bold=true;
oBoothTitleFormat.font="fHelvetica";
oBoothTitleFormat.size=16;
 
var oText:TextField=oMovie.createTextField("oBoothTitle"+nId,_root.oBoothHolder.getNextHighestDepth(),0,0,0,0);
oText.wordWrap=false;
oText.autoSize=true;
oText.embedFonts=true;
oText.text=_oBoothCache[0][1]//"Test text";
oText.setTextFormat(oBoothTitleFormat);

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of Aneesh Chopra
Aneesh Chopra
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of jhaley-telecomtv

ASKER

Thanks Aneesh.

No luck there though.

If I remove embedFonts, the font's show, but not as helvetica, so it's like it is not seeing dHelvetica as a valid font. Yet it is in the flash font list. So when i created the textarea, i could choose "fHelvetica*". I have tried the following aswell to no avail!

oBoothTitleFormat.font="fHelvetica*";

Open in new window

Sorry, I meant fHelvetica!
sorry, you should remove the your font symbol from library before implementing my earlier suggestion.
and must choose Helvatica from the font list.

I know that by using this approach you might have to change all references to your font symbol.
but this is required and then my suggested solution will work.

Ah yes that works! Thankyou. Very frustrating issue. Is there anyway around it? Is it addressed in AS3?
Thanks!