<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>percentJuice</title>
	<atom:link href="http://percentjuice.com/?feed=rss2" rel="self" type="application/rss+xml" />
	<link>http://percentjuice.com</link>
	<description>AS3 (flex, flash) development</description>
	<lastBuildDate>Mon, 26 Jul 2010 08:33:14 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>reflection [as3]</title>
		<link>http://percentjuice.com/?p=372</link>
		<comments>http://percentjuice.com/?p=372#comments</comments>
		<pubDate>Sat, 24 Jul 2010 10:21:03 +0000</pubDate>
		<dc:creator>chad</dc:creator>
				<category><![CDATA[Flex]]></category>
		<category><![CDATA[as3]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[describeType]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[reflection]]></category>
		<category><![CDATA[Tech]]></category>
		<category><![CDATA[utils]]></category>

		<guid isPermaLink="false">http://percentjuice.com/?p=372</guid>
		<description><![CDATA[[we're not talking about those mirror-images that were hip in Flash for a year.] reflection allows your code to inspect its own properties, methods, type, parent-type&#8230; . used in recipes including copying xml values to object properties &#038; creating a decorator which extends proxy. I&#8217;m putting useful examples below, in one convient spot. ReflectionUtil.rtf includes: [...]]]></description>
			<content:encoded><![CDATA[<p>[we're not talking about those mirror-images that were hip in Flash for a year.] <a href="http://en.wikipedia.org/wiki/Reflection_(computer_science)">reflection</a> allows your code to inspect its own properties, methods, type, parent-type&#8230; .  used in recipes including copying xml values to object properties &#038; creating a decorator which extends proxy.  I&#8217;m putting useful examples below, in one convient spot.  </p>
<p><a href="http://percentjuice.com/wp-content/uploads/2010/07/ReflectionUtil.rtf" target="_blank">ReflectionUtil.rtf</a> includes:</p>
<p>inspecting an Object internally</p>
<ul>
<li>returning the public instance properties/methods of an Object.</li>
<li>copying/duplicating public instance properties between Objects. </li>
</ul>
<div class="codecolorer-container actionscript3 blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;height:380px;"><div class="actionscript3 codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #009900; font-style: italic;">//----------------------------------------------------------------------------</span><br />
<span style="color: #009900; font-style: italic;">// &nbsp;Methods which inspect the public instance properties/methods of an Object</span><br />
<span style="color: #009900; font-style: italic;">//----------------------------------------------------------------------------</span><br />
<br />
<span style="color: #3f5fbf;">/**<br />
&nbsp;* locates the public props of $obj<br />
&nbsp;* @param $obj: the object to inspect.<br />
&nbsp;* @param nodeName: 'variable' grabs properties, 'method' grabs methods<br />
&nbsp;* @return: dictionary of nodes in $obj identified by nodeName<br />
&nbsp;*/</span><br />
<span style="color: #0033ff; font-weight: bold;">public</span> static const VARIABLE<span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">String</span> = <span style="color: #990000;">'variable'</span><span style="color: #000066; font-weight: bold;">;</span><br />
<span style="color: #0033ff; font-weight: bold;">public</span> static const METHOD<span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">String</span> = <span style="color: #990000;">'method'</span><span style="color: #000066; font-weight: bold;">;</span><br />
<span style="color: #0033ff; font-weight: bold;">public</span> static <span style="color: #339966; font-weight: bold;">function</span> findPublic<span style="color: #000000;">&#40;</span>$obj<span style="color: #000066; font-weight: bold;">:*,</span> <span style="color: #004993;">nodeName</span><span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">String</span>=VARIABLE<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">Dictionary</span><br />
<span style="color: #000000;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #6699cc; font-weight: bold;">var</span> dict<span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">Dictionary</span> = <span style="color: #0033ff; font-weight: bold;">new</span> <span style="color: #004993;">Dictionary</span><span style="color: #000000;">&#40;</span><span style="color: #0033ff; font-weight: bold;">true</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span><br />
&nbsp; &nbsp; <span style="color: #6699cc; font-weight: bold;">var</span> nodeList<span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">XMLList</span><span style="color: #000066; font-weight: bold;">;</span><br />
&nbsp; &nbsp; <span style="color: #0033ff; font-weight: bold;">switch</span> <span style="color: #000000;">&#40;</span><span style="color: #004993;">nodeName</span><span style="color: #000000;">&#41;</span><br />
&nbsp; &nbsp; <span style="color: #000000;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0033ff; font-weight: bold;">case</span> VARIABLE<span style="color: #000066; font-weight: bold;">:</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; nodeList = <span style="color: #004993;">describeType</span><span style="color: #000000;">&#40;</span>$obj<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">..</span>variable<span style="color: #000066; font-weight: bold;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0033ff; font-weight: bold;">break</span><span style="color: #000066; font-weight: bold;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0033ff; font-weight: bold;">case</span> METHOD<span style="color: #000066; font-weight: bold;">:</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; nodeList = <span style="color: #004993;">describeType</span><span style="color: #000000;">&#40;</span>$obj<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">..</span><span style="color: #004993;">method</span><span style="color: #000066; font-weight: bold;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0033ff; font-weight: bold;">break</span><span style="color: #000066; font-weight: bold;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0033ff; font-weight: bold;">default</span><span style="color: #000066; font-weight: bold;">:</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0033ff; font-weight: bold;">throw</span> <span style="color: #0033ff; font-weight: bold;">new</span> <span style="color: #004993;">Error</span><span style="color: #000000;">&#40;</span><span style="color: #990000;">'node label is not handled.'</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span><br />
&nbsp; &nbsp; <span style="color: #000000;">&#125;</span><br />
&nbsp; &nbsp; <span style="color: #6699cc; font-weight: bold;">var</span> n<span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">int</span>=nodeList<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">length</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span><br />
&nbsp; &nbsp; <span style="color: #0033ff; font-weight: bold;">for</span><span style="color: #000000;">&#40;</span><span style="color: #6699cc; font-weight: bold;">var</span> i<span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">int</span> = <span style="color: #000000; font-weight:bold;">0</span><span style="color: #000066; font-weight: bold;">;</span> i <span style="color: #000066; font-weight: bold;">&lt;</span> n<span style="color: #000066; font-weight: bold;">;</span> i<span style="color: #000066; font-weight: bold;">++</span><span style="color: #000000;">&#41;</span><br />
&nbsp; &nbsp; <span style="color: #000000;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; dict<span style="color: #000000;">&#91;</span><span style="color: #004993;">String</span><span style="color: #000000;">&#40;</span>nodeList<span style="color: #000000;">&#91;</span>i<span style="color: #000000;">&#93;</span><span style="color: #000066; font-weight: bold;">.</span>@<span style="color: #004993;">name</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#93;</span> = <span style="color: #0033ff; font-weight: bold;">true</span><span style="color: #000066; font-weight: bold;">;</span><br />
&nbsp; &nbsp; <span style="color: #000000;">&#125;</span><br />
&nbsp; &nbsp; nodeList = <span style="color: #0033ff; font-weight: bold;">null</span><span style="color: #000066; font-weight: bold;">;</span><br />
&nbsp; &nbsp; <span style="color: #0033ff; font-weight: bold;">return</span> dict<span style="color: #000066; font-weight: bold;">;</span><br />
<span style="color: #000000;">&#125;</span><br />
<br />
<span style="color: #3f5fbf;">/**<br />
&nbsp;* sets public properties of parent object equal to matching properties of $obj<br />
&nbsp;* @param $obj: object whose matching name/type properties will be <br />
&nbsp;* &nbsp; &nbsp;duplicated (primitives) or pointed to (complex data types)<br />
&nbsp;* @param cloneData<br />
&nbsp;*/</span><br />
<span style="color: #0033ff; font-weight: bold;">public</span> static <span style="color: #339966; font-weight: bold;">function</span> propsFromObject<span style="color: #000000;">&#40;</span>copyFrom<span style="color: #000066; font-weight: bold;">:*,</span> copyTo<span style="color: #000066; font-weight: bold;">:*,</span> cloneData<span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">Boolean</span>=<span style="color: #0033ff; font-weight: bold;">false</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">:</span><span style="color: #0033ff; font-weight: bold;">void</span><br />
<span style="color: #000000;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #6699cc; font-weight: bold;">var</span> varList<span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">XMLList</span> = <span style="color: #004993;">describeType</span><span style="color: #000000;">&#40;</span>copyTo<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">..</span>variable<span style="color: #000066; font-weight: bold;">;</span><br />
&nbsp; &nbsp; <span style="color: #6699cc; font-weight: bold;">var</span> n<span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">int</span>=varList<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">length</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span><br />
&nbsp; &nbsp; <span style="color: #0033ff; font-weight: bold;">for</span><span style="color: #000000;">&#40;</span><span style="color: #6699cc; font-weight: bold;">var</span> i<span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">int</span>=<span style="color: #000000; font-weight:bold;">0</span><span style="color: #000066; font-weight: bold;">;</span> i <span style="color: #000066; font-weight: bold;">&lt;</span> n<span style="color: #000066; font-weight: bold;">;</span> i<span style="color: #000066; font-weight: bold;">++</span><span style="color: #000000;">&#41;</span><br />
&nbsp; &nbsp; <span style="color: #000000;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #6699cc; font-weight: bold;">var</span> prop<span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">String</span> = <span style="color: #004993;">String</span><span style="color: #000000;">&#40;</span>varList<span style="color: #000000;">&#91;</span>i<span style="color: #000000;">&#93;</span><span style="color: #000066; font-weight: bold;">.</span>@<span style="color: #004993;">name</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0033ff; font-weight: bold;">if</span> <span style="color: #000000;">&#40;</span>copyFrom<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">hasOwnProperty</span><span style="color: #000000;">&#40;</span>prop<span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; copyTo<span style="color: #000000;">&#91;</span>prop<span style="color: #000000;">&#93;</span> = <span style="color: #000000;">&#40;</span>cloneData<span style="color: #000000;">&#41;</span> <span style="color: #000066; font-weight: bold;">?</span> returnNewRef<span style="color: #000000;">&#40;</span>copyFrom<span style="color: #000000;">&#91;</span>prop<span style="color: #000000;">&#93;</span><span style="color: #000066; font-weight: bold;">,</span> varList<span style="color: #000000;">&#91;</span>i<span style="color: #000000;">&#93;</span><span style="color: #000066; font-weight: bold;">.</span>@<span style="color: #004993;">type</span><span style="color: #000000;">&#41;</span> <span style="color: #000066; font-weight: bold;">:</span> copyFrom<span style="color: #000000;">&#91;</span>prop<span style="color: #000000;">&#93;</span><span style="color: #000066; font-weight: bold;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#125;</span><br />
&nbsp; &nbsp; <span style="color: #000000;">&#125;</span><br />
&nbsp; &nbsp; varList=<span style="color: #0033ff; font-weight: bold;">null</span><span style="color: #000066; font-weight: bold;">;</span><br />
<span style="color: #000000;">&#125;</span><br />
<br />
<span style="color: #3f5fbf;">/**<br />
&nbsp;* used by propsFromObject if a new instance of the copied property is desired.<br />
&nbsp;* create additional cases as needed.<br />
&nbsp;* @param prop: the value being duplicated<br />
&nbsp;* @param type: the value's type<br />
&nbsp;* @return: a new instance of the value<br />
&nbsp;* @throws Error: if attempting to duplicate an Object which is not handled<br />
&nbsp;*/</span><br />
<span style="color: #0033ff; font-weight: bold;">private</span> static <span style="color: #339966; font-weight: bold;">function</span> returnNewRef<span style="color: #000000;">&#40;</span>prop<span style="color: #000066; font-weight: bold;">:*,</span> <span style="color: #004993;">type</span><span style="color: #000066; font-weight: bold;">:*</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">:*</span><br />
<span style="color: #000000;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #6699cc; font-weight: bold;">var</span> cloneProp<span style="color: #000066; font-weight: bold;">:*;</span><br />
&nbsp; &nbsp; <span style="color: #0033ff; font-weight: bold;">switch</span> <span style="color: #000000;">&#40;</span><span style="color: #004993;">String</span><span style="color: #000000;">&#40;</span><span style="color: #004993;">type</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><br />
&nbsp; &nbsp; <span style="color: #000000;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0033ff; font-weight: bold;">case</span> <span style="color: #990000;">&quot;Array&quot;</span><span style="color: #000066; font-weight: bold;">:</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; cloneProp = <span style="color: #0033ff; font-weight: bold;">new</span> <span style="color: #004993;">Array</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">concat</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#40;</span>prop <span style="color: #0033ff; font-weight: bold;">as</span> <span style="color: #004993;">Array</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0033ff; font-weight: bold;">break</span><span style="color: #000066; font-weight: bold;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0033ff; font-weight: bold;">case</span> <span style="color: #990000;">&quot;flash.display::Bitmap&quot;</span><span style="color: #000066; font-weight: bold;">:</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; cloneProp = <span style="color: #0033ff; font-weight: bold;">new</span> <span style="color: #004993;">Bitmap</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#40;</span>prop <span style="color: #0033ff; font-weight: bold;">as</span> <span style="color: #004993;">Bitmap</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">bitmapData</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0033ff; font-weight: bold;">break</span><span style="color: #000066; font-weight: bold;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0033ff; font-weight: bold;">case</span> <span style="color: #990000;">&quot;Number&quot;</span><span style="color: #000066; font-weight: bold;">:</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0033ff; font-weight: bold;">case</span> <span style="color: #990000;">&quot;int&quot;</span><span style="color: #000066; font-weight: bold;">:</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0033ff; font-weight: bold;">case</span> <span style="color: #990000;">&quot;uint&quot;</span><span style="color: #000066; font-weight: bold;">:</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0033ff; font-weight: bold;">case</span> <span style="color: #990000;">&quot;String&quot;</span><span style="color: #000066; font-weight: bold;">:</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0033ff; font-weight: bold;">case</span> <span style="color: #990000;">&quot;Boolean&quot;</span><span style="color: #000066; font-weight: bold;">:</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0033ff; font-weight: bold;">case</span> <span style="color: #990000;">&quot;Null&quot;</span><span style="color: #000066; font-weight: bold;">:</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0033ff; font-weight: bold;">case</span> <span style="color: #990000;">&quot;void&quot;</span><span style="color: #000066; font-weight: bold;">:</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; cloneProp = prop<span style="color: #000066; font-weight: bold;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0033ff; font-weight: bold;">break</span><span style="color: #000066; font-weight: bold;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0033ff; font-weight: bold;">default</span><span style="color: #000066; font-weight: bold;">:</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0033ff; font-weight: bold;">throw</span> <span style="color: #0033ff; font-weight: bold;">new</span> <span style="color: #004993;">Error</span><span style="color: #000000;">&#40;</span><span style="color: #990000;">'returnNewRef:: create instantiation for '</span><span style="color: #000066; font-weight: bold;">+</span><span style="color: #004993;">type</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span><br />
&nbsp; &nbsp; <span style="color: #000000;">&#125;</span><br />
&nbsp; &nbsp; <span style="color: #0033ff; font-weight: bold;">return</span> cloneProp<span style="color: #000066; font-weight: bold;">;</span><br />
<span style="color: #000000;">&#125;</span></div></div>
<p>inspecting an Object type</p>
<ul>
<li>checking whether two Objects are the same type</li>
<li>checking whether an Object extends another</li>
</ul>
<div class="codecolorer-container actionscript3 blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;height:380px;"><div class="actionscript3 codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #009900; font-style: italic;">//--------------------------------------</span><br />
<span style="color: #009900; font-style: italic;">// &nbsp;Methods which inspect Class names</span><br />
<span style="color: #009900; font-style: italic;">//--------------------------------------</span><br />
<br />
<span style="color: #3f5fbf;">/**<br />
&nbsp;* checks whether two classes are of the same type<br />
&nbsp;* @param compareThis<br />
&nbsp;* @param toThis<br />
&nbsp;* @return<br />
&nbsp;*/</span><br />
<span style="color: #0033ff; font-weight: bold;">public</span> static <span style="color: #339966; font-weight: bold;">function</span> getIsSameType<span style="color: #000000;">&#40;</span>compareThis<span style="color: #000066; font-weight: bold;">:*,</span>toThis<span style="color: #000066; font-weight: bold;">:*</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">Boolean</span><br />
<span style="color: #000000;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #0033ff; font-weight: bold;">return</span> <span style="color: #000000;">&#40;</span>getClassName<span style="color: #000000;">&#40;</span>compareThis<span style="color: #000000;">&#41;</span> == getClassName<span style="color: #000000;">&#40;</span>toThis<span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span><br />
<span style="color: #000000;">&#125;</span><br />
<br />
<span style="color: #3f5fbf;">/**<br />
&nbsp;* @param classIn<br />
&nbsp;* @return: the class name as String<br />
&nbsp;*/</span><br />
<span style="color: #0033ff; font-weight: bold;">public</span> static <span style="color: #339966; font-weight: bold;">function</span> getClassName<span style="color: #000000;">&#40;</span>classIn<span style="color: #000066; font-weight: bold;">:*</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">String</span><br />
<span style="color: #000000;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #009966; font-style: italic;">/* === flash.utils.getQualifiedClassName(classIn).split(&quot;::&quot;)[1] */</span><br />
&nbsp; &nbsp; <span style="color: #0033ff; font-weight: bold;">return</span> <span style="color: #004993;">describeType</span><span style="color: #000000;">&#40;</span>classIn<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">.</span>@<span style="color: #004993;">name</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">split</span><span style="color: #000000;">&#40;</span><span style="color: #990000;">&quot;::&quot;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#91;</span><span style="color: #000000; font-weight:bold;">1</span><span style="color: #000000;">&#93;</span><span style="color: #000066; font-weight: bold;">;</span><br />
<span style="color: #000000;">&#125;</span><br />
<br />
<span style="color: #3f5fbf;">/**<br />
&nbsp;* checks whether one class is a child of another<br />
&nbsp;* @param doesThis: the possible child<br />
&nbsp;* @param extendThis: the possible parent<br />
&nbsp;* @return<br />
&nbsp;*/</span><br />
<span style="color: #0033ff; font-weight: bold;">public</span> static <span style="color: #339966; font-weight: bold;">function</span> getDoesExtend<span style="color: #000000;">&#40;</span>doesThis<span style="color: #000066; font-weight: bold;">:*,</span>extendThis<span style="color: #000066; font-weight: bold;">:*</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">Boolean</span><br />
<span style="color: #000000;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #6699cc; font-weight: bold;">var</span> doesExtend<span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">Boolean</span>=<span style="color: #0033ff; font-weight: bold;">false</span><span style="color: #000066; font-weight: bold;">;</span><br />
&nbsp; &nbsp; <span style="color: #6699cc; font-weight: bold;">var</span> extendsL<span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">XMLList</span> = <span style="color: #004993;">describeType</span><span style="color: #000000;">&#40;</span>doesThis<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">.</span>extendsClass<span style="color: #000066; font-weight: bold;">;</span><br />
&nbsp; &nbsp; <span style="color: #6699cc; font-weight: bold;">var</span> toThisClassName<span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">String</span> = getClassName<span style="color: #000000;">&#40;</span>extendThis<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span><br />
&nbsp; &nbsp; <span style="color: #0033ff; font-weight: bold;">for</span> <span style="color: #0033ff; font-weight: bold;">each</span><span style="color: #000000;">&#40;</span> <span style="color: #6699cc; font-weight: bold;">var</span> i<span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">XML</span> <span style="color: #0033ff; font-weight: bold;">in</span> extendsL<span style="color: #000000;">&#41;</span><br />
&nbsp; &nbsp; <span style="color: #000000;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0033ff; font-weight: bold;">if</span> <span style="color: #000000;">&#40;</span>i<span style="color: #000066; font-weight: bold;">.</span>@<span style="color: #004993;">type</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">split</span><span style="color: #000000;">&#40;</span><span style="color: #990000;">&quot;::&quot;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#91;</span><span style="color: #000000; font-weight:bold;">1</span><span style="color: #000000;">&#93;</span>==toThisClassName<span style="color: #000000;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; doesExtend=<span style="color: #0033ff; font-weight: bold;">true</span><span style="color: #000066; font-weight: bold;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0033ff; font-weight: bold;">break</span><span style="color: #000066; font-weight: bold;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#125;</span><br />
&nbsp; &nbsp; <span style="color: #000000;">&#125;</span><br />
&nbsp; &nbsp; extendsL=<span style="color: #0033ff; font-weight: bold;">null</span><span style="color: #000066; font-weight: bold;">;</span><br />
&nbsp; &nbsp; <span style="color: #0033ff; font-weight: bold;">return</span> doesExtend<span style="color: #000066; font-weight: bold;">;</span><br />
<span style="color: #000000;">&#125;</span></div></div>
]]></content:encoded>
			<wfw:commentRss>http://percentjuice.com/?feed=rss2&amp;p=372</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Robotlegs with BulkLoader. XML asset injection.</title>
		<link>http://percentjuice.com/?p=300</link>
		<comments>http://percentjuice.com/?p=300#comments</comments>
		<pubDate>Sun, 17 Jan 2010 14:11:58 +0000</pubDate>
		<dc:creator>chad</dc:creator>
				<category><![CDATA[Flex]]></category>
		<category><![CDATA[as3]]></category>
		<category><![CDATA[BulkLoader]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[injection]]></category>
		<category><![CDATA[Robotlegs]]></category>
		<category><![CDATA[XML]]></category>

		<guid isPermaLink="false">http://percentjuice.com/?p=300</guid>
		<description><![CDATA[as a trainload of contrast to my last post, I&#8217;m playing with Robots. I created an integration of BulkLoader &#038; Robotlegs. assets are grouped as specified in the accompanying assetsLoaded.xml. asset groups are loaded/unloaded on request, using Robotlegs commands. read more @ the project wiki. download the source @ github. view the demo that&#8217;s included [...]]]></description>
			<content:encoded><![CDATA[<p>as a trainload of contrast to my last post, I&#8217;m playing with Robots.  I created an integration of <a href="http://code.google.com/p/bulk-loader/">BulkLoader</a> &#038; <a href="http://www.robotlegs.org/">Robotlegs</a>.  assets are grouped as specified in the accompanying assetsLoaded.xml.  asset groups are loaded/unloaded on request, using Robotlegs commands.</p>
<ul>
read more @ the <a href="http://wiki.github.com/percentjuice/bulkylegs/">project wiki</a>.<br />
download the source @ <a href="http://github.com/percentjuice/bulkylegs">github</a>.<br />
view the demo that&#8217;s included in the source @ <a href="http://percentjuice.com/wp-content/uploads/2010/04/bulkylegs/bulkyLegs.html">percentjuice</a>.
</ul>
]]></content:encoded>
			<wfw:commentRss>http://percentjuice.com/?feed=rss2&amp;p=300</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>observer pattern as MVC enabler</title>
		<link>http://percentjuice.com/?p=275</link>
		<comments>http://percentjuice.com/?p=275#comments</comments>
		<pubDate>Sun, 06 Dec 2009 22:02:56 +0000</pubDate>
		<dc:creator>chad</dc:creator>
				<category><![CDATA[as3]]></category>
		<category><![CDATA[design patterns]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[observer pattern]]></category>
		<category><![CDATA[publisher]]></category>
		<category><![CDATA[subscriber]]></category>

		<guid isPermaLink="false">http://percentjuice.com/?p=275</guid>
		<description><![CDATA[I had been building variations of MVC without implementing the Observer pattern. Now having studied Observer, I realize how to do MVC properly. MVC without Observer is like NATO without formal delegates. You&#8217;d let every citizen in every nation contact every other directly. We want our model to publish to a group of subscribers. Flex [...]]]></description>
			<content:encoded><![CDATA[<p>I had been building variations of MVC without implementing the Observer pattern.  Now having studied Observer, I realize how to do MVC properly.  </p>
<p>MVC without Observer is like NATO without formal delegates.  You&#8217;d let every citizen in every nation contact every other directly.</p>
<p>We want our model to publish to a group of subscribers.  Flex bindings can pull this off.  Consider, however: </p>
<ol>
<li>Encapsulation recommends, and modularization implies, that not every class directly accesses every other.  (Beware of EventBroadcaster use &#038; Singleton abuse.)</li>
<li>While you have a handful of models with a slew of listeners, EventListeners are firing constantly, listening for changes.  This will affect memory consumption.</li>
</ol>
<p>Observer allows for an easily-readable, encapsulated, relationship between Model and View.  Your model extends a Publisher class.  Publisher has a function which adds subscribers to its subscriber Array.  The Publisher class also has a function to notify its group of subscribers.  The Publisher knows that any Object which subscribes will implement the Subscriber class.</p>
<p>Views which require Model/Publisher data extend a Subscriber class.  The parent Subscriber is a good place to declare your static constant strings &#8212; these describe data groups.  (Having these outside the model better supports encapsulation, but I&#8217;ve seen them in the model in other examples.)  Each Subscriber child has an Array which notes the data groups the Subscriber is interested in.  Each Subscriber has an update function which is called by the Publisher when it sends data.  </p>
<p>A third class keeps things organized and readable.  It&#8217;s there you subscribe the Views to their Model or Models.  </p>
<p>I searched for similar AS3 Observer implementation examples online and found but <a href="http://www.addicted2flash.com/2008/08/extended-observer-pattern/" target="_blank">one</a>.   Hope my example helps your code find its way.</p>
<ul>
<li><a href="http://percentjuice.com/wp-content/uploads/2009/12/APublisher.rtf">APublisher.rtf</a></li>
<li><a href="http://percentjuice.com/wp-content/uploads/2009/12/ASubscriber.rtf">ASubscriber.rtf</a></li>
<li><a href="http://percentjuice.com/wp-content/uploads/2009/12/AObserverMediator.rtf"> AObserverMediator.rtf</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://percentjuice.com/?feed=rss2&amp;p=275</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>horizontal accordion component [as3]</title>
		<link>http://percentjuice.com/?p=268</link>
		<comments>http://percentjuice.com/?p=268#comments</comments>
		<pubDate>Sat, 28 Mar 2009 07:46:57 +0000</pubDate>
		<dc:creator>chad</dc:creator>
				<category><![CDATA[as3]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[horizontal accordion]]></category>
		<category><![CDATA[TextInput]]></category>

		<guid isPermaLink="false">http://percentjuice.com/?p=268</guid>
		<description><![CDATA[Built a Horizontal Accordion component for the Boys &#038; Girls Club. The Horizontal Accordion is made of different Panels, each of which automatically tab-order their child Sprites. Many Panels contain Text Input fields. Each Text Input field includes a Flex-style means to add Validation. &#8230; There&#8217;s other less-cool stuff being done all over the place [...]]]></description>
			<content:encoded><![CDATA[<p>Built a Horizontal Accordion component for the Boys &#038; Girls Club.  The Horizontal Accordion is made of different Panels, each of which automatically tab-order their child Sprites.  Many Panels contain Text Input fields.  Each Text Input field includes a Flex-style means to add Validation.  &#8230; There&#8217;s other less-cool stuff being done all over the place too.</p>
<p>Am posting the major classes.  All code will relate specifically to the blue Horizontal Accordion  <a href="http://percentjuice.com/wp-content/uploads/2009/03/wallDemo/wallDemo.html" target="_blank">on the site</a>.</p>
<p>
<a href="http://percentjuice.com/wp-content/uploads/2009/03/wallDemo/HorizontalAccordion.as" target="_blank">view HorizontalAccordion class</a><br />
<a href="http://percentjuice.com/wp-content/uploads/2009/03/wallDemo/HAPanel.as" target="_blank">view HAPanel class</a><br />
<a href="http://percentjuice.com/wp-content/uploads/2009/03/wallDemo/OnStageObject.as" target="_blank">view OnStageObject class</a><br />
<a href="http://percentjuice.com/wp-content/uploads/2009/03/wallDemo/TextInputMod.as" target="_blank">view TextInputMod class</a><br />
<a href="http://percentjuice.com/wp-content/uploads/2009/03/wallDemo/ValidatingObject.as" target="_blank">view ValidatingObject class</a><br />
<a href="http://percentjuice.com/wp-content/uploads/2009/03/wallDemo/Validators.as" target="_blank">view Validators class</a></p>
]]></content:encoded>
			<wfw:commentRss>http://percentjuice.com/?feed=rss2&amp;p=268</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Republican Party: Please stop lying.</title>
		<link>http://percentjuice.com/?p=174</link>
		<comments>http://percentjuice.com/?p=174#comments</comments>
		<pubDate>Thu, 04 Sep 2008 04:33:25 +0000</pubDate>
		<dc:creator>chad</dc:creator>
				<category><![CDATA[Politics]]></category>
		<category><![CDATA[Al-Qaida]]></category>
		<category><![CDATA[Bush]]></category>
		<category><![CDATA[Guiliani]]></category>
		<category><![CDATA[Iraq]]></category>
		<category><![CDATA[Republican]]></category>

		<guid isPermaLink="false">http://percentjuice.com/?p=174</guid>
		<description><![CDATA[Open letter to the Republican Party: Please stop lying. Guiliani made points about Obama&#8217;s experience, and his argument there was on solid footing. Then he said: Look at just one example in a lifetime of principled stands &#8211; John McCain&#8217;s support for the troop surge in Iraq. The Democratic Party had given up on Iraq. [...]]]></description>
			<content:encoded><![CDATA[<p><span style="color: #999999;">Open letter to the Republican Party:</span></p>
<p>Please stop lying.  Guiliani made points about Obama&#8217;s experience, and his argument there was on solid footing.  Then he said:</p>
<blockquote><p><span style="color: #808080;">Look at just one example in a lifetime of principled stands &#8211; John McCain&#8217;s support for the troop surge in Iraq. The Democratic Party had given up on Iraq. And I believe, ladies and gentlemen, that when they gave up on Iraq they were giving up on America. The Democratic leader in the Senate said so: &#8220;America has lost.&#8221; Well, if America lost, who won? Al-Qaida? Bin Laden? In the single biggest policy decision of this election, John McCain got it right and Barack Obama got it wrong.  <a href="http://www.pbs.org/newshour/bb/politics/july08/guilianaspeech_0903.html" target="_blank"> . . . <span style="font-size: x-small;">full speech</span></a></span></p></blockquote>
<p>Bush told us Iraq had weapons of mass destruction.  He was wrong.  Ever since then, our Republican Party shouts Al-Qaida/Bin Laden and Iraq in the same breath.  There is no connection.  Al-Qaida/Bin Laden were sheltered in a completely different country called Afghanistan.</p>
<p>It&#8217;s easy to prey upon American&#8217;s weak education system, its overworked class is too busy to remember what Bush told it last week.  Have some moral character, though.  Admit you&#8217;re wrong.  Admit our leaders will send people to die if it fills their pocketbooks.  You say you believe in Hell but you act like you can outrun it.</p>
]]></content:encoded>
			<wfw:commentRss>http://percentjuice.com/?feed=rss2&amp;p=174</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>show: A Hawk and a Hacksaw</title>
		<link>http://percentjuice.com/?p=137</link>
		<comments>http://percentjuice.com/?p=137#comments</comments>
		<pubDate>Sat, 26 Jul 2008 22:27:29 +0000</pubDate>
		<dc:creator>chad</dc:creator>
				<category><![CDATA[Art]]></category>
		<category><![CDATA[folk]]></category>
		<category><![CDATA[Hawk and a Hacksaw]]></category>

		<guid isPermaLink="false">http://percentjuice.com/?p=137</guid>
		<description><![CDATA[When I see a heavily Eastern European traditional ensemble, a dirty group of musicians, I always figure on an audience of other musicians. Ever since I worked the art gallery racket, selling mass-produceable hotel art to business majors, I don&#8217;t try selling skill to laypeople. Part of it is that it takes a feel for [...]]]></description>
			<content:encoded><![CDATA[<p>When I see a heavily Eastern European traditional ensemble, a dirty group of musicians, I always figure on an audience of other musicians.  Ever since I worked the art gallery racket, selling mass-produceable hotel art to business majors, I don&#8217;t try selling skill to laypeople.  Part of it is that it takes a feel for something to appreciate it.  That&#8217;s one of the two reasons authors don&#8217;t read Danielle Steele.  The other is that an artist approaches a medium to learn, interact and personally grow.  A housewife wants an escape.  T-Bone Burnett said that music is not for everybody.  By that token life is not for everybody.  If you can&#8217;t handle your life, the entertainment industry offers escape.  And if you&#8217;re hooked on it, death comes quicker.</p>
<p>What I&#8217;m getting to is that these guys are hot.  What floored me was their audience of Indy hipster kids.  Either something revolutionary is tuning the tastes of the cool kids or else it&#8217;s just that Hawk &amp; Hacksaw&#8217;s singer used to be in an Indy rock group.  No matter.  Hawk and a Hacksaw pounded down all the fierce, instinctive  rhythms.  And the throngs began hopping, clogging, clapping.  I want my tribe, clan, and small army.  I want it back from The Man.</p>
]]></content:encoded>
			<wfw:commentRss>http://percentjuice.com/?feed=rss2&amp;p=137</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>on the golden compass</title>
		<link>http://percentjuice.com/?p=128</link>
		<comments>http://percentjuice.com/?p=128#comments</comments>
		<pubDate>Sat, 26 Jul 2008 17:05:35 +0000</pubDate>
		<dc:creator>chad</dc:creator>
				<category><![CDATA[Entertain Us]]></category>
		<category><![CDATA[aslan]]></category>
		<category><![CDATA[faster without armor]]></category>
		<category><![CDATA[Funny]]></category>
		<category><![CDATA[golden compass]]></category>

		<guid isPermaLink="false">http://percentjuice.com/?p=128</guid>
		<description><![CDATA[the golden compass &#8211; the sibs suggested we watch it and i was all like ‘what shit. i don’t want to watch no golden compass.’ and then i tried to think of why the title sounded so familiar anyway and i remembered godiva saying something about a talking polar bear so i agreed to watch [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignleft size-medium wp-image-127" style="margin-left: 0px; margin-right: 8px; border: 0px initial initial;" title="golden compass: riding the bear" src="http://percentjuice.com/wp-content/uploads/2008/07/goldencompass.jpg" alt="" width="200" align="left" />the golden compass &#8211; the sibs suggested we watch it and i was all like ‘what shit. i don’t want to watch no golden compass.’ and then i tried to think of why the title sounded so familiar anyway and i remembered godiva saying something about a talking polar bear so i agreed to watch the movie. it was pretty boring until there was iorek byrnison and then the movie was just awesome. iorek made my insides quiver and it was very much the same feeling when i saw aslan in narnia.</p>
<p>and i fell in love with iorek when he looked at lyra all funnily and said in his sexy hart hart booming voice: you want to ride me? i go faster without armor.</p>
<p>and in my heart, i was mumbling under my breath: yes, i want to ride you! god, get rid of that damn armor then! let me ride you, iorek! i want to ride you!</p>
<p>iorek byrnison is the handsomest polar bear i ever did see and i know when i saw aslan, i said i was going to marry a lion even if it kills me. well, no more. i’m going to marry a polar bear. i will marry a polar bear even if i freeze to death!</p>
<p><span style="font-size: small; font-style: italic;">(found this online and have lost the original posting.  please provide author info if you have it.)</span></p>
]]></content:encoded>
			<wfw:commentRss>http://percentjuice.com/?feed=rss2&amp;p=128</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>object-oriented as2 development</title>
		<link>http://percentjuice.com/?p=39</link>
		<comments>http://percentjuice.com/?p=39#comments</comments>
		<pubDate>Fri, 11 Jul 2008 18:13:55 +0000</pubDate>
		<dc:creator>chad</dc:creator>
				<category><![CDATA[as2]]></category>
		<category><![CDATA[BezierTween]]></category>
		<category><![CDATA[DocumentUtil]]></category>
		<category><![CDATA[event bubbling]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[game]]></category>
		<category><![CDATA[MovieClipBubbler]]></category>
		<category><![CDATA[MovieClips]]></category>
		<category><![CDATA[Tech]]></category>

		<guid isPermaLink="false">http://percentjuice.com/?p=39</guid>
		<description><![CDATA[built a game banner which published to flash 7. requirements included being]]></description>
			<content:encoded><![CDATA[<p>built a game banner which published to flash 7.  requirements included being <130 k with a <100 k second load.  posted it <a href="http://percentjuice.com/wp-content/uploads/2009/03/mrs07178_cannonball_600x600_r11.html">here</a>.</p>
<p>have always used as2 on an as-needed basis, but decided this time to operate on it.  open it up.  see how it works.  or doesn&#8217;t work.  dragged as2 screaming into the year 2008.  into the light.</p>
<p>the utility classes i found, modified, or extended are useful for anyone coming from an object-oriented background:</p>
<ul style="list-style-type:disc">
<li><a href="http://percentjuice.com/wp-content/uploads/2008/07/documentutil.as" target="_blank">DocumentUtil</a> allows you to specify a Document class (aka Main class). :: Ryan Taylor @ boostworthy.com</li>
<li><a href="http://percentjuice.com/wp-content/uploads/2008/07/beziertween.as" target="_blank">BezierTween</a> creates beziers using little phrases that even Flash 7 can compile. :: Felix Turner @ airtightinteractive.com</li>
<li><a href="http://percentjuice.com/wp-content/uploads/2008/07/movieclipbubbler.as" target="_blank">MovieClipBubbler</a> bubbles as2 MC events. it is not simpler to use than an Event Broadcaster.  it does have performance benefits over an Event Broadcaster. :: Ralf Bokelberg @ helpqlodhelp.com</li>
<li><a href="http://percentjuice.com/wp-content/uploads/2008/07/hitbox.as" target="_blank">Hitbox</a> is an essential extension of MovieClipBubbler, at least in concept.  you should take my implementation and twist it to your ends.  using Hitbox avoids having to draw zero-alpha&#8217;d Hit areas on all your MovieClips.  in simplest execution, the MovieClip in your Library links to Hitbox (rt-click/Linkage/&#8217;Export for ActionScript&#8217;/Base Class).</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://percentjuice.com/?feed=rss2&amp;p=39</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>the interface is your friend</title>
		<link>http://percentjuice.com/?p=34</link>
		<comments>http://percentjuice.com/?p=34#comments</comments>
		<pubDate>Sun, 02 Dec 2007 22:37:25 +0000</pubDate>
		<dc:creator>chad</dc:creator>
				<category><![CDATA[UI]]></category>
		<category><![CDATA[form]]></category>
		<category><![CDATA[interface]]></category>
		<category><![CDATA[picnik]]></category>
		<category><![CDATA[registration]]></category>
		<category><![CDATA[Tech]]></category>

		<guid isPermaLink="false">http://percentjuice.com/?p=34</guid>
		<description><![CDATA[picnik has the friendliest registration process i have ever experienced with immediate, intuitive, consistent feedback.]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.picnik.com/" target="_blank">picnik</a> has the friendliest registration process i have ever experienced with immediate, intuitive, consistent feedback.</p>
]]></content:encoded>
			<wfw:commentRss>http://percentjuice.com/?feed=rss2&amp;p=34</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>moxie &amp; me</title>
		<link>http://percentjuice.com/?p=33</link>
		<comments>http://percentjuice.com/?p=33#comments</comments>
		<pubDate>Sun, 02 Dec 2007 21:23:24 +0000</pubDate>
		<dc:creator>chad</dc:creator>
				<category><![CDATA[Flex]]></category>
		<category><![CDATA[bug]]></category>
		<category><![CDATA[MenuBar]]></category>
		<category><![CDATA[moxie]]></category>
		<category><![CDATA[Skinning]]></category>
		<category><![CDATA[Tech]]></category>
		<category><![CDATA[UIComponent]]></category>
		<category><![CDATA[workspace]]></category>

		<guid isPermaLink="false">http://percentjuice.com/?p=33</guid>
		<description><![CDATA[&#8220;moxie &#38; me,&#8221; it sounds like a chick flick. Hell, with the amount of time i spend with Moxie&#8230; Flex Builder 3 (aka &#8220;Moxie&#8221;) Beta 2 is engaged in a user-friendly direction. Unlike my relationships. Adobe is all over their bug database. Moxie&#8217;s current character flaws are worth noting: Pre-Moxie workspaces will act irreverant. Import [...]]]></description>
			<content:encoded><![CDATA[<p>&#8220;moxie &amp; me,&#8221; it sounds like a chick flick.  Hell, with the amount of time i spend with Moxie&#8230;<br />
<br />
Flex Builder 3 (aka &#8220;Moxie&#8221;) Beta 2 is engaged in a user-friendly direction.  Unlike my relationships.  Adobe is all over their <a href="http://bugs.adobe.com/flex/" target="_blank">bug database</a>.  Moxie&#8217;s current character flaws are worth noting:</p>
<ul>
<li>Pre-Moxie workspaces will act irreverant.  Import all old projects into a fresh workspace.</li>
<li>When your project clearly isn&#8217;t building, turn off &#8220;Project/Properties/Flex Compiler/Generate HTML wrapper file.&#8221;  Then click &#8220;Apply&#8221; and turn it on again.  Sometimes it works.  Other times you need to make a new Project.</li>
<p>
</ul>
<p>Not bugs but some tips to save you time:</p>
<ol>
<li>When drawing shapes programmatically: create a UIComponent rather than a Shape, Sprite, or something else that you&#8217;d think would work.</li>
<p></p>
<li>this:
<ul>
<li>
<div class="codecolorer-container text blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">var loader:Loader = new Loader();<br />
var url:URLRequest = new URLRequest(&quot;http://www.helpexamples.com/flash/images/image1.jpg&quot;);<br />
loader.load(url);<br />
this.rawChildren.addChild(loader);</div></div>
</li>
</ul>
<p>is not as correct as this:</p>
<ul>
<li>
<div class="codecolorer-container text blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">var loader:Image = new Image();<br />
loader.load(&quot;http://www.helpexamples.com/flash/images/image1.jpg&quot;);<br />
this.addChild(loader);</div></div>
</li>
</ul>
</li>
</ol>
<p>Skinning the MenuBar points:</p>
<ol>
<li>You can apply styles for the submenu to Menu, including borderSkin, fontSize, paddingLeft, and now <a href="http://labs.adobe.com/technologies/flex/sdk/flex3sdk.html" target="_blank">in build 187191</a> if <a href="https://bugs.adobe.com/jira/browse/SDK-12931" target="_blank">openDuration=0</a>, you can skin showEffect.</li>
<li>The submenu doesn&#8217;t exist until activated from the MenuBar.
<div class="codecolorer-container text blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">myMenuBar.addEventListener(MenuEvent.MENU_SHOW, setSubMenuProperties);</div></div>
<p>You can then alter additional properties and add filters, masks, &#8230;</li>
<li>If your user group is expecting MenuBar RollOver to show the menu, you must play Houdini.  Listen to anyone having a MOUSE_OVER:
<ul>
<li>
<div class="codecolorer-container text blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">menubar.getChildAt(j).addEventListener(MouseEvent.MOUSE_OVER, menuItemRollover);</div></div>
</li>
</ul>
<p>
Redirect the event:</p>
<ul>
<li>
<div class="codecolorer-container text blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">e.target.dispatchEvent(new MouseEvent(MouseEvent.MOUSE_DOWN));</div></div>
</li>
</ul>
</li>
</ol>
</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://percentjuice.com/?feed=rss2&amp;p=33</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
