hi folks,
this week i had to externalize fonts in an AS3 project. so i looked into my delicious links and found two very good tutorials, one by Troy Gardner on the TroyWorks blog and another one by Deden Ramadhan on the ini na!! blog.
in the first moment everything worked fine and i had no problems embedding the fonts, loading them and finally using them at runtime. i like how it works!
some days later i had to embed cyrillic, chinese and japanese characters from an ArialUnicodeMS.ttf font. then i always got the error message: “Error: Unable to transcode ArialUnicodeMS.ttf.”, at compile time. the first idea was that there’s something wrong with the ArialUnicodeMS.ttf file, because it works fine with other font files. so i tried another ArialUnicodeMS.ttf file from a colleague, but the result was the same error message. using google wasn’t that much successful, but i got a hint from a colleague that
flex includes several font managers to handle embedded fonts, exactly three. here you can find some informations about the three managers in the livedocs.
so the solution for my problem was to use the flash.fonts.AFEFontManager and everything works fine. to change the font manager you can simply use the compiler argument:
-managers flash.fonts.AFEFontManager
for your mxmlc compiler.
hey guys, last week i needed to pause several timers and resume them later on. i ran into a problem which i try to explain in an little example.
so let’s say you start a Timer with 1000 milliseconds delay and stop it after 600 milliseconds. if you call Timer.start() again, it starts with a new delay of 1000 milliseconds again. there is no built-in possibility to resume the timer for the remaining 400 milliseconds. i thought “nothing easier than that, just call Timer.pause()”. but there was no such method, so i decided to write my own ExtendedTimer class and add the pause functionality. now i like to share it with you…
> ExtendedTimer.as
package com.fjakobs.utils
{
import flash.events.TimerEvent;
import flash.utils.Timer;
/**
* @author fjakobs
*/
public class ExtendedTimer extends Timer
{
private var _startTime : Number;
private var _initialDelay : Number;
private var _paused : Boolean = false;
public function ExtendedTimer(delay : Number,
repeatCount : int = 0)
{
super(delay, repeatCount);
_initialDelay = delay;
addEventListener(TimerEvent.TIMER,
onTimer,false,0,true);
}
private function onTimer(event : TimerEvent) : void
{
_startTime = new Date().time;
delay = _initialDelay;
}
override public function start() : void
{
if(currentCount < repeatCount)
{
_paused = false;
_startTime = new Date().time;
super.start();
}
}
public function pause() : void
{
if(running)
{
_paused = true;
stop();
delay = delay - (new Date().time - _startTime);
}
}
public function get paused() : Boolean
{
return _paused;
}
public function get initialDelay() : Number
{
return _initialDelay;
}
}
}
hey guys,
the next flexughh-meeting was announced yesterday. it’ll take place on august 25th, 7:30pm in the holy halls of elephantseven. the great company i’m working for and which helps to realize this meeting.
Marco Kaiser will tell us something about twhirl. twhirl is a social software desktop client, based on the Adobe AIR platform.
for more infomation and registration please visit the <flexughh:Blog/>…
the great tool “FCSH-Wrapper” is from now on called “BigSource Zarkov”. the developers decided to rename it, because they are planning to add support of other compilers than mxmlc and the flash compiler shell (FCSH). they allready added support for the AS2 compiler mtasc. for more detailed information visit the developers blog on http://blog.bigsource.de…
eclipse update url http://update.bigsource.de/update
yesterday two very good buddies from BigSource released their FCSH Wrapper plugin for eclipse. i was one of the first beta testers and i have to say that it’s a great tool for my daily work. the Flex Compiler Shell (short FCSH) is much more faster than the MXMLC compiler, because only the changes in your code and not the whole project is compiled by FCSH.
so get it from http://blog.bigsource.de, use it to compile your flash projects and have more fun at work!!!