Look so good 😉
- maskee.cacheAsBitmap = true;
- maskMC.cacheAsBitmap = true;
- maskee.mask = maskMC;
Look so good 😉
When embedding fonts there are a couple of things you need to keep in mind.
Since there is no way to export you library items in another frame than the first in AS3 you need to look for alternatives.
An alternative would be to just accept the increased file size when embedding them in the first frame and showing no information to the user when this is loading. I have noticed though that a simple Latin-1 font adds about 30 kB. One could reason with the widespread availability of broadband this shouldn’t be too bad.
The other option is to embed the font in an external file and decide not to use it for the loader. This keeps your file size down and increases initial loading, that way you can show the user sooner what is happening.
Also keep in mind that when you use a standard embed tag with Flex the embedded font will take up more space than when you use the Flash IDE to embed the fonts. You can avoid this though by specifying in the embed tag which characters you want to embed. A disadvantage of using the embedding with the IDE is that you won’t know for sure if your embedded fonts work until you have uninstalled them from you machine or test on a machine that doesn’t have the font.
Embedding in using the IDE goes as follows:
To embed a font in Flex you use the following code:
Now if you decide to load the font from an external file, you’ll need to register the freshly loaded font with the Flash player.
Some useful links about embedding a subset of a (unicode font):
– Unicode Character Table
– Yahoo on runtime font embedding
That’s about it for embedding fonts.
Update:
If embedded fonts aren’t showing up when compiling with Flex 4, add embedAsCFF=”false” to the embed-tag.
The other day I was trying to animate a mask on a Sprite. It was working only very jerkily or not all. After a lot of trial and error I decided to re-read the docs on masking a Sprite. It turns out you need to add the mask to the the Stage before you can animate it. Quite strange when you are used to just setting the mask in ActionScript 2.
Do not use FocusEvent to dynamically set a selection on a TextField, use MouseEvent instead.
So not:
But: