In CS5 Publish settings, ActionScript3, Source path there was already a path set up for ".", which I thought would be enough to find the package, but I changed it to the fla's directory C:\Users\John\Desktop\Temp and then it found the font package.
I would have expected it to find the saved fla with "."

After that I had two errors "FontAsset was not found" (my FlashBuilder error I had seen before) and "You have used a feature that requires the flex SDK". Then it said Flex SDK Path: $(AppConfig)/ActionScript 3.0/flex_sdk/4.0.0/

I clicked Update Library path to change the publish settings and then it worked okay and reported "embeded".
I had copied the font file into the same directory.

I usually build my programs in Flash Builder and so hadn't expected the "." path problem.

John

On 28/06/2010 13:03, Bill S. wrote:
Hi Christoffer, thank you for the answer; but adding fontFamily didn't help.

      [Embed("arial.ttf", fontName="_Arial", fontFamily="_Arial", 
mimeType='application/x-font')]


John -- I tried messing with the flex swc but that didn't do it either -- 
although I have a feeling that it is related to this. I am digging further in.

Thanks
~Bill



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

One of the frustrating things with CS3 Flash was (contrary to many blogs -- and 
I believe the docs) that you could not actually [EMBED] fonts.

However this worked wonderfully in CS4.

But now, in (a fully updated) CS5 I can't seem to get EMBED to work again.


The below code is exactly the same in a CS4 and a CS5 FLA. Literally, the same 
fla file was copied and updated to CS5. The font class was untouched.

All it is meant to do is display "This is my text", which works in CS4.


The code is the same for both CS4 and CS5.
Am I missing something in the code? Or a setting?


import flash.text.AntiAliasType;
import flash.text.TextField;
import flash.text.TextFieldAutoSize;
import flash.text.TextFormat;

import fonts._Arial;

[SWF(backgroundColor="#ddffdd", frameRate="30")]


var Arial:_Arial = new _Arial();

try
   {
  var _title:TextField = new TextField();
     with(_title)
  {
     x = 1;
     y = 1;
     alpha = 100;
     background = false;
    defaultTextFormat = new 
TextFormat(font="_Arial",size=24,color=0xff0000,align="center");
    width = 500;
    visible = true;
    selectable = true;
    type = TextFieldType.INPUT;
    antiAliasType = AntiAliasType.ADVANCED;
    embedFonts = true;
    text = "This is my text";
    trace("Embedded");  // Embedded is outputted in both cases.
  }
stage.addChild(_title);

}
catch(e)
{
  trace("error in TextField setup: " + e);
}


// the fonts._Arial class
package fonts
{
  import flash.text.Font;
  import flash.display.Sprite;

  public class _Arial extends Sprite
  {
   [Embed("arial.ttf", fontName="_Arial", mimeType='application/x-font')]
   public var m_font:Class;

   public function _Arial():void
   {
    Font.registerFont(m_font);
   }
  }
}


Thanks
~Bill
_______________________________________________
Flashcoders mailing list
[email protected]
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders




_______________________________________________
Flashcoders mailing list
[email protected]
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Reply via email to