<?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>Yahoo! Flash (R) Blog &#187; Flash</title>
	<atom:link href="http://www.yswfblog.com/blog/index.php/category/flash/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.yswfblog.com/blog</link>
	<description>News and Articles on Yahoo! Flash Components and Libraries</description>
	<lastBuildDate>Sat, 19 Jun 2010 23:05:10 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>The Knack to Rotating Device Fonts in Flash 10</title>
		<link>http://www.yswfblog.com/blog/2009/05/21/the-knack-to-rotating-dynamic-text-in-flash-10/</link>
		<comments>http://www.yswfblog.com/blog/2009/05/21/the-knack-to-rotating-dynamic-text-in-flash-10/#comments</comments>
		<pubDate>Thu, 21 May 2009 13:00:33 +0000</pubDate>
		<dc:creator>Allen Rabinovich</dc:creator>
				<category><![CDATA[Flash]]></category>
		<category><![CDATA[device fonts]]></category>
		<category><![CDATA[dynamic text]]></category>
		<category><![CDATA[Flash 10]]></category>

		<guid isPermaLink="false">http://www.yswfblog.com/blog/?p=245</guid>
		<description><![CDATA[ In Flash Player 10, Adobe developers added a great new feature: the ability to rotate dynamic text generated using device fonts already present on the user&#8217;s machine, not the fonts embedded in the SWF. However, using this feature is a bit tricky, and we&#8217;ll describe two possible methods here.
Rotating device fonts is quite useful [...]]]></description>
			<content:encoded><![CDATA[<p><script src="http://us.js2.yimg.com/us.js.yimg.com/lib/flash/swfobject/1.0/swfobject.js" type="text/javascript"></script> In Flash Player 10, Adobe developers added a great new feature: the ability to rotate dynamic text generated using device fonts already present on the user&#8217;s machine, not the fonts embedded in the SWF. However, using this feature is a bit tricky, and we&#8217;ll describe two possible methods here.</p>
<p>Rotating device fonts is quite useful in many applications (as labels on a <a href="http://developer.yahoo.com/yui/charts" target="_blank">Chart</a>, for example), and not embedding the fonts is essential to keeping the SWFs small and taking advantage of the internationalization already built into the user&#8217;s system.  In previous versions of the Flash player, rotating dynamic text was only possible if the <strong><code>Sprite</code></strong> containing a dynamic <strong><code>TextField</code></strong> was first copied into a <strong><code>Bitmap</code></strong> object, and then rotated. This somewhat &#8220;hacky&#8221; approach produced results, albeit not very visually pleasing ones.</p>
<p>In the new Flash player, the new feature is not as simple as modifying the <strong><code>TextField.rotation</code></strong> property — if you set <strong><code>rotation</code></strong> of a TextField to anything other than 0, your text will disappear, just as in previous versions of the player. Instead, there are two new methods of producing rotated text — let&#8217;s look at both of them, and then discuss their advantages and disadvantages:</p>
<div id="TextRotation">The latest version of <a href="http://www.adobe.com/go/getflashplayer">Flash Player</a> is not installed or JavaScript is not enabled. Unable to display SWF content.</div>
<p><script type="text/javascript"><!--
var swfobj = new SWFObject( "http://www.yswfblog.com/blog/wp-content/uploads/2009/05/texttest.swf", "TextRotationOld", "530", "230", "10.0.0" );
swfobj.addParam("scale", "noscale");
swfobj.write( "TextRotation" );
// --></script></p>
<p><strong>The first method</strong>, used in the top row in the example above, simply modifies the <strong><code>rotationZ</code></strong> property of the <strong><code>TextField</code></strong>. This property, newly introduced in player 10, is generally used to rotate display objects in 3D space; however, rotation in Z-plane is mathematically equivalent to the regular, flat rotation. In some sense, it behaves similarly to the &#8220;old&#8221; method of rotating dynamic text: it first caches text as a bitmap, and only then rotates it. You can ascertain its bitmap nature by simply zooming in on the SWF: you&#8217;ll see the obvious pixelation around the edges of the text.<br />
Depending on the <strong>end user&#8217;s</strong> platform (Windows, OS X or Linux), this method may actually produce better-looking results for small to medium font sizes. It&#8217;s also quite simple to use — there is only one property to modify.</p>
<p><strong>The second method</strong> (used for the bottom row) is using new native AS3 class, called <strong><code>TextBlock</code></strong>. Part of the new <strong><code>flash.text.engine</code></strong> package, <strong><code>TextBlock</code></strong> allows you to generate a special kind of <strong><code>DisplayObject</code></strong>, called <strong><code>TextLine</code></strong>, which can be subjected to all standard <strong><code>DisplayObject</code></strong> transformations.</p>
<p>This method is a bit more involved, because <strong><code>TextLines </code></strong>cannot be instantiated on their own — you have to use the factory within <strong><code>TextBlock</code></strong> to generate them. This method also behaves somewhat differently on different platforms. I have given it a cursory test on OS X and Windows XP, and it appears that on OS X, all but the smallest <strong><code>TextLines</code></strong> are anti-aliased properly. On Windows, however, some of the medium-size lines come out looking very jagged, whereas the smallest and largest font sizes are properly anti-aliased. Of course, another thing to note with this method is that it preserves font glyphs as vector objects: if you zoom in on the SWF, you&#8217;ll see that they remain sharp and anti-aliased.</p>
<p>There&#8217;s a lot more investigating to do with these two methods, but I hope this will be a good start for you. The code for the example is below.</p>
<p><span id="more-245"></span></p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;">package <span style="color: #66cc66;">&#123;</span>
<span style="color: #0066CC;">import</span> flash.<span style="color: #006600;">display</span>.<span style="color: #006600;">Sprite</span>;
<span style="color: #0066CC;">import</span> flash.<span style="color: #0066CC;">text</span>.<span style="color: #0066CC;">TextField</span>;
<span style="color: #0066CC;">import</span> flash.<span style="color: #0066CC;">text</span>.<span style="color: #0066CC;">TextFormat</span>;
<span style="color: #0066CC;">import</span> flash.<span style="color: #0066CC;">text</span>.<span style="color: #006600;">engine</span>.<span style="color: #66cc66;">*</span>;
&nbsp;
<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">class</span> TextTest <span style="color: #0066CC;">extends</span> Sprite <span style="color: #66cc66;">&#123;</span>
&nbsp;
<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> TextTest <span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
&nbsp;
<span style="color: #b1b100;">for</span> <span style="color: #66cc66;">&#40;</span><span style="color: #000000; font-weight: bold;">var</span> i:<span style="color: #0066CC;">int</span> = <span style="color: #cc66cc;">0</span>; i <span style="color: #66cc66;">&amp;</span>lt;= <span style="color: #cc66cc;">20</span>; i++<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">var</span> txt:<span style="color: #0066CC;">TextField</span> = <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #0066CC;">TextField</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
	txt.<span style="color: #0066CC;">selectable</span> = <span style="color: #000000; font-weight: bold;">false</span>;
	txt.<span style="color: #0066CC;">width</span> = <span style="color: #cc66cc;">300</span>;
	txt.<span style="color: #0066CC;">height</span> = <span style="color: #cc66cc;">100</span>;
	txt.<span style="color: #0066CC;">text</span> = <span style="color: #ff0000;">&quot;Hello world!&quot;</span>;
	txt.<span style="color: #0066CC;">setTextFormat</span><span style="color: #66cc66;">&#40;</span><span style="color: #000000; font-weight: bold;">new</span> <span style="color: #0066CC;">TextFormat</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;Georgia&quot;</span>, <span style="color: #cc66cc;">2</span> + <span style="color: #cc66cc;">2</span><span style="color: #66cc66;">*</span>i<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
	txt.<span style="color: #006600;">x</span> = <span style="color: #cc66cc;">6</span><span style="color: #66cc66;">*</span><span style="color: #66cc66;">&#40;</span>i<span style="color: #66cc66;">*</span><span style="color: #66cc66;">&#40;</span>i+<span style="color: #cc66cc;">1</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">/</span><span style="color: #cc66cc;">2</span><span style="color: #66cc66;">&#41;</span>;
	txt.<span style="color: #006600;">y</span> = <span style="color: #cc66cc;">30</span>;
	txt.<span style="color: #006600;">rotationZ</span> = <span style="color: #cc66cc;">20</span>;
	addChild<span style="color: #66cc66;">&#40;</span>txt<span style="color: #66cc66;">&#41;</span>;
<span style="color: #66cc66;">&#125;</span>
&nbsp;
<span style="color: #b1b100;">for</span> <span style="color: #66cc66;">&#40;</span><span style="color: #000000; font-weight: bold;">var</span> j:<span style="color: #0066CC;">int</span>=<span style="color: #cc66cc;">0</span>; j<span style="color: #66cc66;">&amp;</span>lt;=<span style="color: #cc66cc;">20</span>; j++<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
	<span style="color: #0066CC;">trace</span><span style="color: #66cc66;">&#40;</span>j<span style="color: #66cc66;">&#41;</span>;
	<span style="color: #000000; font-weight: bold;">var</span> myString:<span style="color: #0066CC;">String</span> = <span style="color: #ff0000;">&quot;Hello world!&quot;</span>;
	<span style="color: #000000; font-weight: bold;">var</span> myFormat:ElementFormat = <span style="color: #000000; font-weight: bold;">new</span> ElementFormat<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
	<span style="color: #000000; font-weight: bold;">var</span> myFontDesc:FontDescription = <span style="color: #000000; font-weight: bold;">new</span> FontDescription<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;Georgia&quot;</span><span style="color: #66cc66;">&#41;</span>;
	myFormat.<span style="color: #006600;">fontSize</span> = <span style="color: #cc66cc;">2</span> + <span style="color: #cc66cc;">2</span><span style="color: #66cc66;">*</span>j;
	myFormat.<span style="color: #006600;">fontDescription</span> = myFontDesc; 
&nbsp;
	<span style="color: #000000; font-weight: bold;">var</span> textElement:TextElement = <span style="color: #000000; font-weight: bold;">new</span> TextElement<span style="color: #66cc66;">&#40;</span>myString, myFormat<span style="color: #66cc66;">&#41;</span>;
	<span style="color: #000000; font-weight: bold;">var</span> textBlock:TextBlock = <span style="color: #000000; font-weight: bold;">new</span> TextBlock<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
	textBlock.<span style="color: #006600;">content</span> = textElement; 
&nbsp;
	<span style="color: #000000; font-weight: bold;">var</span> myTextLine:TextLine = textBlock.<span style="color: #006600;">createTextLine</span><span style="color: #66cc66;">&#40;</span><span style="color: #000000; font-weight: bold;">null</span>, <span style="color: #cc66cc;">300</span><span style="color: #66cc66;">&#41;</span>; 
&nbsp;
	myTextLine.<span style="color: #006600;">x</span> = <span style="color: #cc66cc;">6</span><span style="color: #66cc66;">*</span><span style="color: #66cc66;">&#40;</span>j<span style="color: #66cc66;">*</span><span style="color: #66cc66;">&#40;</span>j+<span style="color: #cc66cc;">1</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">/</span><span style="color: #cc66cc;">2</span><span style="color: #66cc66;">&#41;</span>;
	myTextLine.<span style="color: #006600;">y</span> = <span style="color: #cc66cc;">150</span>;
	myTextLine.<span style="color: #006600;">rotation</span> = <span style="color: #cc66cc;">20</span>;
&nbsp;
	addChild<span style="color: #66cc66;">&#40;</span>myTextLine<span style="color: #66cc66;">&#41;</span>;
<span style="color: #66cc66;">&#125;</span>
&nbsp;
  <span style="color: #66cc66;">&#125;</span>
 <span style="color: #66cc66;">&#125;</span>
<span style="color: #66cc66;">&#125;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.yswfblog.com/blog/2009/05/21/the-knack-to-rotating-dynamic-text-in-flash-10/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>Astra Stimulus Package</title>
		<link>http://www.yswfblog.com/blog/2009/04/15/astra-14/</link>
		<comments>http://www.yswfblog.com/blog/2009/04/15/astra-14/#comments</comments>
		<pubDate>Wed, 15 Apr 2009 20:39:59 +0000</pubDate>
		<dc:creator>Alaric Cole</dc:creator>
				<category><![CDATA[Flash]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[accessibility]]></category>

		<guid isPermaLink="false">http://www.yswfblog.com/blog/?p=230</guid>
		<description><![CDATA[We&#8217;re filing late this year but we were determined to get this thing in before midnight. We thought about asking for an extension, but decided the paperwork was too complicated. So here we go, crossing our fingers&#8230;
Astra 1.4 is now ready for direct deposit into your Flash or Flex applications.
New this season is a component [...]]]></description>
			<content:encoded><![CDATA[<p>We&#8217;re filing late this year but we were determined to get this thing in before midnight. We thought about asking for an extension, but decided the paperwork was too complicated. So here we go, crossing our fingers&#8230;</p>
<p>Astra 1.4 is now ready for direct deposit into your Flash or Flex applications.</p>
<p>New this season is a component called Form which will help with those gathering and validating data in Flash. Also notable to mention is that most of Astra is now accessible. We&#8217;ve added a section to each component on <a href="http://developer.yahoo.com/flash/">developer.yahoo.com/flash</a> speaking directly to those trying to get components to work with screen readers. There are also, as always, some nice bug fixes and new features. The full list follows:</p>
<h4>Flash</h4>
<ul>
<li>New Form component and form data manager utility</li>
<li>Carousel:
<ul>
<li>enhanced keyboard navigation</li>
<li>added accessibility</li>
<li>fixed bug: null reference error when setting multiple data providers</li>
</ul>
</li>
<li>Charts:
<ul>
<li>allow for negative values in stacked bar and column charts.</li>
<li>fixed bug in stacked bar and column charts in which markers were sized incorrectly for multiple series.</li>
<li>fixed bug in TimeAxis in which majorUnit was not being calculated correctly.</li>
<li>fixed bug in TimeAxis in which minorUnit was not being calculated.</li>
<li>fixed bug in which <code>hideOverlappingLabels</code> style did not work on the y-axis</li>
<li>refactored origin axes, <code>TimeAxis</code> and <code>NumericAxis</code>, to allow for factoring in the label size when calculating a <code>majorUnit</code>.</li>
<li>added option to <code>CategoryAxis</code> to allow for a more systematic dropping of labels when there is not enough space for all categories on the axis.</li>
<li>fixed bug in which null values break line series.</li>
<li>fixed bug in NumericAxis in which external data was not being casted as a Number.</li>
<li>allow option for rotating text when fonts are not embedded.</li>
<li>fixed bug in which Cartesian Charts, were not being updated when the length of the <code>dataSource</code> was different.</li>
<li>added enhanced styling of series by allowing the specification of fill, border and line color and alpha styles.</li>
<li>added option of styling a highlighted zero gridline when the zero is beyond the origin of a <code>NumericAxis</code>.</li>
</ul>
</li>
<li>Menu:
<ul>
<li>enhanced keyboard navigation</li>
<li>fixed bug in labelField property</li>
<li>added support for non-XML data providers</li>
<li>added beta accessibility implementation</li>
<li>fixed bug where focusing out would not close menus</li>
</ul>
</li>
<li>MenuBar:
<ul>
<li>enhanced keyboard navigation</li>
<li>added beta accessibility implementation</li>
<li>added support for non-XML data providers</li>
<li>added labelField property</li>
<li>added support for disabled menu bar items</li>
</ul>
</li>
<li>Tree:
<ul>
<li>Fixed out-of-bounds index error that appeared under certain conditions.</li>
<li>improved keyboard navigation</li>
<li>added events for opening and closing of nodes</li>
<li>added accessibility implementation</li>
<li>added TreeEvent</li>
</ul>
</li>
<li>AlertManager:
<ul>
<li>fixed issue with keyboard focus on disabled controls</li>
<li>made some properties publicly accessible</li>
<li>added beta accessibility implementation</li>
</ul>
</li>
<li>AudioPlayback:
<ul>
<li>enhanced keyboard navigation &#8211; added keyboard support for volume control</li>
<li>made some properties publicly accessible</li>
<li>added accessibility implementations for subcontrols (volume, current track)</li>
</ul>
</li>
</ul>
<h4>Flex</h4>
<ul>
<li>AutoCompleteManager:
<ul>
<li>Added ability to retrieve specific popup instances and control them</li>
<li>Enhanced algorithm for target resizing and moving</li>
</ul>
</li>
<li>IPv4AddressInput, TimeInput, TimeStepper, DropdownColorPicker:
<ul>
<li>Added accessibility implementation</li>
</ul>
</li>
</ul>
<h4>Utils</h4>
<ul>
<li>Improved performance of layout for very large containers</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.yswfblog.com/blog/2009/04/15/astra-14/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
		<item>
		<title>Creating Accessible Components in Flash and Flex (Part 2)</title>
		<link>http://www.yswfblog.com/blog/2009/01/12/creating-accessible-components-in-flash-and-flex-part-2/</link>
		<comments>http://www.yswfblog.com/blog/2009/01/12/creating-accessible-components-in-flash-and-flex-part-2/#comments</comments>
		<pubDate>Mon, 12 Jan 2009 13:54:33 +0000</pubDate>
		<dc:creator>Alaric Cole</dc:creator>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[accessibility]]></category>
		<category><![CDATA[screen reader]]></category>
		<category><![CDATA[usability]]></category>

		<guid isPermaLink="false">http://www.yswfblog.com/blog/?p=114</guid>
		<description><![CDATA[In this article, I&#8217;ll go over the steps needed to enable accessibility for a custom component. While it takes a bit of getting used to, I think you&#8217;ll find that enabling accessibility for your components is not only beneficial to the many users who would like to interact with your component, but helps you to [...]]]></description>
			<content:encoded><![CDATA[<p>In this article, I&#8217;ll go over the steps needed to enable accessibility for a custom component. While it takes a bit of getting used to, I think you&#8217;ll find that enabling accessibility for your components is not only beneficial to the many users who would like to interact with your component, but helps you to fine-tune and further enhance your components in general. To enable use with screen readers, follow these three (simple?) steps:</p>
<ol>
<li>Determine object role</li>
<li>Create the Accessibility Implementation class for component</li>
<li>Add accessibility tie-ins to component class<br />
a) Create a placeholder for the static <code>createAccessibilityImplementation()</code> method<br />
b) Override <code>initializeAccessibility()</code> method<br />
c) (Flex only) Add AccessibilityClass metadata</li>
</ol>
<p><span id="more-114"></span></p>
<h3>Determine object role</h3>
<p>In order for the JAWS screen reader to inform the user about a particular component, it needs to know a few things about the component. Most importantly, it needs to know what the type of the component is. It does this using a predefined set of types, called <a href="http://msdn.microsoft.com/en-us/library/ms696152(VS.85).aspx" target="_blank">Object Roles</a> in <a href="http://msdn.microsoft.com/en-us/library/ms697707(VS.85).aspx" target="_blank">MSAA</a> terminology. These object roles are simply numerical values, standing for control types such as push buttons and list boxes. I like to define them as constants in my accessibility implementations, to make them more identifiable. So the first step is determining the type, which also allows you to see if you need to extend a current accessibility implementation, or start from scratch. The second step is to actually create the implementation (*whew*).</p>
<h3>Create the Accessibility Implementation class</h3>
<p>To create an accessibility implementation, you need to extend from a base implementation class. For Flash components this will extend fl.accessibility.AccImpl or the component’s superclass’s implementation. For Flex components this will extend <code>mx.accessibility.AccImpl</code> or the component’s superclass’s implementation. For instance, with Astra Carousel, I extended <code>fl.accessibilitySelectableListAccImpl</code>, the implementation used for SelectableList; for Astra Charts, I created an implementation from scratch, extending <code>fl.accessibility.AccImpl</code>.</p>
<p>Generally, you can pair the superclass of your implementation with the component&#8217;s superclass. And if one&#8217;s not available, start at AccImpl. The main thing to remember is that, for Flash CS3/CS4 components, you need to create the hooks in your implementation that pair it up with its corresponding component. You do this by creating a static variable and a static method:</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript3" style="font-family:monospace;"><span style="color: #0033ff; font-weight: bold;">private</span> static <span style="color: #6699cc; font-weight: bold;">var</span> accessibilityHooked<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">Boolean</span>=hookAccessibility<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
&nbsp;
<span style="color: #0033ff; font-weight: bold;">private</span> static <span style="color: #339966; font-weight: bold;">function</span> hookAccessibility<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">Boolean</span>
<span style="color: #000000;">&#123;</span>
     YourComponentClass.createAccessibilityImplementation =
          createAccessibilityImplementation;
     <span style="color: #0033ff; font-weight: bold;">return</span> <span style="color: #0033ff; font-weight: bold;">true</span>;
<span style="color: #000000;">&#125;</span></pre></div></div>

<p>Notice in the hookAccessibility function, that it refers to a static variable of your component&#8217;s class. In order for this to work, you&#8217;ll need to add that static variable to your component&#8217;s class, which we&#8217;ll go over later in this article. Remember that the above code is for Flash CS3/CS4 components only&#8211;Flex will create the necessary hooks itself through the mxmlc compiler.</p>
<p>Once you&#8217;re hooked up, the next task is to actually set the object role you decided on. To do that, you simply set the variable role to that numerical value within the constructor of the implementation class.</p>
<p>Next is the hard part. All implementations will use the following methods to communicate with the screen reader, and you&#8217;ll find you need many of them to make your implementation work. However, you may not need to write custom code for all of them, as you may be able to inherit a perfectly usable method from the superclass:</p>
<p>• accLocation(childID:uint):* &#8211; specifies the bounding box of a child element.<br />
• accSelect(selFlag:uint, childID:uint):void-altering the selection in the component .<br />
• get_accDefaultAction(childID:uint):String-returns the default action of the component or of one of its child elements.<br />
• get_accFocus():uint-returns the unsigned integer ID of the child element, if any, that has child focus within the component.<br />
• get_accName(childID:uint):String-returns the name for the component or for one of its child elements.<br />
• get_accRole(childID:uint):uint-returns the system role for the component or for one of its child elements.<br />
• get_accSelection():Array-returns an array containing the IDs of all child elements that are selected.<br />
• get_accState(childID:uint):uint-returns the current runtime state of the component or of one of its child elements.<br />
• get_accValue(childID:uint):String-returns the runtime value of the component or of one of its child elements.<br />
• getChildIDArray():Array-returns an array containing the unsigned integer IDs of all child elements in the <span>AccessibilityImplementation</span>.<br />
• eventHandler(event:Event):void-Handles events from the master component. This essentially listens for events, and the developer must create a switch statement to call an Accessibility.sendEvent with the appropriate parameters.<br />
• getName(childID:uint):String-returns the name of the accessible component or the name of one of its child elements.<br />
• getState(childID:uint):uint-returns the state of the accessible component.</p>
<p>It’s important to note that there may be a number of other methods that need to be created for such things as telling the screenreader which child items are focused or what items are selected. Read on for some real-world examples of creating these.</p>
<h3>Add accessibility tie-ins to component class</h3>
<p>The last step is telling your component class to use this accessibility implementation. Actually, this is a step you can do on your components before you finalize your implementation class, because it doesn&#8217;t point to the accessibility class by name. Add these few lines of code to your class:</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript3" style="font-family:monospace;"><span style="color: #0033ff; font-weight: bold;">public</span> static <span style="color: #6699cc; font-weight: bold;">var</span> createAccessibilityImplementation<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">Function</span>;
&nbsp;
override <span style="color: #0033ff; font-weight: bold;">protected</span> <span style="color: #339966; font-weight: bold;">function</span> initializeAccessibility<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000; font-weight: bold;">:</span><span style="color: #0033ff; font-weight: bold;">void</span>
<span style="color: #000000;">&#123;</span>
     <span style="color: #0033ff; font-weight: bold;">if</span> <span style="color: #000000;">&#40;</span>YourComponentClass.createAccessibilityImplementation<span style="color: #000000; font-weight: bold;">!</span>=<span style="color: #0033ff; font-weight: bold;">null</span><span style="color: #000000;">&#41;</span>
          YourComponentClass.createAccessibilityImplementation<span style="color: #000000;">&#40;</span><span style="color: #0033ff; font-weight: bold;">this</span><span style="color: #000000;">&#41;</span>;
<span style="color: #000000;">&#125;</span></pre></div></div>

<p>This tells UIComponent that there may be an implementation in use, and lets your implementation class mix in with its <code>hookAccessibility()</code> method. If you&#8217;re using Flex, it&#8217;s a good idea to add AccessibilityClass metadata in your component class. For example, with <code>mx.controls.Button</code>, the following metadata is added, pointing to the implementation class:</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript3" style="font-family:monospace;"><span style="color: #000000;">&#91;</span>AccessibilityClass<span style="color: #000000;">&#40;</span>implementation=<span style="color: #990000;">&quot;mx.accessibility.ButtonAccImpl&quot;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#93;</span></pre></div></div>

<h3>Examples</h3>
<p>Talking about what you should do is one thing, but giving you a play-by-play of my own development experience should prove more helpful.</p>
<h4>Carousel</h4>
<p>To create an accessibility implementation for Carousel, I determined that, because Carousel extends <span>SelectableList</span>, my accessibility implementation would extend <span>SelectableListAccImpl</span>. This saved some of the grunt work, as a few of the necessary methods were already created for me. Even the role did not need to be set, as there is no specific designation for a carousel in MSAA. Carousel is essentially a list, so I was able to keep its role as <code>ROLE_SYSTEM_LIST</code> (0&#215;00000021 for the numerically-inclined). I did have to override the <code>get_accValue</code> method to return the value of the current item in the Carousel. Also, because a Carousel can be horizontal as well as vertical, I had to override <code>get_accState</code> to return the proper state information whether the Carousel was a vertical or horizontal list.</p>
<h4>Tree</h4>
<p>For Tree, I at first decided to create an accessibility implementation from scratch, probably because I was being stubborn. While Tree extends List, the typical ListAccImple class wasn&#8217;t going to cut it for Tree, which has a very different interaction model. However, I later realized that had to reimplement <code>getChildIDArray</code>, <code>accLocation</code>, and <code>get_accFocus</code>, which were already present and suitable in <span>SelectableListAccImpl</span>. So I decided in the end to extend that. However, there was a lot left to be written for this implementation. Tree, while it inherits from List, has its own designation in MSAA land. It is called, interestingly enough, an Outline control, designated by the constant <code>ROLE_SYSTEM_OUTLINE</code>. So that was the role I gave it. I reworked the <code>get_accValue</code> method to return the value of the current item as well as their location in the tree structure. So when the item is selected, the screen reader will read something like &#8220;Item 4 of 10&#8243;. Other things I had to do with Tree:</p>
<ul>
<li><code>get_accState</code> was overridden to provide additional information about tree items being collapsed or open.</li>
<li><code>get_accDefaultAction</code> had to show additional actions of a node being collapsed or expanded.</li>
<li><code>accDoDefaultAction</code> needed to be reworked in order to open or close the items.</li>
<li><code>getName</code> was overridden to add, like <code>get_accValue</code>, info about the current location of the item in the tree structure.</li>
</ul>
<p>I also found in my development that proper keyboard navigation wasn&#8217;t in place. So I added that in. That&#8217;s the great part about creating these implementations&#8211;it allows you to really test the usability of the component, not to mention helps you to find bugs.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.yswfblog.com/blog/2009/01/12/creating-accessible-components-in-flash-and-flex-part-2/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Flash 10 Experiments: The Warholizer (Loading and Processing Local Images)</title>
		<link>http://www.yswfblog.com/blog/2008/12/22/flash-10-experiments-the-warholizer-loading-and-processing-local-images/</link>
		<comments>http://www.yswfblog.com/blog/2008/12/22/flash-10-experiments-the-warholizer-loading-and-processing-local-images/#comments</comments>
		<pubDate>Mon, 22 Dec 2008 18:21:44 +0000</pubDate>
		<dc:creator>Allen Rabinovich</dc:creator>
				<category><![CDATA[Examples]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[Flash 10]]></category>
		<category><![CDATA[Local Images]]></category>
		<category><![CDATA[Warholizer]]></category>

		<guid isPermaLink="false">http://www.yswfblog.com/blog/?p=97</guid>
		<description><![CDATA[One of the new features in Flash Player 10 is the ability to read local files. We&#8217;ve been looking at this feature for some of our upcoming components, and built a small example that demonstrates how to load, display, and process local images.  This example, dubbed &#8220;The Warholizer&#8221;, allows you to open any image file [...]]]></description>
			<content:encoded><![CDATA[<p>One of the new features in Flash Player 10 is the ability to read local files. We&#8217;ve been looking at this feature for some of our upcoming components, and built a small example that demonstrates how to load, display, and process local images.  This example, dubbed &#8220;The Warholizer&#8221;, allows you to open any image file on your machine, and without uploading it to the server, extract the image&#8217;s bitmap data, and run it through some color filters, achieving an effect not unlike the one in some of Andy Warhol&#8217;s work. Try it out by dropping in a photo of your own for those 15 minutes of fame (though make sure the image is not too large: Flash has an upper limit on the size of bitmaps):</p>
<p><script src="http://us.js2.yimg.com/us.js.yimg.com/lib/flash/swfobject/1.0/swfobject.js" type="text/javascript"></script></p>
<div id="ImageLoaderDemo">Note: The proper version of <a href="http://www.adobe.com/go/getflashplayer">Flash Player</a> is not installed or JavaScript is not enabled. Unable to display SWF content.</div>
<p><script type="text/javascript"><!--
 var swfobj = new SWFObject( "http://www.yswfblog.com/blog/wp-content/uploads/2008/12/imageloader.swf", "ImageLoaderDemo", "100%", "500", "10.0.0" ); 
swfobj.write( "ImageLoaderDemo" ); 
// --></script></p>
<p>The code for the example is below the fold.</p>
<p><span id="more-97"></span></p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;"><span style="color: #66cc66;">&lt;</span>?<span style="color: #0066CC;">xml</span> <span style="color: #0066CC;">version</span>=<span style="color: #ff0000;">&quot;1.0&quot;</span> encoding=<span style="color: #ff0000;">&quot;utf-8&quot;</span>?<span style="color: #66cc66;">&gt;</span>
&nbsp;
<span style="color: #66cc66;">&lt;</span>mx:Application xmlns:mx=<span style="color: #ff0000;">&quot;http://www.adobe.com/2006/mxml&quot;</span> layout=<span style="color: #ff0000;">&quot;absolute&quot;</span> initialize=<span style="color: #ff0000;">&quot;init();&quot;</span> xmlns:ns1=<span style="color: #ff0000;">&quot;com.yahoo.astra.mx.controls.*&quot;</span><span style="color: #66cc66;">&gt;</span>
&nbsp;
<span style="color: #66cc66;">&lt;</span>mx:Script<span style="color: #66cc66;">&gt;</span>
	<span style="color: #66cc66;">&lt;!</span><span style="color: #66cc66;">&#91;</span>CDATA<span style="color: #66cc66;">&#91;</span>
&nbsp;
<span style="color: #0066CC;">import</span> mx.<span style="color: #006600;">core</span>.<span style="color: #006600;">Container</span>;
<span style="color: #0066CC;">import</span> mx.<span style="color: #006600;">core</span>.<span style="color: #006600;">UIComponent</span>;
<span style="color: #0066CC;">import</span> flash.<span style="color: #006600;">net</span>.<span style="color: #006600;">FileReference</span>;
<span style="color: #0066CC;">import</span> flash.<span style="color: #006600;">display</span>.<span style="color: #006600;">BitmapData</span>;
&nbsp;
<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">var</span> fileRef:FileReference = <span style="color: #000000; font-weight: bold;">new</span> FileReference<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> init<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> : <span style="color: #0066CC;">void</span> <span style="color: #66cc66;">&#123;</span>
	fileRef.<span style="color: #006600;">addEventListener</span><span style="color: #66cc66;">&#40;</span>Event.<span style="color: #006600;">SELECT</span>, handleSelectedImage<span style="color: #66cc66;">&#41;</span>;
	fileRef.<span style="color: #006600;">addEventListener</span><span style="color: #66cc66;">&#40;</span>Event.<span style="color: #006600;">COMPLETE</span>, handleFileLoad<span style="color: #66cc66;">&#41;</span>;
<span style="color: #66cc66;">&#125;</span>
&nbsp;
<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> handleBrowseClick <span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> : <span style="color: #0066CC;">void</span> <span style="color: #66cc66;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">var</span> typeFilter:<span style="color: #0066CC;">Array</span> = <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #0066CC;">Array</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
	typeFilter.<span style="color: #0066CC;">push</span><span style="color: #66cc66;">&#40;</span><span style="color: #000000; font-weight: bold;">new</span> FileFilter<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;Images&quot;</span>, <span style="color: #ff0000;">&quot;*.jpg;*.gif;*.png&quot;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;
	fileRef.<span style="color: #006600;">browse</span><span style="color: #66cc66;">&#40;</span>typeFilter<span style="color: #66cc66;">&#41;</span>;
<span style="color: #66cc66;">&#125;</span>
&nbsp;
<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> handleSelectedImage<span style="color: #66cc66;">&#40;</span>evt:Event<span style="color: #66cc66;">&#41;</span> : <span style="color: #0066CC;">void</span> <span style="color: #66cc66;">&#123;</span>
	fileName.<span style="color: #0066CC;">text</span> = fileRef.<span style="color: #0066CC;">name</span>;
	fileRef.<span style="color: #0066CC;">load</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
<span style="color: #66cc66;">&#125;</span>
&nbsp;
<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> handleFileLoad <span style="color: #66cc66;">&#40;</span>evt:Event<span style="color: #66cc66;">&#41;</span> : <span style="color: #0066CC;">void</span> <span style="color: #66cc66;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">var</span> fileByteData:ByteArray = <span style="color: #000000; font-weight: bold;">new</span> ByteArray<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
	fileByteData = fileRef.<span style="color: #0066CC;">data</span> as ByteArray;
&nbsp;
	<span style="color: #000000; font-weight: bold;">var</span> loader:Loader = <span style="color: #000000; font-weight: bold;">new</span> Loader<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
	loader.<span style="color: #006600;">contentLoaderInfo</span>.<span style="color: #006600;">addEventListener</span><span style="color: #66cc66;">&#40;</span>Event.<span style="color: #006600;">COMPLETE</span>, extractBitmapData<span style="color: #66cc66;">&#41;</span>;
	loader.<span style="color: #006600;">loadBytes</span><span style="color: #66cc66;">&#40;</span>fileByteData<span style="color: #66cc66;">&#41;</span>;
<span style="color: #66cc66;">&#125;</span>
&nbsp;
<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> extractBitmapData <span style="color: #66cc66;">&#40;</span>evt:Event<span style="color: #66cc66;">&#41;</span> : <span style="color: #0066CC;">void</span> <span style="color: #66cc66;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">var</span> sourceBMP:Bitmap = evt.<span style="color: #006600;">currentTarget</span>.<span style="color: #006600;">loader</span>.<span style="color: #006600;">content</span> as Bitmap;
	<span style="color: #000000; font-weight: bold;">var</span> outputBMP:Bitmap = <span style="color: #000000; font-weight: bold;">new</span> Bitmap<span style="color: #66cc66;">&#40;</span><span style="color: #000000; font-weight: bold;">new</span> BitmapData <span style="color: #66cc66;">&#40;</span>sourceBMP.<span style="color: #0066CC;">width</span><span style="color: #66cc66;">*</span><span style="color: #cc66cc;">2</span> + <span style="color: #cc66cc;">10</span>, sourceBMP.<span style="color: #0066CC;">height</span><span style="color: #66cc66;">*</span><span style="color: #cc66cc;">2</span> + <span style="color: #cc66cc;">10</span><span style="color: #66cc66;">&#41;</span>, <span style="color: #ff0000;">&quot;auto&quot;</span>, <span style="color: #000000; font-weight: bold;">true</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
	<span style="color: #000000; font-weight: bold;">var</span> sourceRect:Rectangle = <span style="color: #000000; font-weight: bold;">new</span> Rectangle<span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">0</span>,<span style="color: #cc66cc;">0</span>,sourceBMP.<span style="color: #0066CC;">width</span>, sourceBMP.<span style="color: #0066CC;">height</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
	<span style="color: #000000; font-weight: bold;">var</span> blueTransform:ColorTransform = <span style="color: #000000; font-weight: bold;">new</span> ColorTransform<span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">1</span>,<span style="color: #cc66cc;">1</span>,<span style="color: #cc66cc;">10</span><span style="color: #66cc66;">&#41;</span>;
	<span style="color: #000000; font-weight: bold;">var</span> yellowTransform:ColorTransform = <span style="color: #000000; font-weight: bold;">new</span> ColorTransform<span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">10</span>,<span style="color: #cc66cc;">10</span>,<span style="color: #cc66cc;">1</span><span style="color: #66cc66;">&#41;</span>;
	<span style="color: #000000; font-weight: bold;">var</span> greenTransform:ColorTransform = <span style="color: #000000; font-weight: bold;">new</span> ColorTransform<span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">1</span>,<span style="color: #cc66cc;">10</span>,<span style="color: #cc66cc;">1</span><span style="color: #66cc66;">&#41;</span>;
	<span style="color: #000000; font-weight: bold;">var</span> redTransform:ColorTransform = <span style="color: #000000; font-weight: bold;">new</span> ColorTransform<span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">10</span>,<span style="color: #cc66cc;">1</span>,<span style="color: #cc66cc;">1</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
	outputBMP.<span style="color: #006600;">bitmapData</span>.<span style="color: #006600;">copyPixels</span><span style="color: #66cc66;">&#40;</span>sourceBMP.<span style="color: #006600;">bitmapData</span>, sourceRect, <span style="color: #000000; font-weight: bold;">new</span> Point<span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">0</span>,<span style="color: #cc66cc;">0</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;
	outputBMP.<span style="color: #006600;">bitmapData</span>.<span style="color: #006600;">copyPixels</span><span style="color: #66cc66;">&#40;</span>sourceBMP.<span style="color: #006600;">bitmapData</span>, sourceRect, <span style="color: #000000; font-weight: bold;">new</span> Point<span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">0</span>, sourceBMP.<span style="color: #0066CC;">height</span> + <span style="color: #cc66cc;">10</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;
	outputBMP.<span style="color: #006600;">bitmapData</span>.<span style="color: #006600;">copyPixels</span><span style="color: #66cc66;">&#40;</span>sourceBMP.<span style="color: #006600;">bitmapData</span>, sourceRect, <span style="color: #000000; font-weight: bold;">new</span> Point<span style="color: #66cc66;">&#40;</span>sourceBMP.<span style="color: #0066CC;">width</span> + <span style="color: #cc66cc;">10</span>, <span style="color: #cc66cc;">0</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;
	outputBMP.<span style="color: #006600;">bitmapData</span>.<span style="color: #006600;">copyPixels</span><span style="color: #66cc66;">&#40;</span>sourceBMP.<span style="color: #006600;">bitmapData</span>, sourceRect, <span style="color: #000000; font-weight: bold;">new</span> Point<span style="color: #66cc66;">&#40;</span>sourceBMP.<span style="color: #0066CC;">width</span> + <span style="color: #cc66cc;">10</span>, sourceBMP.<span style="color: #0066CC;">height</span> + <span style="color: #cc66cc;">10</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
	outputBMP.<span style="color: #006600;">bitmapData</span>.<span style="color: #006600;">colorTransform</span><span style="color: #66cc66;">&#40;</span><span style="color: #000000; font-weight: bold;">new</span> Rectangle<span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">0</span>,<span style="color: #cc66cc;">0</span>, sourceBMP.<span style="color: #0066CC;">width</span>, sourceBMP.<span style="color: #0066CC;">height</span><span style="color: #66cc66;">&#41;</span>, blueTransform<span style="color: #66cc66;">&#41;</span>;
	outputBMP.<span style="color: #006600;">bitmapData</span>.<span style="color: #006600;">colorTransform</span><span style="color: #66cc66;">&#40;</span><span style="color: #000000; font-weight: bold;">new</span> Rectangle<span style="color: #66cc66;">&#40;</span>sourceBMP.<span style="color: #0066CC;">width</span>+<span style="color: #cc66cc;">10</span>, <span style="color: #cc66cc;">0</span>, sourceBMP.<span style="color: #0066CC;">width</span>, sourceBMP.<span style="color: #0066CC;">height</span><span style="color: #66cc66;">&#41;</span>, yellowTransform<span style="color: #66cc66;">&#41;</span>;
	outputBMP.<span style="color: #006600;">bitmapData</span>.<span style="color: #006600;">colorTransform</span><span style="color: #66cc66;">&#40;</span><span style="color: #000000; font-weight: bold;">new</span> Rectangle<span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">0</span>,sourceBMP.<span style="color: #0066CC;">height</span> + <span style="color: #cc66cc;">10</span>, sourceBMP.<span style="color: #0066CC;">width</span>, sourceBMP.<span style="color: #0066CC;">height</span><span style="color: #66cc66;">&#41;</span>, redTransform<span style="color: #66cc66;">&#41;</span>;
	outputBMP.<span style="color: #006600;">bitmapData</span>.<span style="color: #006600;">colorTransform</span><span style="color: #66cc66;">&#40;</span><span style="color: #000000; font-weight: bold;">new</span> Rectangle<span style="color: #66cc66;">&#40;</span>sourceBMP.<span style="color: #0066CC;">width</span>+<span style="color: #cc66cc;">10</span>,sourceBMP.<span style="color: #0066CC;">height</span>+<span style="color: #cc66cc;">10</span>, sourceBMP.<span style="color: #0066CC;">width</span>, sourceBMP.<span style="color: #0066CC;">height</span><span style="color: #66cc66;">&#41;</span>, greenTransform<span style="color: #66cc66;">&#41;</span>;
&nbsp;
	<span style="color: #000000; font-weight: bold;">var</span> ratio:<span style="color: #0066CC;">Number</span> = outputBMP.<span style="color: #0066CC;">width</span> <span style="color: #66cc66;">/</span> outputBMP.<span style="color: #0066CC;">height</span>;
	<span style="color: #000000; font-weight: bold;">var</span> sourceRatio:<span style="color: #0066CC;">Number</span> = sourceBMP.<span style="color: #0066CC;">width</span> <span style="color: #66cc66;">/</span> sourceBMP.<span style="color: #0066CC;">height</span>;
	sourceBMP.<span style="color: #0066CC;">width</span> = <span style="color: #cc66cc;">200</span>;
	sourceBMP.<span style="color: #0066CC;">height</span> = <span style="color: #cc66cc;">200</span><span style="color: #66cc66;">/</span>ratio;
&nbsp;
<span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span>outputPanel.<span style="color: #0066CC;">width</span> <span style="color: #66cc66;">&gt;</span> outputPanel.<span style="color: #0066CC;">height</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
	outputBMP.<span style="color: #0066CC;">height</span> = outputPanel.<span style="color: #0066CC;">height</span> - <span style="color: #cc66cc;">100</span>;
	outputBMP.<span style="color: #0066CC;">width</span> = outputBMP.<span style="color: #0066CC;">height</span> <span style="color: #66cc66;">*</span> ratio;
<span style="color: #66cc66;">&#125;</span>
<span style="color: #b1b100;">else</span> <span style="color: #66cc66;">&#123;</span>
	outputBMP.<span style="color: #0066CC;">width</span> = outputPanel.<span style="color: #0066CC;">width</span> - <span style="color: #cc66cc;">50</span>;
	outputBMP.<span style="color: #0066CC;">height</span> = outputBMP.<span style="color: #0066CC;">width</span> <span style="color: #66cc66;">/</span> ratio;
<span style="color: #66cc66;">&#125;</span>
&nbsp;
	<span style="color: #000000; font-weight: bold;">var</span> outputContainer:UIComponent = <span style="color: #000000; font-weight: bold;">new</span> UIComponent<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
	<span style="color: #000000; font-weight: bold;">var</span> sourceContainer:UIComponent = <span style="color: #000000; font-weight: bold;">new</span> UIComponent<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
	<span style="color: #000000; font-weight: bold;">var</span> arrowContainer:UIComponent = <span style="color: #000000; font-weight: bold;">new</span> UIComponent<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
	sourceContainer.<span style="color: #0066CC;">width</span> = sourceBMP.<span style="color: #0066CC;">width</span>;
	sourceContainer.<span style="color: #0066CC;">height</span> = sourceBMP.<span style="color: #0066CC;">height</span>;
&nbsp;
	outputContainer.<span style="color: #0066CC;">width</span> = outputBMP.<span style="color: #0066CC;">width</span>;
	outputContainer.<span style="color: #0066CC;">height</span> = outputBMP.<span style="color: #0066CC;">height</span>;
&nbsp;
	arrowContainer.<span style="color: #0066CC;">width</span> = <span style="color: #cc66cc;">10</span>;
	arrowContainer.<span style="color: #0066CC;">height</span> = <span style="color: #cc66cc;">40</span>;
&nbsp;
	sourceContainer.<span style="color: #006600;">addChild</span><span style="color: #66cc66;">&#40;</span>sourceBMP<span style="color: #66cc66;">&#41;</span>;
	arrowContainer.<span style="color: #006600;">addChild</span><span style="color: #66cc66;">&#40;</span>drawArrow<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;
	outputContainer.<span style="color: #006600;">addChild</span><span style="color: #66cc66;">&#40;</span>outputBMP<span style="color: #66cc66;">&#41;</span>;
&nbsp;
	outputPanel.<span style="color: #006600;">removeAllChildren</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
	outputPanel.<span style="color: #006600;">addChild</span><span style="color: #66cc66;">&#40;</span>sourceContainer<span style="color: #66cc66;">&#41;</span>;
	outputPanel.<span style="color: #006600;">addChild</span><span style="color: #66cc66;">&#40;</span>arrowContainer<span style="color: #66cc66;">&#41;</span>;
	outputPanel.<span style="color: #006600;">addChild</span><span style="color: #66cc66;">&#40;</span>outputContainer<span style="color: #66cc66;">&#41;</span>;
<span style="color: #66cc66;">&#125;</span>
&nbsp;
<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> drawArrow <span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> : Sprite <span style="color: #66cc66;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">var</span> targetSprite:Sprite = <span style="color: #000000; font-weight: bold;">new</span> Sprite<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
	targetSprite.<span style="color: #006600;">graphics</span>.<span style="color: #0066CC;">beginFill</span><span style="color: #66cc66;">&#40;</span>0x000000<span style="color: #66cc66;">&#41;</span>;
	targetSprite.<span style="color: #006600;">graphics</span>.<span style="color: #0066CC;">lineTo</span><span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">10</span>,<span style="color: #cc66cc;">20</span><span style="color: #66cc66;">&#41;</span>;
	targetSprite.<span style="color: #006600;">graphics</span>.<span style="color: #0066CC;">lineTo</span><span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">0</span>,<span style="color: #cc66cc;">40</span><span style="color: #66cc66;">&#41;</span>;
	targetSprite.<span style="color: #006600;">graphics</span>.<span style="color: #0066CC;">lineTo</span><span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">0</span>,<span style="color: #cc66cc;">0</span><span style="color: #66cc66;">&#41;</span>;
	targetSprite.<span style="color: #006600;">graphics</span>.<span style="color: #0066CC;">endFill</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;	
<span style="color: #b1b100;">return</span> targetSprite;
<span style="color: #66cc66;">&#125;</span>
<span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&gt;</span>
<span style="color: #66cc66;">&lt;/</span>mx:Script<span style="color: #66cc66;">&gt;</span>
<span style="color: #66cc66;">&lt;</span>mx:<span style="color: #0066CC;">Button</span> id=<span style="color: #ff0000;">&quot;browseButton&quot;</span> label=<span style="color: #ff0000;">&quot;Browse for an image&quot;</span> <span style="color: #0066CC;">right</span>=<span style="color: #ff0000;">&quot;10&quot;</span> top=<span style="color: #ff0000;">&quot;10&quot;</span> click=<span style="color: #ff0000;">&quot;handleBrowseClick();&quot;</span><span style="color: #66cc66;">/&gt;</span>
<span style="color: #66cc66;">&lt;</span>mx:TextInput id=<span style="color: #ff0000;">&quot;fileName&quot;</span> <span style="color: #0066CC;">right</span>=<span style="color: #ff0000;">&quot;166&quot;</span> top=<span style="color: #ff0000;">&quot;10&quot;</span><span style="color: #66cc66;">/&gt;</span>
<span style="color: #66cc66;">&lt;</span>mx:Label <span style="color: #0066CC;">text</span>=<span style="color: #ff0000;">&quot;Warholizer&quot;</span> fontWeight=<span style="color: #ff0000;">&quot;bold&quot;</span> fontSize=<span style="color: #ff0000;">&quot;17&quot;</span> <span style="color: #0066CC;">left</span>=<span style="color: #ff0000;">&quot;7&quot;</span> top=<span style="color: #ff0000;">&quot;6&quot;</span><span style="color: #66cc66;">/&gt;</span>
<span style="color: #66cc66;">&lt;</span>mx:Panel layout=<span style="color: #ff0000;">&quot;horizontal&quot;</span> bottom=<span style="color: #ff0000;">&quot;10&quot;</span> <span style="color: #0066CC;">right</span>=<span style="color: #ff0000;">&quot;10&quot;</span> <span style="color: #0066CC;">left</span>=<span style="color: #ff0000;">&quot;10&quot;</span> top=<span style="color: #ff0000;">&quot;41&quot;</span> id=<span style="color: #ff0000;">&quot;outputPanel&quot;</span> clipContent=<span style="color: #ff0000;">&quot;true&quot;</span> title=<span style="color: #ff0000;">&quot;Output&quot;</span> horizontalAlign=<span style="color: #ff0000;">&quot;center&quot;</span> verticalAlign=<span style="color: #ff0000;">&quot;middle&quot;</span><span style="color: #66cc66;">&gt;</span>
<span style="color: #66cc66;">&lt;/</span>mx:Panel<span style="color: #66cc66;">&gt;</span>
<span style="color: #66cc66;">&lt;/</span>mx:Application<span style="color: #66cc66;">&gt;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.yswfblog.com/blog/2008/12/22/flash-10-experiments-the-warholizer-loading-and-processing-local-images/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Creating Accessible Components in Flash and Flex</title>
		<link>http://www.yswfblog.com/blog/2008/12/05/creating-accessible-components-in-flash-and-flex/</link>
		<comments>http://www.yswfblog.com/blog/2008/12/05/creating-accessible-components-in-flash-and-flex/#comments</comments>
		<pubDate>Fri, 05 Dec 2008 13:00:57 +0000</pubDate>
		<dc:creator>Alaric Cole</dc:creator>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://www.yswfblog.com/blog/2008/12/05/creating-accessible-components-in-flash-and-flex/</guid>
		<description><![CDATA[It&#8217;s been in the works for a while, but I finally had the chance to focus on making ASTRA components more accessible. Accessibility is not something many developers look at, but it&#8217;s slowly gaining ground. For many developers, even figuring out how to enable the built-in accessibility of Flash components is a job. But when [...]]]></description>
			<content:encoded><![CDATA[<p>It&#8217;s been in the works for a while, but I finally had the chance to focus on making ASTRA components more accessible. Accessibility is not something many developers look at, but it&#8217;s slowly gaining ground. For many developers, even figuring out how to enable the built-in accessibility of Flash components is a job. But when you create custom components, implementing accessibility is another job entirely. Accessibility doesn&#8217;t come for free.</p>
<table border="0" cellspacing="5" cellpadding="10" width="200" align="right">
<tbody>
<tr>
<td bgcolor="#75a3d1"><span>This set of articles will be geared towards component developers who want to ensure compatibility with screen readers. However, any developer will find this information useful, especially those want to learn how accessibility works in Flash.</span></td>
</tr>
</tbody>
</table>
<p>To begin my assessment of ASTRA components, I first had to learn to use a screen reader. I installed a trial of <a href="http://www.freedomscientific.com/fs_products/software_jaws.asp">JAWS for Windows</a>, which is the de facto screen reader technology, especially in regards to Flash. It&#8217;s important to note that although I develop on a Mac, I have to use Windows for accessibility testing. This is because Flash accessibility is based on <a href="http://msdn.microsoft.com/en-us/library/ms697707.aspx">Microsoft&#8217;s Active Accessibility</a> standards, and only work on Windows machines. It can be argued that real accessibility is quite limited on the Mac, so this is more of an OS X limitation than a limitation of Flash. I also installed the <a href="http://www.adobe.com/macromedia/accessibility/features/flex/readme.html">Flex scripts</a> add-ons, which are touted to provide more fine-grained info for the screen reader when using accessible Flex components.</p>
<p>Using  a screen reader, I quickly discovered, is a more involved process than it might seem. Your natural tendencies and habits have to be thrown out the window. For example, opening a browser window with an embedded swf, my first inclination was to use the mouse to navigate to a text input control and start typing. That didn&#8217;t work as planned. For one, a typical user of a screen reader is not going to be grabbing the mouse first thing, but using keyboard navigation to interact with an application, so I&#8217;d already cheated. Along with this, because of the way JAWS works, navigating to an input field won&#8217;t necessarily allow you to begin editing text&#8211;you must enter into &#8220;forms mode&#8221; in order to even start typing.</p>
<p>Once I got the basics of using JAWS down, I started to test our components. My original assumption was that the components would &#8220;mostly work&#8221; because many of them are based on lower-level components which have accessibility implementations built.</p>
<p>I was &#8220;mostly wrong.&#8221; A component is not the sum of its parts, in regards to a screen reader. For a component to be successfully understood by the user, it needs its own accessibility implementation built from scratch.</p>
<p>In the <a href="http://www.yswfblog.com/blog/2009/01/12/creating-accessible-components-in-flash-and-flex-part-2/">next article</a> I&#8217;ll discuss what steps I took to create those implementations.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.yswfblog.com/blog/2008/12/05/creating-accessible-components-in-flash-and-flex/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>3D with Flash 10 (part 2)</title>
		<link>http://www.yswfblog.com/blog/2008/11/12/3d-with-flash-10-part-2/</link>
		<comments>http://www.yswfblog.com/blog/2008/11/12/3d-with-flash-10-part-2/#comments</comments>
		<pubDate>Wed, 12 Nov 2008 15:41:37 +0000</pubDate>
		<dc:creator>Michael Hoch</dc:creator>
				<category><![CDATA[Flash]]></category>
		<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://www.yswfblog.com/blog/2008/11/12/3d-with-flash-10-part-2/</guid>
		<description><![CDATA[
Overview
When I came across Flash 10 two things caught my attention: 3D Effects and PixelBender Filters. This post will explore the former: Flash 10 adds a set of utility functions to do 3D Effects that were previously difficult or costly. I wanted to explore the possibility to export 3D Models from 3D animation packages to [...]]]></description>
			<content:encoded><![CDATA[<p><script src="http://us.js2.yimg.com/us.js.yimg.com/lib/flash/swfobject/1.0/swfobject.js" type="text/javascript"></script></p>
<h3><strong>Overview</strong></h3>
<p>When I came across Flash 10 two things caught my attention: 3D Effects and PixelBender Filters. This post will explore the former: Flash 10 adds a set of utility functions to do 3D Effects that were previously difficult or costly. I wanted to explore the possibility to export 3D Models from 3D animation packages to Flash 10 directly. Now, there are existing 3D engines like Papervision, Away3D, and Sandy that provide the functionality for rendering 3D objects and scenes. There are also functions for reading in data from 3D formats like 3DMax. However, the purpose of this blog post is  an exploration of the new functionality offered in Flash 10 and describe a minimalist approach to how to render a 3D object using some of these new functions.</p>
<p style="text-align: center">&nbsp;</p>
<p id="swfdiv1" style="text-align: center">Note: The proper version of <a href="http://www.adobe.com/go/getflashplayer">Flash Player</a> is not installed or JavaScript is not enabled. Unable to display SWF content.</p>
<p><script type="text/javascript"> var swfobj = new SWFObject( "http://www.yswfblog.com/blog/wp-content/uploads/2008/11/3d_cube.swf", "3D Ring", "200", "200", "10.0.0" ); swfobj.write( "swfdiv1" ); </script></p>
<h3><strong>New functions</strong></h3>
<h4>Vector</h4>
<p>Flash 10 introduces the notion of typed arrays &#8211; arrays that can only contain  values of a certain type &#8211; which improves performance and makes your code also more transparent. We can use it to store the vertex data of our 3D object (as well as a similar vector for our indices that define the face set). You can simply create an empty Vector and then push the vertices:</p>
<blockquote><p>       var vertices3D:Vector.&lt;Number&gt; = new Vector.&lt;Number&gt;();<br />
vertices3D.push(x, y, z);</p></blockquote>
<p>You can also pre-specify the size:</p>
<blockquote><p>      var vertices3D:Vector.&lt;Number&gt; = new Vector.&lt;Number&gt;(30);<br />
vertices3D[0] = x;<br />
vertices3D[1] = y;<br />
vertices3D[2] = z;</p></blockquote>
<p>or just pass in an array:</p>
<blockquote><p>      var vertices3D:Vector.&lt;Number&gt; = Vector.&lt;Number&gt;([ 0.3, 0.7, 0.1 ]);</p></blockquote>
<p>Watch out for not using &#8220;new&#8221; when initializing a Vector with an array.</p>
<h4>Perspective Projection</h4>
<p>Once we have our vertex data we can set up our rendering pipeline with a perspective projection. Flash 10 offers the class <em>PerspectiveProjection </em>that allows us to set the projection center and the field of view through properties.</p>
<blockquote><p>     var pp:PerspectiveProjection = new PerspectiveProjection();<br />
pp.projectionCenter = new Point(0, 0);<br />
pp.fieldOfView = 45;</p></blockquote>
<h4>Project Vectors</h4>
<p>Next, we use the projection matrix and one of the new 3D utility functions to project our vertex data into 2D space. Below we use the typed array vertices2D to hold the resulting data (note that this function also calculates the t-value of the uvtData which can be used for texture mapping).</p>
<blockquote><p>   m:Matrix3D = pp.toMatrix();<br />
Utils3D.projectVectors(m, myMesh.vertices3D, myMesh.vertices2D, myMesh.uvtData);</p></blockquote>
<h4>Draw Triangles</h4>
<p>Finally, we can draw our resulting 2D mesh on the screen using the new <em>drawTriangles()</em> function. This function takes our calculated 2D vertex data array, the original index data, and specifies which sides should be rendered through the culling parameter. A parameter of <em>TriangleCulling.POSITIVE</em> results in only positively wound triangles to be drawn.</p>
<blockquote><p>     container.graphics.clear();<br />
container.graphics.beginFill(0xbbbbbb, 1);<br />
container.graphics.lineStyle(0, 0&#215;666666, 1);<br />
container.graphics.drawTriangles(myMesh.vertices2D, myMesh.indices, null, TriangleCulling.POSITIVE);</p></blockquote>
<h4>Adding interactivity</h4>
<p>In order to add interactivity &#8211; say rotate our object via mouse movements &#8211; we can introduce one additional step before we call <em>projectVectors()</em>: We can use the new Matrix3D functions to add translation and rotation parameters.</p>
<blockquote><p>m2:Matrix3D = new Matrix3D();<br />
m2.identity();<br />
m2.prependTranslation(1, 0, 5);<br />
m2.prependRotation(rotY, Vector3D.Y_AXIS);<br />
m2.prependRotation(rotX, Vector3D.X_AXIS);<br />
m2.transformVectors(myMesh.vertices3D, myMesh.vertices3D2);<br />
Utils3D.projectVectors(m, myMesh.vertices3D2, myMesh.vertices2D, myMesh.uvtData);</p></blockquote>
<h4>Export from 3D Package</h4>
<p>Now that we can render 3D objects we like to use polygonal models from a 3D package. There are a set of ASCII formats that can easily be converted to ActionScript arrays (e.g. VRML or obj). In case of the open source animation system Blender there are also scripts that directly export to Actionscript compatible with Sandy, Papervision and Away3D. It is easy to create a similar script to export to a simple AS3 mesh class that holds the data for our vertices3D, our indices of the face set, as well as provides the arrays for vertices2D and uvtData.</p>
<p>See some results of simple 3D objects:</p>
<p style="text-align: center">&nbsp;</p>
<p id="swfdiv3" style="text-align: center">Note: The proper version of <a href="http://www.adobe.com/go/getflashplayer">Flash Player</a> is not installed or JavaScript is not enabled. Unable to display SWF content.</p>
<p><script type="text/javascript"> var swfobj = new SWFObject( "http://www.yswfblog.com/blog/wp-content/uploads/2008/11/3d_ring.swf", "3D Ring", "200", "200", "10.0.0" ); swfobj.write( "swfdiv3" ); </script></p>
<p id="swfdiv4" style="text-align: center">Note: The proper version of <a href="http://www.adobe.com/go/getflashplayer">Flash Player</a> is not installed or JavaScript is not enabled. Unable to display SWF content.</p>
<p><script type="text/javascript"> var swfobj = new SWFObject( "http://www.yswfblog.com/blog/wp-content/uploads/2008/11/3d_torus.swf", "3D Ring", "200", "200", "10.0.0" ); swfobj.write( "swfdiv4" ); </script></p>
<p>Attached is the <a href="http://www.yswfblog.com/blog/wp-content/uploads/2008/11/source.zip">source for the 3d Cube</a>.</p>
<p>&#8230; to be continued</p>
]]></content:encoded>
			<wfw:commentRss>http://www.yswfblog.com/blog/2008/11/12/3d-with-flash-10-part-2/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>3D with Flash 10: Simple Way First</title>
		<link>http://www.yswfblog.com/blog/2008/11/10/3d-with-flash-10-simple-way-first/</link>
		<comments>http://www.yswfblog.com/blog/2008/11/10/3d-with-flash-10-simple-way-first/#comments</comments>
		<pubDate>Mon, 10 Nov 2008 13:00:10 +0000</pubDate>
		<dc:creator>Allen Rabinovich</dc:creator>
				<category><![CDATA[Flash]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://www.yswfblog.com/blog/2008/11/10/3d-with-flash-10-simple-way-first/</guid>
		<description><![CDATA[As you are probably well-aware, Flash Player 10 was recently released. In this milestone release, Adobe once again introduced a number of great new features, making the player ever so powerful and useful in a wide range of projects. As we are actively exploring the new player for the many upcoming components and libraries in [...]]]></description>
			<content:encoded><![CDATA[<p>As you are probably well-aware, Flash Player 10 was recently released. In this milestone release, Adobe once again introduced a number of great new features, making the player ever so powerful and useful in a wide range of projects. As we are actively exploring the new player for the many upcoming components and libraries in the <a href="http://developer.yahoo.com/flash" target="_blank">ASTRA toolkit</a>, we thought it would help to dedicate a few blog posts to the features we found most interesting.</p>
<p>To start off, we&#8217;ll take a look at the feature we like to call &#8220;the new dimension.&#8221; For the first 9 versions, the native rendering in Flash was limited to the Cartesian coordinates. During that time, many ways to &#8220;fake&#8221; 3-dimensionality were invented and publicized, from the simple &#8220;skewing&#8221; methods to entire bitmap-based 3D rendering libraries, like <a href="http://blog.papervision3d.org/">Papervision</a> and <a href="http://alternativaplatform.com/">Alternativa</a>. Now, in the 10th version of Flash, a fair amount of 3D rendering capabilities have finally become native.</p>
<p>To check out this new feature, take a look at a simple application (Note that you need to install Flash Player 10 to see it):</p>
<p><script src="http://us.js2.yimg.com/us.js.yimg.com/lib/flash/swfobject/1.0/swfobject.js" type="text/javascript"></script></p>
<p id="demo3d1" style="text-align: center">Note: The proper version of <a href="http://www.adobe.com/go/getflashplayer">Flash Player</a> is not installed or JavaScript is not enabled. Unable to display SWF content.</p>
<p><script type="text/javascript"> 	var swfobj = new SWFObject( "http://www.yswfblog.com/blog/wp-content/uploads/2008/11/simple3ddemo1.swf", "3DDemo1", "329", "427", "10.0.0" ); 	swfobj.write( "demo3d1" ); </script>Notice that instead of the old-time z-plane rotation (<em>DisplayObject.rotation</em>), we can now rotate a display object in all three planes (<em>DisplayObject.rotationX, DisplayObject.rotationY</em>, and <em>DisplayObject.rotationZ</em>), with perspective distortion thrown in for free. Also, in addition to the x and y coordinates, we can modify the z coordinate, which is visually equivalent to &#8220;scaling&#8221; the display object, but doesn&#8217;t actually change the scale values.</p>
<p>The beauty of this new feature is that it preserves the relation among coordinate systems of nested display objects. What does that mean? Well, let&#8217;s say you had a few display objects that you wanted to place in a stack, and then observe that stack as a 3D object &#8212; well, long story short, you can do just that.  Any changes to the 3D coordinates of the parent display object propagate down to the child, and so we can take the example above, and kick it up a notch:</p>
<p><script src="http://us.js2.yimg.com/us.js.yimg.com/lib/flash/swfobject/1.0/swfobject.js" type="text/javascript"></script></p>
<p id="demo3d2" style="text-align: center">Note: The proper version of <a href="http://www.adobe.com/go/getflashplayer">Flash Player</a> is not installed or JavaScript is not enabled. Unable to display SWF content.</p>
<p><script type="text/javascript"> 	var swfobj = new SWFObject( "http://www.yswfblog.com/blog/wp-content/uploads/2008/11/simple3ddemo2.swf", "3DDemo2", "329", "427", "10.0.0" ); 	swfobj.write( "demo3d2" ); </script></p>
<p>Now we&#8217;re cooking with gas! With just a few lines of code (included below the cut), we put together a simple and elegant way to look at a stack of images.</p>
<p>These newly added features for creating 3D interfaces will greatly facilitate building rich interactive applications, but they are not quite perfect. As <a href="http://justin.everett-church.com" target="_blank">Justin Everett-Church</a> once explained, using these properties is akin to creating &#8220;postcards in space&#8221; &#8212; it&#8217;s still a far cry from creating true 3D objects and environments, because modifying the three dimensions of rotation and position of planar objects doesn&#8217;t deal with more complex issues like back-face and occlusion culling, drawing primitive elements in 3D, etc. We&#8217;ll look at new features that go further in enabling more complex 3D work in the next post.</p>
<p>The MXML code for the examples above is below the cut.</p>
<p><span id="more-104"></span></p>
<p>Example 1:</p>
<blockquote><p> &lt;?xml version=&#8221;1.0&#8243; encoding=&#8221;utf-8&#8243;?&gt;<br />
&lt;mx:Application xmlns:mx=&#8221;http://www.adobe.com/2006/mxml&#8221; layout=&#8221;absolute&#8221; width=&#8221;329&#8243; height=&#8221;427&#8243;&gt;</p>
<p>&lt;mx:Label y=&#8221;34&#8243; text=&#8221;X rotation&#8221; horizontalCenter=&#8221;0&#8243;/&gt;<br />
&lt;mx:Label y=&#8221;80&#8243; text=&#8221;Y rotation&#8221; horizontalCenter=&#8221;0&#8243;/&gt;<br />
&lt;mx:Label y=&#8221;126&#8243; text=&#8221;Z rotation&#8221; horizontalCenter=&#8221;0&#8243;/&gt;<br />
&lt;mx:Label y=&#8221;167&#8243; text=&#8221;Z position&#8221; horizontalCenter=&#8221;0&#8243;/&gt;</p>
<p>&lt;mx:HSlider y=&#8221;179&#8243; id=&#8221;zPos&#8221; value=&#8221;0&#8243; minimum=&#8221;-50&#8243; maximum=&#8221;50&#8243; horizontalCenter=&#8221;0&#8243; liveDragging=&#8221;true&#8221;/&gt;<br />
&lt;mx:HSlider y=&#8221;46&#8243; id=&#8221;rotX&#8221; value=&#8221;0&#8243; minimum=&#8221;-90&#8243; maximum=&#8221;90&#8243; horizontalCenter=&#8221;0&#8243; liveDragging=&#8221;true&#8221;/&gt;<br />
&lt;mx:HSlider y=&#8221;92&#8243; id=&#8221;rotY&#8221; value=&#8221;0&#8243; minimum=&#8221;-90&#8243; maximum=&#8221;90&#8243; horizontalCenter=&#8221;0&#8243; liveDragging=&#8221;true&#8221;/&gt;<br />
&lt;mx:HSlider y=&#8221;138&#8243; id=&#8221;rotZ&#8221; value=&#8221;0&#8243; minimum=&#8221;-90&#8243; maximum=&#8221;90&#8243; horizontalCenter=&#8221;0&#8243; liveDragging=&#8221;true&#8221;/&gt;</p>
<p>&lt;mx:Image rotationX=&#8221;{rotX.value}&#8221; rotationY=&#8221;{rotY.value}&#8221; rotationZ=&#8221;{rotZ.value}&#8221; z=&#8221;{zPos.value}&#8221;<br />
y=&#8221;233&#8243; width=&#8221;182&#8243; height=&#8221;138&#8243; themeColor=&#8221;#FFFFFF&#8221; id=&#8221;myImage&#8221; scaleContent=&#8221;true&#8221; autoLoad=&#8221;true&#8221; horizontalCenter=&#8221;0&#8243;&gt;<br />
&lt;mx:source&gt;http://farm4.static.flickr.com/3136/2412535804_6fccd7a155.jpg&lt;/mx:source&gt;<br />
&lt;/mx:Image&gt;</p>
<p>&lt;/mx:Application&gt;</p></blockquote>
<p>Example 2:</p>
<blockquote><p> &lt;?xml version=&#8221;1.0&#8243; encoding=&#8221;utf-8&#8243;?&gt;<br />
&lt;mx:Application xmlns:mx=&#8221;http://www.adobe.com/2006/mxml&#8221; layout=&#8221;absolute&#8221; width=&#8221;329&#8243; height=&#8221;427&#8243;&gt;</p>
<p>&lt;mx:Label y=&#8221;34&#8243; text=&#8221;X rotation&#8221; horizontalCenter=&#8221;0&#8243;/&gt;<br />
&lt;mx:Label y=&#8221;80&#8243; text=&#8221;Y rotation&#8221; horizontalCenter=&#8221;0&#8243;/&gt;<br />
&lt;mx:Label y=&#8221;126&#8243; text=&#8221;Z rotation&#8221; horizontalCenter=&#8221;0&#8243;/&gt;<br />
&lt;mx:Label y=&#8221;167&#8243; text=&#8221;Z position&#8221; horizontalCenter=&#8221;0&#8243;/&gt;</p>
<p>&lt;mx:HSlider y=&#8221;179&#8243; id=&#8221;zPos&#8221; value=&#8221;0&#8243; minimum=&#8221;-50&#8243; maximum=&#8221;50&#8243; horizontalCenter=&#8221;0&#8243; liveDragging=&#8221;true&#8221;/&gt;<br />
&lt;mx:HSlider y=&#8221;46&#8243; id=&#8221;rotX&#8221; value=&#8221;0&#8243; minimum=&#8221;-90&#8243; maximum=&#8221;90&#8243; horizontalCenter=&#8221;0&#8243; liveDragging=&#8221;true&#8221;/&gt;<br />
&lt;mx:HSlider y=&#8221;92&#8243; id=&#8221;rotY&#8221; value=&#8221;0&#8243; minimum=&#8221;-90&#8243; maximum=&#8221;90&#8243; horizontalCenter=&#8221;0&#8243; liveDragging=&#8221;true&#8221;/&gt;<br />
&lt;mx:HSlider y=&#8221;138&#8243; id=&#8221;rotZ&#8221; value=&#8221;0&#8243; minimum=&#8221;-90&#8243; maximum=&#8221;90&#8243; horizontalCenter=&#8221;0&#8243; liveDragging=&#8221;true&#8221;/&gt;</p>
<p>&lt;mx:Container id=&#8221;imageStack&#8221; width=&#8221;182&#8243; height=&#8221;138&#8243; y=&#8221;228&#8243; rotationX=&#8221;{rotX.value}&#8221; rotationY=&#8221;{rotY.value}&#8221; rotationZ=&#8221;{rotZ.value}&#8221; z=&#8221;{zPos.value}&#8221;<br />
horizontalCenter=&#8221;0&#8243;&gt;<br />
&lt;mx:Image z=&#8221;50&#8243; width=&#8221;182&#8243; height=&#8221;138&#8243; themeColor=&#8221;#FFFFFF&#8221; id=&#8221;myImage1&#8243; scaleContent=&#8221;true&#8221; autoLoad=&#8221;true&#8221;&gt;<br />
&lt;mx:source&gt;http://farm3.static.flickr.com/2033/2411743383_38aa13de89.jpg&lt;/mx:source&gt;<br />
&lt;/mx:Image&gt;<br />
&lt;mx:Image z=&#8221;0&#8243; width=&#8221;182&#8243; height=&#8221;138&#8243; themeColor=&#8221;#FFFFFF&#8221; id=&#8221;myImage2&#8243; scaleContent=&#8221;true&#8221; autoLoad=&#8221;true&#8221;&gt;<br />
&lt;mx:source&gt;http://farm4.static.flickr.com/3282/2411740475_d6a44c913b.jpg&lt;/mx:source&gt;<br />
&lt;/mx:Image&gt;<br />
&lt;mx:Image z=&#8221;-50&#8243; width=&#8221;182&#8243; height=&#8221;138&#8243; themeColor=&#8221;#FFFFFF&#8221; id=&#8221;myImage3&#8243; scaleContent=&#8221;true&#8221; autoLoad=&#8221;true&#8221;&gt;<br />
&lt;mx:source&gt;http://farm4.static.flickr.com/3136/2412535804_6fccd7a155.jpg&lt;/mx:source&gt;<br />
&lt;/mx:Image&gt;<br />
&lt;/mx:Container&gt;</p>
<p>&lt;/mx:Application&gt;</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://www.yswfblog.com/blog/2008/11/10/3d-with-flash-10-simple-way-first/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>Yahoo! Open Strategy (Y!OS) for the Rest of Us</title>
		<link>http://www.yswfblog.com/blog/2008/10/29/yahoo-open-strategy-yos-for-the-rest-of-us/</link>
		<comments>http://www.yswfblog.com/blog/2008/10/29/yahoo-open-strategy-yos-for-the-rest-of-us/#comments</comments>
		<pubDate>Wed, 29 Oct 2008 23:44:07 +0000</pubDate>
		<dc:creator>Alaric Cole</dc:creator>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[Web APIs]]></category>

		<guid isPermaLink="false">http://www.yswfblog.com/blog/2008/10/29/yahoo-open-strategy-yos-for-the-rest-of-us/</guid>
		<description><![CDATA[In the last article, I hinted at Yahoo!&#8217;s Open Strategy, and mentioned that there were a few tools available for Flash and Flex developers: http://developer.yahoo.com/flash/yos. We&#8217;ve polished it up and it&#8217;s ready for release. So head on over and start developing!
To read more about Y!OS, check this out.
]]></description>
			<content:encoded><![CDATA[<p>In the last article, I hinted at <a href="http://developer.yahoo.com/yos/intro/">Yahoo!&#8217;s Open Strategy</a>, and mentioned that there were a few tools available for Flash and Flex developers: <a href="http://developer.yahoo.com/flash/yos">http://developer.yahoo.com/flash/yos</a>. We&#8217;ve polished it up and it&#8217;s ready for release. So head on over and start developing!</p>
<p>To read more about Y!OS, check <a href="http://developer.yahoo.com/yos/intro/" target="_blank">this</a> out.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.yswfblog.com/blog/2008/10/29/yahoo-open-strategy-yos-for-the-rest-of-us/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>With a Little App from my Friends</title>
		<link>http://www.yswfblog.com/blog/2008/09/23/with-a-little-app-from-my-friends/</link>
		<comments>http://www.yswfblog.com/blog/2008/09/23/with-a-little-app-from-my-friends/#comments</comments>
		<pubDate>Tue, 23 Sep 2008 12:59:56 +0000</pubDate>
		<dc:creator>Alaric Cole</dc:creator>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[Web APIs]]></category>

		<guid isPermaLink="false">http://www.yswfblog.com/blog/2008/09/23/with-a-little-app-from-my-friends/</guid>
		<description><![CDATA[
No doubt you&#8217;ve heard a little something about Yahoo!&#8217;s new open strategy. If you attended Open Hack Day, you would&#8217;ve even been able to use the new Social APIs, which allow you to build powerful social applications on our Yahoo! Applications Platform (YAP).
Not to let down the Flash folks, we&#8217;ve created some nice AS3 APIs [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: center"><img src="http://www.yswfblog.com/blog/wp-content/uploads/2008/10/app_example.png" alt="app_example.png" /></p>
<p>No doubt you&#8217;ve heard a little something about Yahoo!&#8217;s new <a href="http://developer.yahoo.net/blog/archives/2008/04/introducing_the_1.html">open strategy</a><a href="http://developer.yahoo.com/searchmonkey/"></a>. If you attended <a href="http://www.yswfblog.com/blog/2008/09/10/good-will-hacking/">Open Hack Day</a>, you would&#8217;ve even been able to use the new Social APIs, which allow you to build powerful social applications on our Yahoo! Applications Platform (YAP).</p>
<p>Not to let down the Flash folks, we&#8217;ve created some nice AS3 APIs that let you easily integrate social data and create a Flash or Flex application easily in YAP. There&#8217;s even a great Yahoo! theme for Flex applications, to give you a standard look and feel right from the start.</p>
<p>If you&#8217;re itching to see what this is all about, it&#8217;s currently available <strike>as a preview release</strike> at <a href="http://developer.yahoo.com/flash/yos">http://developer.yahoo.com/flash/yos</a>. <strike>While you won&#8217;t be able to actually use the services (sorry, coming soon),</strike> you can get a head start on learning the system and even begin developing your apps, as the code and documentation are all there for the taking. There&#8217;s even lots of source code for example applications, so you can be one step ahead of your friends.[Edit: it's now released!]</p>
]]></content:encoded>
			<wfw:commentRss>http://www.yswfblog.com/blog/2008/09/23/with-a-little-app-from-my-friends/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Yahoo! Music API: Listen</title>
		<link>http://www.yswfblog.com/blog/2008/09/08/yahoo-music-api-listen/</link>
		<comments>http://www.yswfblog.com/blog/2008/09/08/yahoo-music-api-listen/#comments</comments>
		<pubDate>Mon, 08 Sep 2008 12:00:39 +0000</pubDate>
		<dc:creator>Alaric Cole</dc:creator>
				<category><![CDATA[Flash]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[Web APIs]]></category>

		<guid isPermaLink="false">http://www.yswfblog.com/blog/2008/09/08/yahoo-music-api-listen/</guid>
		<description><![CDATA[
The Yahoo! Music API  is up and running. You can browse similar artists, gather more info than you ever wanted to know about a particular artist, get lists such as the most popular artists, and get user recommendations and ratings, to name a few. There&#8217;s also an easy-to-integrate Flash video player to let you embed [...]]]></description>
			<content:encoded><![CDATA[<p><script src="http://us.js2.yimg.com/us.js.yimg.com/lib/flash/swfobject/1.0/swfobject.js" type="text/javascript"></script></p>
<p>The <a href="http://developer.yahoo.com/music/" target="_blank">Yahoo! Music API</a>  is up and running. You can browse similar artists, gather more info than you ever wanted to know about a particular artist, get lists such as the most popular artists, and get user recommendations and ratings, to name a few. There&#8217;s also an easy-to-integrate Flash video player to let you embed music videos on your site.</p>
<p>The API has a liberal Flash policy file, so Flash and Flex developers can use it in their applications worry-free. Time to hone those E4X skills.</p>
<p id="swfdiv" style="text-align: center">Note: The proper version of <a href="http://www.adobe.com/go/getflashplayer">Flash Player</a> is not installed or JavaScript is not enabled. Unable to display SWF content.</p>
<p><script type="text/javascript"> 	var swfobj = new SWFObject( "http://www.yswfblog.com/blog/wp-content/uploads/2008/09/musicapifun.swf", "MusicAPIFun", "400", "500", "9.0.45" ); 	swfobj.write( "swfdiv" ); </script></p>
<p>The above example shows the top 25 artists in a Flex BubbleChart. The y axis shows popularity, with the most popular artists on top. The x axis shows the change since the last time the chart was taken, and the size of the bubbles is determined by the track count of the artist on Yahoo! Music.</p>
<p>Hover your mouse over the bubbles for more info. <a href="/blog/wp-content/uploads/2008/09/musicapifunsource/">Click here</a> for the source. (Note that this example also covers custom data functions for using complex XML in Flex charts, if you are so inclined.)</p>
]]></content:encoded>
			<wfw:commentRss>http://www.yswfblog.com/blog/2008/09/08/yahoo-music-api-listen/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>
