Embed a font in one SWF use in another?

Long version:
I've got a "player" app that I've built that shows content
from various XML files. I have certain common fonts embedded in it
(Verdana, Arial, Times, etc.) that it uses to display text. Now,
I've got a client with a special symbol font that I'll need to pull
characters from to show specific text in my app. I can't embed this
font in my app (due to many considerations), but I'd like to use it
without having to use each character as a graphic (by converting
every character in the font into a JPG). So, can I embed his font
in a SWF and load that SWF to use the font in my app?
Short version:
SWF1 loads SWF2 which contains an embedded font. SWF1 uses
that font via a TextFormant instance to show text on the stage.
Is this possible? My target is Flash 7 player using AS2.
Thanks!
Matt

that approach won't work i don't think. i've looked at shared
libs before and don't remember it being that useful. but i'll take
another look.
is there now way in pure code to do it?

Similar Messages

  • Embed images in one MovieClip, use in another?

    I apologize if you've already read this message. My question
    isn't only AS, not only Flash, not only Flex. It's in the
    mysterious area where the three come together. I posted this in the
    AS discussion, but think it might be better off here.
    Is it possible to embed images (jpgs) in one MovieClip, then
    load that SWF into another MovieClip and use those images in the
    loader? We are trying to avoid reloading an image each time we need
    it, but still load them dynamically. We'd like to do this:
    Container.swf:
    <mx:Application>
    <mx:Script>
    [Embed(source="images/myimage.jpg")]
    public var img: String;
    </mx:Script>
    </mx:Application>
    Then, load that SWF and use its embedded image:
    Loader.swf:
    <mx:Application>
    <mx:Loader id="container" source="Container.swf" />
    <mx:HBox>
    <mx:Image id="the_image" source="container.content.img"
    />
    </mx:HBox>
    </mx:Application>
    It looks like this should work, and the "resource" string is
    properly being passed to the_image (something like
    __Resource.43234564.myimage_jpg) but it cannot actually load; we
    get a broken image instead.
    I'm guessing I somehow need to register the object library of
    the Container.swf with my Loader.swf? How?
    Or, is this whole enterprise impossible?
    Thank you!
    Greg

    In Flash you may use 'export for runtime sharing' future. In
    Flex there
    must be a way also (look at adobe devnet topics)
    In Flash common problem is you can't control loading progress
    of this
    add-on. Preload first add-on to one movie without "export for
    runtime
    sharing" future with loader progress if you need it, then
    reload common
    movie to 'real' loader - add-on wil be taken from cache
    > I apologize if you've already read this message. My
    question isn't only AS,
    > not only Flash, not only Flex. It's in the mysterious
    area where the three
    > come together. I posted this in the AS discussion, but
    think it might be
    > better off here.
    >
    > Is it possible to embed images (jpgs) in one MovieClip,
    then load that SWF
    > into another MovieClip and use those images in the
    loader? We are trying to
    > avoid reloading an image each time we need it, but still
    load them dynamically.
    > We'd like to do this:
    >
    > Container.swf:
    > <mx:Application>
    > <mx:Script>
    > [Embed(source="images/myimage.jpg")]
    > public var img: String;
    > </mx:Script>
    > </mx:Application>
    >
    > Then, load that SWF and use its embedded image:
    >
    > Loader.swf:
    > <mx:Application>
    > <mx:Loader id="container" source="Container.swf"
    />
    > <mx:HBox>
    > <mx:Image id="the_image"
    source="container.content.img" />
    > </mx:HBox>
    > </mx:Application>
    >
    > It looks like this should work, and the "resource"
    string is properly being
    > passed to the_image (something like
    __Resource.43234564.myimage_jpg) but it
    > cannot actually load; we get a broken image instead.
    >
    > I'm guessing I somehow need to register the object
    library of the
    > Container.swf with my Loader.swf? How?
    >
    > Or, is this whole enterprise impossible?
    >
    > Thank you!
    >
    > Greg
    >
    >
    >
    >

  • How can I control a button from one swf file to another swf file?

    Hi,
    I have a main.swf file. From that file I am accessing the external.swf file which is an external file.
    Now, how can I write code on my main.swf file for the button which is on my external.swf file?
    Activities.MainPanel.close_btn.addEventListener(MouseEvent.CLICK, btnClickClose);
    Activities.MainPanel.close_btn (This buttons is actually on external.swf file, but I want to write code on main.swf file to execute it on external.swf) how can I control one swf button on other swf file?
    Thanks.

    Here's some example code that you should be able to adapt to your needs.
    // create a new loader object instance...
    var loader:Loader = new Loader();
    // make the download request...
    var request:URLRequest = new URLRequest("external.swf");
    // add a complete event listener to the loader
    loader.contentLoaderInfo.addEventListener(Event.COMPLETE, completeHandler);
    // start the actual loading process...
    loader.load(request);
    // create a new empty movieClip instance, you will put the loaded movie into this movieClip once its loaded
    var externalMovie:MovieClip;
    // this function is called when the download has finished and the file is ready to use...
    function completeHandler(event:Event):void {
       // set the contents of the loaded movie to the new empty movieClip...
               externalMovie = MovieClip(event.target.content);
       // add this new movie to the display list...
       addChild(externalMovie);
    Now you can refer to the loaded movie with the instance name "externalMovie". So if, for instance, you want to address a button in the loaded movie, you could write something like this on the main timeline:
    externalMovie.addEventListener(MouseEvent.CLICK, btnClickClose);
    function btnClickClose(event:MouseEvent):void {

  • Missing font in one file, but not another?

    In one document, I changed a section of type to Helvetica, then it turned pink. It says Helvetica is missing. I opened another document and used Helvetica with no problem. I closed InDesign, checked my fonts and used Helvetica in other programs. Reopeing ID, I copied the Helvetica type from the second file and pasted it in the first file, and now Helvetica works fine in the first file. What the heck?

    @OP
    Are you sure you really have that Helvetica installed & activated in your system? If you use InDesign CS5 or 5.5 and you have received documents as packages where used fonts have been stored in Document Fonts folder, you may use those fonts in indd-file that has been stored in the same root with Document Fonts folder. If you move your indd out of that root, certain fonts may stop working....
    I dont know if this causes your troubles, it´s more likely font management issue but still worth to check if nothing else helps you out.

  • Using one swf to preload another swf

    Hey everyone,
    I have two swf files, one is a preloader and the second is
    the main file. I want to preload the main file using my preload
    swf. It works, however the main swf starts to play after about 11%
    of it is preloaded, how can i stop this? I want to preload the
    entire main swf and then have it play. Here is the code i'm using
    in my preloader swf. I'm fairly new to this so any help is much
    appreciated. Thanks in advance.

    http://www.gotoandlearn.com/
    this is Lee Brimelow's site; he has some really good
    tutorials on this and other topics; I've found them pretty helpful.
    look into loaders and event listeners.
    good luck.

  • Load one swf then load another swf

    Hello,
    I have created a QT movie which I have then encoded to a FLV and used Dreamweaver CS3 to insert the FLV into a webpage. This has created a SWF. I have then followed a tutorial (this onehttp://www.adobe.com/devnet/flash/articles/video_playlist_05.html ) and created a playlist calling multiply videos into it.
    What I would like to do is play my original movie then it automatically go into the play list. So far it has stumped me. Any help appreciated.
    Using Flash CS3 and AS 3.
    Thank you

    James,
    You need to listener for the COMPLETE event on the video player.
    Add these functions after the listListener function:
            function completeListener(e:Event):void {
                if(tileList.selectedIndex < tileList.dataProvider.length - 1) {
                    playVidAtIndex(tileList.selectedIndex + 1);
                } else {
                    playVidAtIndex(0);    //Return to first video
            function playVidAtIndex(newIndex:int):void {
                tileList.selectedIndex = newIndex;
                tileList.scrollToIndex(newIndex);
                tileList.dispatchEvent(new Event(Event.CHANGE));
    Then add this code inside the initMediaPlayer function:
         myVid.addEventListener(Event.COMPLETE, completeListener);
    The first function checks to see if you at the end of the list, depending on what it finds, it plays a new video. The second function sets the selection in the tileList object then scrolls to make sure that intem is visible. It then dispatches the CHANGE event to let the existing code know that a new video has been selected.
    The last bit of code adds a listener to trigger the first function I listed when each video is finished.
    Once you've added the code, everything should be peachy. You can comment out the code inside the ELSE statement if you don't want the playlist to loop back to the beginning when it's finished.

  • Replace one swf movie with another

    I have a flash movie on my web page and I have made some of
    the text inside the movie into buttons. The movie only takes up a
    portion of the page. I would like to replace the movie with another
    movie when somebody clicks the button.
    I'm sorry if this is a really basic question but I have spent
    ages trying to find out how to do it and I keep getting an error
    when I try to search this forum.
    Thanks for your help.

    Thanks for your help so far. I seem to be having more and
    more trouble though!
    I have a swf file (sunnyserv.swf) that contains a pre-loader
    and then opens another swf file (downturn.swf). The downturn.swf
    contains the buttons that I want to listen to, and swap out the
    movies.
    If I open sunnyserv.fla in flash and test the movie, it loads
    downturn.swf, listens to the mouse click and runs the
    communication.swf movie (although it doesn't clear all of the
    children from downturn.swf).
    However, if I export all three movies and open my web page
    nothing happens! If I change the xhtml to load downturn.swf that
    works ok. Any idea why it would work in test movie but not when
    loaded into an xhtml page?
    Also, can you see a reason why all of the children are not
    being removed in the commClickHandler function?
    Code below:
    sunnyserv.swf (container)
    var l:Loader = new Loader();
    l.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS,
    loop);
    l.contentLoaderInfo.addEventListener(Event.COMPLETE, done);
    l.load(new URLRequest("downturn.swf"));
    function loop(e:ProgressEvent):void
    var perc:Number = e.bytesLoaded / e.bytesTotal;
    percent.text = Math.ceil(perc*100).toString();
    function done(e:Event):void
    addChild(l);
    removeChildAt(0);
    percent = null;
    downturn.swf
    import flash.events.MouseEvent;
    import flash.events.EventDispatcher;
    import flash.display.MovieClip;
    var l:Loader = new Loader();
    // add listeners for each button
    btn_communication.addEventListener(MouseEvent.CLICK,
    commClickHandler);
    function commClickHandler(event:MouseEvent):void {
    for(var i:int = 0; i < numChildren; i++){
    removeChildAt(i);
    l.load(new URLRequest("communication.swf"));
    addChild(l);
    stop();
    Hope somebody can help!

  • Embed OTF Font as CFF in Pure Actionscript Project using Flex SDK 4.0

    I want to apply the method explained here: http://www.insideria.com/2009/03/flash-text-engine.html using only the Flex SDK 4 (not using FlashBuilder)
    Specifically:
    Embedding fonts can be tricky. In Flex, embed the font and store it
    using DefineFont4 and font subsetting currently only supported by Gumbo.
    A future version of Flash will support it but in the meantime, a Gumbo
    SWC with the embedded font must be created then adding to your Flash CS4
    project.
    The following is the method I am using to embed the fonts.
    public class Main extends Sprite {
         [Embed(source="../assets/GE Thameen DemiBold.otf",
                                  fontFamily = "GE Thameen",
                                  fontWeight = "bold",
                                  mimeType = "application/x-font",
                                  embedAsCFF = "true"
         private const GEThameen:Class;
    The following command line was assimilated after solving the output error messages using google and a little looking into how FlashDevelop works..
    mxmlc Main.as -load-config config.xml -managers flash.fonts.AFEFontManager
    The output SWF is not working as supposed, and the file size (20KB) does not seem to account for the embedded font. PS: When the font embedding is bypassed, and a device font is used for the text engine classes, the file works perfectly.
    The contents of config.xml are as the following:
    <?xml version="1.0" encoding="utf-8"?>
    <!--This Adobe Flex compiler configuration file was generated by a tool.-->
    <!--Any modifications you make may be lost.-->
    <flex-config>
      <target-player>10.0.0</target-player>
      <compiler>
        <source-path append="true">
          <path-element>E:\actionscript</path-element>
        </source-path>
        <external-library-path>
            <path-element>C:\bin\flex_sdk_4\frameworks\libs\player\10.0\playerglobal.swc</path-element>
            <path-element>C:\bin\flex_sdk_4\frameworks\libs\flex.swc</path-element>
        </external-library-path>
      </compiler>
      <file-specs>
      </file-specs>
      <default-background-color>#FFFFFF</default-background-color>
      <default-frame-rate>30</default-frame-rate>
      <default-size>
        <width>800</width>
        <height>600</height>
      </default-size>
    </flex-config>

    After losing about 2-3 days to trying to figure this stuff out, I rolled back to build 4.5.0.19786 and the problem doesn't occur anymore.  I'll revisit this issue once we ship the product next week.
    Thanks Alex.
    Cheers,
    Nate Beck

  • Using embeded fonts in loaded swf.

    I have a .Swf, which has 3 fonts embedded in it, they are all exported in frame 1 for AS.  This swf loads any number of external .swfs which have dynamically generated textfields inside of them.  This text must be embedded text because effects may be applied to them.  I do not want to embed the three fonts into every external swf, and do not think I should have to.  The font exists in the Loading swf and I have registered the fonts to the global font list.  If I print this list from the loaded swf, all three fonts are present, but when I try to use any of them, my textfiels are empty.
    My question is how do I utilize a font which is embedded in a swf, from a swf which has been loaded into that swf?
    From my external swf, this code:
    [PHP]var embeddedFonts:Array = Font.enumerateFonts(false);
    embeddedFonts.sortOn("fontName", Array.CASEINSENSITIVE);
    trace(embeddedFonts);[/PHP]
    produces the following:
    [PHP][object CenturyBook],[object MyriadProRegular],[object MyriadProItalic][/PHP]
    which are the three fonts that are embedded in the loading swf, So I assume the LOADED swf has access to these fonts.
    When I apply this code to the externally loaded swf:
    [PHP]var FontClass:Class = getDefinitionByName("MyriadProRegular") as Class;
    trace("FontClassInstance -> " + FontClass.toString());
    var linkedFont: Font = new FontClass();
    trace("Font name: " + linkedFont.fontName);
    var textFormat: TextFormat = new TextFormat(linkedFont.fontName, 14);
    //... The next lines set up the text box and apply the format.  I am sure this is done correctly.
    [/PHP]
    I get the following output:
    [PHP]FontClassInstance -> [class MyriadProRegular]
    Font name: Myriad Pro[/PHP]
    which is exactly what I would expect.  Yet, my text box is still blank.  I have embedText = true on the text box, and have applied a string to the "text" property, so it's nothing silly liek that.
    Any help would be appreciated...

    You may also want to look at the various embedded font format issues. Many of the Flex 4 components use a newer embedded font fortmat, which is not the same as the one generally used in Flash. So even if ther Flash font gets registered properly, it still may not work with some of the spark components.
    You should be able to create a swf using Flex that contains fonts embedded in either format, which can then be used in the way you describe, though, since Flex 4 suports both font formats.
    Hopefully, someone else will jump in here if I got some of this wrong.
    -JM

  • Flex 4 Embed fonts in flash swf VS embedding fonts in flex

    I have this dilema...what's the best way to embed fonts?
    In flash I can easily embed the fonts + the chars ranges that I need through the menus export the swf and then use it in flex.
    In flex I don't see an easy way of setting the character ranges. How can I get the values I need? I read the format is U+(beginning of range)-(end of range) but where do I take beginning and end of the range from ?
    Thanks in advance.

    Сode hinting in Flash Builder 4 code editor for global style, e.g.
    global {
       font-family : Arial;
    works for me.
    Also in @font-family style declarations, I can code hint for "font-family", "embed-as-cff" styles property too.
    Although, it is true you do not get code hints for values for those particular properties, I think that CSS editor could support it too, but it does not.

  • Using loaded fonts in child swf

    Hello,
    I have an ad container that loads a handful of resources of which some are fonts and some are swfs. My problem is that the font is loaded from an url, is registered and works fine embedding it to the textfields created in the ad container. The problem is that when I try to embed it to the textfields in some of those loaded SWFs it does not work.
    The font loads and gets registered before the swf gets loaded. The SWF file then gets an event telling it to embed the font there as well. While checking, from within the child SWF file, the Font.enumerateFonts() array I can see that the fonts have been succesfully registered. My problem is that even if that array shows me the fonts, when I try to embed them in the child SWF file nothing appears. I even use something like myTextFied.font = Fonts.enumerateFonts()[0].fontName, while embedFonts is set to true and antiliasing is set to advanced.
    I tried it in all manner of ways and none gives me any results. The font which is loaded is stored as a library item with Linkage inside a SWF file. So to load a font I load SWF file containing that font. It works fine for the ad container (main SWF) but not for children SWFs.
    Any suggestions?
    Thank you a lot!
    Vlad

    You may need to create instance of font class and register font in every loaded swf. This is an RSL approach.
    This post outlines the idea:
    http://krasimirtsonev.com/blog/article/AS3-flash-runtime-font-loading-embedding

  • Embed a font in a PDF(generated by Word 2013) using Adobe Acrobat XI

    Hi all,
    I wrote my thesis in Word 2013 using the LaTex font "LM Roman 12" that is an Open Type font not restricted (it results "Editable").
    Although it is marked as opentype, word doesn't embed it into the exported pdf and I guess that is becouse the font is identified as Type1.
    I more or less solved the problem printing the word file using Adobe PDF Printer or converting it with Abobe Acrobat XI, but I'd like to use the pdf generated by word becouse auto-creates index, links index items to contents and doesn't resize/alter the images inside the document.
    The screenshot above is the properties of the pdf generated from word.
    Is there a simple way to force the embedding in this pdf of the missing not embedded fonts?

    Word 2013 uses its own pdf creator engine as far as I know. The step I performed were:
    1 - In the save settings I told word to embed fonts (sorry for the language, I have the Italian client)
    2 - Export from Word -> Save As -> .pdf adding also the table of contents/index
    N.B. I cannot use PDF/A, and in any case it doesn't embed the font
    A working solution is to use Acrobat XI to convert it or print with Adobe PDF printer, results:
    The problems are 2:
    1 - It doesn't create any bookmark and doesn't create links from the table of images to the linked images
    2 - Images, also with the preset "High Quality Printing" customized using "No compression", are really ugly and if you zoom a bit more than 100% they totally be s**t. It wasn't that way with PDF created by word.
    In the end, or I find they way to open the pdf created by word and embedd the missing font, or I find a way to make Acrobat XI creating bookmarks from the word file.
    Suggestion?

  • Printing to PDF with Ctrl-P (use Adobe Professional 9.4.5) tries to embed a font (WCrSarah) that is not used in the css, nor used on the page itself). Why? Cheers, vernooij@brill.nl

    Hi all,
    Printing a page to PDF with Ctrl-P (use Adobe Professional 9.4.5) tries to embed a font that is on my computer (WCrSarah) that is not used in the css, nor used or named in the page itself. Why? Cheers, [email protected]

    Your template contains an IE Conditional Comment that is adding 30px of top padding to  #sidebar1.  This padding may required in older versions of IE but not IE9.
    &lt;!--[if IE]>
    &lt;style type="text/css">
    /* place css fixes for all versions of IE in this conditional comment */
    .twoColFixRtHdr #sidebar1 { padding-top: 30px; }
    .twoColFixRtHdr #mainContent { zoom: 1; }
    /* the above proprietary zoom property gives IE the hasLayout it needs to avoid several bugs */
    </style>
    &lt;![endif]-->
    To fix it, change [if IE]  to [if lt IE 9]
    Nancy O.
    Alt-Web Design & Publishing
    Web | Graphics | Print | Media  Specialists 
    http://alt-web.com/
    http://twitter.com/altweb

  • How do I embed multiple font outlines in dynamic text field

    Can anyone tell me how I can embed multiple font outlines in
    Flash MX so I can get smooth text in a dynamic
    text frame? I want to use Regular, bold and italic in various
    parts of the text.
    I was using the Character button in the properties manager
    and tried to include all Characters. That does not work.
    In the Properties manager I can choose Bold and/or Italic.
    But it becomes a universal setting that overrides my HTML tags in
    my external txt file that I am importing. I dont want all my text
    to be bold.
    If I dont select them in the properties, however, Flash will
    not embed the font that it needs.
    Is there a different way to embed fonts other than under the
    Character Tab?
    I tried to import fonts to the library, but can not select
    them.
    Your help would really be appreciated.
    Sincerely,
    ggaarde

    ggaarde wrote:
    > Thanks Urami
    > Tried your method and it does not work for me.
    > I put 3 dynamic text fields in the first frame of the
    movie. Set them up to
    > where one is regular, one is bold and one is italic
    Helvetica.
    Weird, it works for me on first go, always had in fact :)
    Show you an example, try to compare to your file see if you
    missed anything accidentally.
    http://flashfugitive.com/stuff/font/text.swf
    text file
    http://flashfugitive.com/stuff/font/text.txt
    fla
    http://flashfugitive.com/stuff/font/text.fla
    Best Regards
    Urami
    <urami>
    If you want to mail me - DO NOT LAUGH AT MY ADDRESS
    </urami>

  • Font in embedded swf now not showing in ie6

    Hi There,
    We've noticed that a .swf which was recently updated using CS5 no longer displays the font in ie6 - it was originally created several years ago in CS3 so we're wondering if something has changed with regard to the way Flash embeds fonts?
    This tutorial looks fairly extreme for something so simple: http://www.adobe.com/devnet/flash/quickstart/embedding_fonts.html
    The font is the Microsoft font Tahoma and we've updated our test machine to the latest version of Flash - but still no joy.
    When I click various text in the Flash file, they're all set to the following in the properties panel:
    - Classic Text
    - Static Text
    Is there a simple way to embed fonts or do you now have to create a font symbol and follow all the steps described in the above link?
    Sorry, have just never noticed this before.
    Any help or pointers in the right direction would be much appreciated.
    Cheers

    It should work just fine in IE6. You might want to make sure you don't target any version of flash higher than you absolutely need to. I'm not sure how extensively supported IE6 is with Adobe any longer.
    If you're not using any dynamic text and it's literally all static then you don't need to embed the font at all. Flash does that for you automatically on static text fields. The user (as kglad said) does not need to have the font installed. The text is baked into flash as vector outlines.

Maybe you are looking for