A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: [RESOLVED] ASDoc Error: Can't Find Embedded Fonts?

  1. #1
    Senior Member
    Join Date
    Jan 2006
    Posts
    133

    resolved [RESOLVED] ASDoc Error: Can't Find Embedded Fonts?

    Hello,

    I am working in Flash CS5 Professional.
    On my stage, I have a dynamic TextField (my_txt) that uses a basic font, we'll say Arial. However, I want to format some of the text within the field with a custom font.

    I've embedded the font and exported to ActionScript as per Adobe's documentation, so now there is a Font item in my library named "MyCustomFont".
    The properties of the Font are -
    Class: MyCustomFont
    Base Class: flash.text.Font

    So, I've written a custom class file and I want to format the text, so the AS code within the class looks something like this:

    Actionscript Code:
    var my_font:Font = new MyCustomFont();

    var my_fmt:TextFormat = new TextFormat();
    my_fmt.font = my_font.fontName;
    my_txt.setTextFormat(my_fmt, 5, 15);

    This is pretty much like the examples I've seen in Adobe Docs. And, it works swimmingly when I test the movie; however, when I try to document the class using the ASDoc command line tool, I get the error:

    Code:
    /Path/To/Project/And/The/Classes/SomeClass.as(221): col: 27 Error: Call to a possibly undefined method MyCustomFont.
    
    			var my_font:Font = new MyCustomFont();
    			                       ^
    I THINK I understand why ASDoc isn't finding the "method" MyCustomFont... the "method" is actually a Class contained in the Library within the .fla.

    So, is there a special argument I need to write in the ASDoc command line so that it will recognize embedded fonts?

    Or, am I supposed to use an "import" statement in SomeClass to import the embedded fonts somehow?

    Thanks!

  2. #2
    Senior Member
    Join Date
    Jan 2006
    Posts
    133
    Ahhh...found the answer, do the same thing as I would do for any project that uses the built-in AS3 components (such as FLVPlayback):

    Put the Font items into a new .fla library and export a SWC.

    Then use the "-library-path /Path/to/SWC" argument in the ASDoc command line tool.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center