I've been playing around with all this FAMES thingy, and I LOVE IT.

one thing, though...
importing and "using" fonts was never working

on the official guide you find how to embed fonts using swfmill


you find this

<font id="vera" import="library/vera.ttf" glyphs="0123456789"/>

now if you try to create a text field and use the font in a TextFormat it's never gonna work.
I couldn't find any info about this, but then I found a post about "exporting" (linkage) of symbols.

well...

i changed the basic xml 

<?xml version="1.0" encoding="iso-8859-1"?>
<movie width="120" height="240" framerate="21">
    <background color="#83bb38"/>
    <library>
        <font id="embFont" import="assets/04b-11.suit"/>
    </library>
</movie>



to this (pay attention to the new <export> tag



<?xml version="1.0" encoding="iso-8859-1"?>
<movie width="120" height="240" framerate="21">
    <background color="#83bb38"/>
    <library>
        <font id="embFont" import="assets/04b-11.suit"/>
    </library>
    <Export>
        <symbols>
          <Symbol objectID="1" name="embFont"/>
        </symbols>
    </Export>

</movie>


so my class now works
and I hope this helps somebody else but me

ciao.ubi


class com.tdoSys.util.createField{
    private var myFld:TextField;
    private var myFrm:TextFormat;
    function createField(aPath:MovieClip,aWdt:Number,aHgt:Number,aMaxWdt:Number,aMaxHgt:Number,aTxt:String)
    {
        myFrm=new TextFormat();
        myFrm.font="embFont";
        myFrm.size=8;
        aPath.createTextField("fld",999,10,10,100,20);
        var fld:TextField=aPath.fld;
        fld.embedFonts=true;
        fld.background="">true;
        fld.border=true;
        fld.multiline=true;
        fld.wordWrap=true;

        

        if(aMaxWdt!=null){
            fld._width=aMaxWdt;
        }
        if(aMaxHgt!=null){
            fld._height=aMaxHgt;
        }

        

        fld.autoSize=true;
        fld.text=aTxt;
        fld.setTextFormat(myFrm);
        Flashout.info("ciao");
    }
}
_______________________________________________
osflash mailing list
[email protected]
http://osflash.org/mailman/listinfo/osflash_osflash.org

Reply via email to