# AS 2: font from shared library

**URL:** <https://forum.kirupa.com/t/as-2-font-from-shared-library/294740>\
**Category:** flash\
**Created:** [August 19, 2009, 9:10am UTC](https://forum.kirupa.com/t/as-2-font-from-shared-library/294740 "2009-08-19T09:10:49Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ghostbob](https://avatars.discourse-cdn.com/v4/letter/g/e19b73/32.png) [@Ghostbob](https://forum.kirupa.com/u/Ghostbob)\
**Post date:** [August 19, 2009, 9:10am UTC](https://forum.kirupa.com/t/as-2-font-from-shared-library/294740/1 "2009-08-19T09:10:49Z")

</div>

Need to load font from shared library, to use it in main application then needed.  
Problem - do not work in IE7 and IE8. all working fine in FF. Problem it’self: code from loaded swf do not run.

Explanation:  
file: arial\_n\_lib.fla - on the stage (main scene) movieClip - arial\_n\_mc. It contains dynamic textfield with needed Font-Arial and Embeded symbols(cyrilic, latin etc…). MovieClip properties: in first frame, for action script, export for runtime sharing and swf path

file: arial\_n.fla - shared library container: on the stage (main scene) movieClip- arial\_n\_mc (dragged from arial\_n\_lib.fla ). On the next layer AS2.0 code:

```auto

this.TimeOut = function()
{
    if(this.id == undefined)
    {
        this.id = setInterval(this,"TimeOut",1000);
    }
    else
    {
        clearInterval(this.id );
        trace("registering txt field::"+this.arial_n_mc.arial_n_txt)
        _global.regFont(this.arial_n_mc.arial_n_txt);
    }
}
this.TimeOut();

```

file: ie8test.fla - main app(test). Code in fla (showing here main parts - do not show trivial things)

```auto

.
.
.
my_mcl.addListener(myListener);
my_mcl.loadClip(myURL, this.dummy);

_global.regFont = function(tfld) //tfld - Textfield object
{    

    var tf = tfld.getTextFormat();    
    trace("font="+tf.font)
}

```

so loading shared libary container. In FF I see trace: font=Arial, in IE7,8 - function regFont did not called. Why??

Please help, it’s very urgent! Big project stopped because of this

P.S. changing \_global.regFont to \_root.regFont - does not help  
P.P.S. compiled for player version 9 and 10. Played in FlashPlayer v10 - no results
