16
Aug
04

Correcting Alert component size for embedded fonts

The Alert component sizes itself based on content and doesn’t respond to setSize calls. However, the sizing doesn’t take embedded fonts into account and cuts off text when using embedded fonts.

To fix this bug we need to add two lines, one to mx.controls.alertClasses.AlertForm and another to mx.core.ext.UIObjectExtensions.

First in mx.controls.alertClasses.AlertForm find the getSize() function and add this line right before all of the current textMeasure_mc references.

textMeasure_mc.embedFonts = tf["embedFonts"];

Then in mx.core.ext.UIObjectExtensions find the TextFormat.prototype.getTextExtent2 mixin and add this line right after (and outside) the if statement.

_root._getTextExtent.embedFonts = this["embedFonts"];

If this bug is affecting you, you can choose to either make these changes directly to the core classes or create a local copy of the classes and change those, with a reference to them in each FLA’s classpath.


5 Responses to “Correcting Alert component size for embedded fonts”


  1. 1 Oscar Poch Sep 23rd, 2004 at 12:01 pm

    Hello.

    I’have modified the AlertForm.as file and the UIObjectExtensions.as with notepad and saved them.
    I has not work.
    Should’nt be tf2[”embedFonts”) ?

    I’ve tried it, aswell and I havent got any solution.

    Did I miss something?

    Thanks

  2. 2 Doug Coning Sep 27th, 2004 at 5:05 pm

    I too tried the modifications listed with no luck… Added the 2 modifications as listed to the correct files and nothing…

    I even deleted the component from my library and re-attached it.

  3. 3 weight loss propelene release Oct 29th, 2004 at 1:07 pm

    Hello there,

    Iwas browsing the web and found this blog. Some interesting quotes. Keep them coming!

    Alice
    weight loss propelene release

  4. 4 Max Power Dec 3rd, 2004 at 9:10 am

    Welcome Home Everyone Home

    Cya
    Max

  5. 5 Remote Call Forward Dec 3rd, 2004 at 10:44 pm

    Hi Guys

    Thanks for taking the time posting. MSN have finally launch blogs, what was with the delay?
    Remote Call Forward

    Cya
    Bruce

Comments are currently closed.