<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Compress Transparent PNGs with Flash</title>
	<atom:link href="http://www.blackcj.com/blog/2009/07/24/compress-transparent-pngs-with-flash/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.blackcj.com/blog/2009/07/24/compress-transparent-pngs-with-flash/</link>
	<description>Cutting edge development with Adobe Flex, ActionScript and AIR</description>
	<lastBuildDate>Wed, 01 Sep 2010 12:24:22 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
	<item>
		<title>By: Chris Black</title>
		<link>http://www.blackcj.com/blog/2009/07/24/compress-transparent-pngs-with-flash/comment-page-1/#comment-230</link>
		<dc:creator>Chris Black</dc:creator>
		<pubDate>Tue, 18 Aug 2009 18:29:09 +0000</pubDate>
		<guid isPermaLink="false">http://www.blackcj.com/blog/?p=465#comment-230</guid>
		<description>Awesome. I&#039;ll have to give that a try on my next project. Much easier than setting up a bunch of case statements. Thanks latho!</description>
		<content:encoded><![CDATA[<p>Awesome. I&#8217;ll have to give that a try on my next project. Much easier than setting up a bunch of case statements. Thanks latho!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: latho</title>
		<link>http://www.blackcj.com/blog/2009/07/24/compress-transparent-pngs-with-flash/comment-page-1/#comment-229</link>
		<dc:creator>latho</dc:creator>
		<pubDate>Tue, 18 Aug 2009 18:21:43 +0000</pubDate>
		<guid isPermaLink="false">http://www.blackcj.com/blog/?p=465#comment-229</guid>
		<description>If you create your library, export it to a swc (publish settings)
Add that swc as a library to your as3 project&gt;
Now you can give your constant the value the name of your library classname for ex.:
MY_IMAGE_ID:String = &quot;image_class_libname&quot;

After that you can use reflection to retrieve it from that string.
That way you can skip writing a big case switch for all your assets.

reflection looks like this:

public static function getLibClassInstance(libClassId:String):Class {
	var libClass : Class = getDefinitionByName(libClassId) as Class;
	return new libClass ();
}

usage:

var clazz:Class = MyLib.getLibClassInstance(MyLib.MY_IMAGE_ID);
addChild(Sprite(clazz))

by the way this is example code, untested

cheers,
Latcho</description>
		<content:encoded><![CDATA[<p>If you create your library, export it to a swc (publish settings)<br />
Add that swc as a library to your as3 project&gt;<br />
Now you can give your constant the value the name of your library classname for ex.:<br />
MY_IMAGE_ID:String = &#8220;image_class_libname&#8221;</p>
<p>After that you can use reflection to retrieve it from that string.<br />
That way you can skip writing a big case switch for all your assets.</p>
<p>reflection looks like this:</p>
<p>public static function getLibClassInstance(libClassId:String):Class {<br />
	var libClass : Class = getDefinitionByName(libClassId) as Class;<br />
	return new libClass ();<br />
}</p>
<p>usage:</p>
<p>var clazz:Class = MyLib.getLibClassInstance(MyLib.MY_IMAGE_ID);<br />
addChild(Sprite(clazz))</p>
<p>by the way this is example code, untested</p>
<p>cheers,<br />
Latcho</p>
]]></content:encoded>
	</item>
</channel>
</rss>

<!-- Dynamic Page Served (once) in 0.684 seconds -->
<!-- Cached page served by WP-Cache -->
