Archive for the ‘Flash’ Category

AS3 – Loading external font at runtime

Thursday, November 19th, 2009

Loading external fonts in AS3 projects can be really complicated, and there is not a lot of documentation online, except for a few blog posts for Flex.

This article explains in detail how to proceed to load external font files contained in precompiled swf files. The author even provides a FontManager class to easily manage the font registration once it’s loaded.

http://www.betriebsraum.de/blog/2007/06/22/runtime-font-loading-with-as3-flash-cs3-not-flex/

Email validation RegEx

Thursday, October 8th, 2009
1
/[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?/g

Found at http://gskinner.com/RegExr/

AS3 – asfunction equivalent using TextEvent.LINK

Monday, September 14th, 2009
1
2
3
4
5
6
7
var tf:TextField = new TextField();
tf.htmlText = "<a href=\"event:my_custom_text\">This is an HTML link.</a>";
tf.addEventListener(TextEvent.LINK, tf_link_handler);

function tf_link_handler(event:TextEvent):void {
    trace(event.text); // outputs : "my_custom_text"
}

SWFAddress 2.3 and SWFObject 2.2 IE 7 Bug

Tuesday, August 11th, 2009

There seems to be a bug with SWFAddress 2.2 and SWFObject 2.3 in Internet Explorer 7.

When using both libraries, the flashvars passed to the SWFObject don’t go through the swf movie. To overcome this you must revert to either SWFAddress 2.1 or SWFObject 2.2.

The issue has been reported to the SWFObject development team and will be rectified in the next release.

http://code.google.com/p/swfobject/issues/detail?id=338

FlashTracer – Firefox Extension

Monday, August 10th, 2009

This Firefox extension shows the output of the Flash trace method directly in the browser.

http://www.sephiroth.it/firefox/flashtracer/