<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-17393483</id><updated>2012-01-19T05:04:06.504-08:00</updated><category term='geneticType'/><category term='Senocular'/><category term='relationship visualisation'/><category term='bats'/><category term='TreeItemRenderer'/><category term='MotionPath'/><category term='Arcade Game'/><category term='Image'/><category term='alignment'/><category term='flash player 10'/><category term='AdvancedDataGrid'/><category term='getColorBoundsRect'/><category term='APE'/><category term='pseudo color'/><category term='Reaction–diffusion'/><category term='ShaderJob'/><category term='datechooser'/><category term='isTruncated'/><category term='poisson distribution'/><category term='GroupingCollection'/><category term='PixelBender'/><category term='Flex'/><category term='user interaction'/><category term='flashsandy'/><category term='FlexCamp'/><category term='countdown'/><category term='node based interface'/><category term='genetic algorithm'/><category term='Pixel Bender'/><category term='dynamic audio'/><category term='EventBroker'/><category term='6Music'/><category term='Computational Fluid Dynamics'/><category term='presentation model'/><category term='Mate'/><category term='Flex 4 skinning'/><category term='bezier curves'/><category term='DynamicCommand'/><category term='flint'/><category term='echolocation'/><category term='vector graphics'/><category term='gesture recognition'/><category term='Sandy'/><category term='HierarchicalData'/><category term='tree'/><category term='tone generator'/><category term='justified'/><category term='perpsectiveProjection'/><category term='Bangkok'/><category term='Keyframe'/><category term='perspective projection'/><category term='DZone'/><category term='ActionScript'/><category term='itemRenderer'/><category term='DataGrid'/><category term='HorizontalList'/><category term='September bug'/><category term='video player'/><category term='AnimateTransform'/><category term='graphs'/><category term='CalendarLayout'/><category term='particles'/><category term='PressAndHoldButton'/><category term='DevelopmentArc'/><category term='ObjectUtil.copy'/><category term='typography'/><category term='frameworks'/><category term='ShaderInput'/><category term='domainModel'/><category term='GroupingField'/><category term='ray plane intersection'/><category term='morphogenesis'/><category term='BitmapData'/><category term='recruitment'/><category term='animateColor'/><category term='Smerins'/><category term='registerClassAlias'/><category term='particlelab'/><category term='astro'/><category term='Belousov–Zhabotinsky'/><category term='Scalextric'/><category term='HCI'/><category term='Physics'/><category term='false color'/><category term='sorting'/><category term='doppler'/><category term='TabNavigator'/><category term='Away3D'/><category term='circle graph'/><category term='listData'/><category term='centered'/><category term='CFDevCon'/><category term='3d Button'/><category term='Truncated'/><category term='motion control'/><category term='3D'/><category term='Asteroids'/><category term='gumbo'/><category term='Design Pattern'/><category term='ShaderParameter'/><category term='Declarative Graphics'/><category term='state transitions'/><category term='AdvancedDataGridColumn'/><category term='parsley'/><category term='sound synthesis'/><category term='Thailand'/><category term='BatSense'/><category term='calculator'/><title type='text'>FlexMonkey</title><subtitle type='html'>...flex, air and adventures in user experience...</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://flexmonkey.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/17393483/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://flexmonkey.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Simon Gladman</name><uri>http://www.blogger.com/profile/17449788450837731883</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='28' height='32' src='http://4.bp.blogspot.com/_FGrZThm5JBo/TQ8ZMdgNEUI/AAAAAAAACy4/WGeOchj5VWk/S220/simon_venice.jpg'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>73</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-17393483.post-5693009313373314458</id><published>2011-10-24T00:38:00.000-07:00</published><updated>2011-10-24T01:07:40.302-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ActionScript'/><category scheme='http://www.blogger.com/atom/ns#' term='PixelBender'/><category scheme='http://www.blogger.com/atom/ns#' term='Pixel Bender'/><category scheme='http://www.blogger.com/atom/ns#' term='Flex'/><category scheme='http://www.blogger.com/atom/ns#' term='Reaction–diffusion'/><category scheme='http://www.blogger.com/atom/ns#' term='Belousov–Zhabotinsky'/><title type='text'>Simulating Belousov-Zhabotinsky Reactions in Pixel Bender</title><content type='html'>&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://www.flexmonkey.co.uk/pixel-bender-belousov/PixelBenderBelousov.html" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="153" src="http://3.bp.blogspot.com/-2SIIhCauoUo/TqUSaz_dMiI/AAAAAAAADFw/E7qxlxmukAk/s320/belousov.jpg" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;Earlier this year, I wrote a &lt;a href="http://flexmonkey.blogspot.com/2011/01/simulating-belousovzhabotinsky.html"&gt;Belousov-Zhabotinsky simulation in ActionScript&lt;/a&gt;. Although very pretty, this sort of code is fairly slow in AS and deserved to be ported to &lt;a href="http://www.adobe.com/devnet/pixelbender.html"&gt;Pixel Bender&lt;/a&gt;. So last night, I downloaded the Pixel Bender Toolkit and set about writing my first ever Pixel Bender shader.&lt;br /&gt;&lt;br /&gt;The BZ reaction code I used was originally written for &lt;a href="http://processing.org/"&gt;Processing&lt;/a&gt;&amp;nbsp;by &lt;a href="http://eprints.ucl.ac.uk/17241/1/17241.pdf"&gt;Alasdair Turner&lt;/a&gt;&amp;nbsp;and is pretty simple - consisting of three lines of code to determine the values for each pixel in three 'channels' which refer to the three chemicals in the reaction.&lt;br /&gt;&lt;br /&gt;Rather than manually looping over each pixel as the AS (and Processing) code, Pixel Bender has an &lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;evaluatePixel()&lt;/span&gt; method with is invoked for each pixel in parallel (or as parallel as possible). I sample each surrounding pixel using and average those values using a box blur. Finally, I set the output pixel based on the BZ algorithm.&lt;br /&gt;&lt;br /&gt;The output is far nippier that the AS version and, because Pixel Bender filters execute on the GPU, the UI is far more responsive. I've added some quick-and-dirty drawing tools: the swatches in the left hand toolbar allow the user to select a colour draw on the screen.&lt;br /&gt;&lt;br /&gt;I've included my Pixel Bender Kernel along with the compiled filter under the assets directory in the source code.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.flexmonkey.co.uk/pixel-bender-belousov/PixelBenderBelousov.html"&gt;The application lives here&lt;/a&gt; and the &lt;a href="http://www.flexmonkey.co.uk/pixel-bender-belousov/srcview/index.html"&gt;source code is available here&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/17393483-5693009313373314458?l=flexmonkey.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://flexmonkey.blogspot.com/feeds/5693009313373314458/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=17393483&amp;postID=5693009313373314458' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/17393483/posts/default/5693009313373314458'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/17393483/posts/default/5693009313373314458'/><link rel='alternate' type='text/html' href='http://flexmonkey.blogspot.com/2011/10/simulating-belousov-zhabotinsky.html' title='Simulating Belousov-Zhabotinsky Reactions in Pixel Bender'/><author><name>Simon Gladman</name><uri>http://www.blogger.com/profile/17449788450837731883</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='28' height='32' src='http://4.bp.blogspot.com/_FGrZThm5JBo/TQ8ZMdgNEUI/AAAAAAAACy4/WGeOchj5VWk/S220/simon_venice.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/-2SIIhCauoUo/TqUSaz_dMiI/AAAAAAAADFw/E7qxlxmukAk/s72-c/belousov.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-17393483.post-8830667280834026305</id><published>2011-10-20T00:59:00.000-07:00</published><updated>2011-10-20T02:40:25.054-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ActionScript'/><category scheme='http://www.blogger.com/atom/ns#' term='tone generator'/><category scheme='http://www.blogger.com/atom/ns#' term='node based interface'/><category scheme='http://www.blogger.com/atom/ns#' term='Flex'/><category scheme='http://www.blogger.com/atom/ns#' term='sound synthesis'/><title type='text'>Flex Node Editor Tone Generator</title><content type='html'>&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://flexmonkey.co.uk/node-tone-generator/ParsleyPresentationModel.html" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="203" src="http://2.bp.blogspot.com/-IFQS5qKiadU/Tp_Q9tb67uI/AAAAAAAADFo/pP0BYv2xrTM/s400/tonegen.tiff" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;The last time I tinkered with node editors was &lt;a href="http://flexmonkey.blogspot.com/2010/07/decoupling-presentation-layer-joy-of.html"&gt;over a year ago&lt;/a&gt;, but in that time I've played with applications like &lt;a href="http://www.sidefx.com/"&gt;Houdini&lt;/a&gt; and thought about ways to improve the user experience. So over the last few weekends, I've resurrected my old node editor and extended it to a node based tone generator.&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;The main change is that nodes are now circular rather than square. This means that the input and output arrows can live anywhere on the node's circumference and eliminates any need for directionality in the graph. The flow of the graph can match the user's mental model rather than having to comply with an implementation model.&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;Also, being circles, it's easy to add some basic code to simulate some very simple physics. I've created a quick and dirty method for the nodes to repel each other.&amp;nbsp;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;I've kept in the node editor screen on the right hand side, but also added a &lt;a href="http://www.useit.com/alertbox/springload.html"&gt;spring loaded&lt;/a&gt; context editor. If you press the SHIFT button while hovering over a node, a mini-editor pops over that node.&amp;nbsp;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;Relationships between nodes can be created by dragging from the grey pop up border to another node. Right now, relationships can only be deleted by clicking the checkboxes in the right hand panel.&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;The sound synthesis part is, for me, secondary to the node editor, so I haven't spent ages on it. It's worth knowing that to synthesis a sound, the code has to get 8192 samples and sadly it isn't super fast. To help with&amp;nbsp;perceived&amp;nbsp;performance, each time the 'play' button is pressed after the data changes the data is 'baked' - i.e. stored in a buffer array. Subsequent plays use that buffer and don't require recalculating.&amp;nbsp;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;The real reason behind this is to revisit some &lt;a href="http://flexmonkey.blogspot.com/search/label/PixelBender"&gt;old experiments I was doing with Pixel Bender&lt;/a&gt;. Hopefully over the next few weeks, I'll swap out the tone generator code and plug in image handling.&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;In the meantime, feel free to have a play. &lt;a href="http://flexmonkey.co.uk/node-tone-generator/ParsleyPresentationModel.html"&gt;The application lives here&lt;/a&gt;. Some of the code ain't that pretty, so I haven't released the source.&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/17393483-8830667280834026305?l=flexmonkey.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://flexmonkey.blogspot.com/feeds/8830667280834026305/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=17393483&amp;postID=8830667280834026305' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/17393483/posts/default/8830667280834026305'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/17393483/posts/default/8830667280834026305'/><link rel='alternate' type='text/html' href='http://flexmonkey.blogspot.com/2011/10/flex-node-editor-tone-generator.html' title='Flex Node Editor Tone Generator'/><author><name>Simon Gladman</name><uri>http://www.blogger.com/profile/17449788450837731883</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='28' height='32' src='http://4.bp.blogspot.com/_FGrZThm5JBo/TQ8ZMdgNEUI/AAAAAAAACy4/WGeOchj5VWk/S220/simon_venice.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/-IFQS5qKiadU/Tp_Q9tb67uI/AAAAAAAADFo/pP0BYv2xrTM/s72-c/tonegen.tiff' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-17393483.post-7853283623970607872</id><published>2011-10-19T12:17:00.001-07:00</published><updated>2011-10-19T12:17:45.055-07:00</updated><title type='text'>A Blast From The Past!</title><content type='html'>&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://www.flexmonkey.co.uk/spaceBalls/SpaceBalls.html" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="293" src="http://2.bp.blogspot.com/-4Ejh5PjhlLA/Tp8hC6PBSEI/AAAAAAAADFc/uWG1b6fmPzM/s400/spaceballs.jpg" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;span class="Apple-style-span" style="font-family: 'Helvetica Neue', Arial, Helvetica, sans-serif;"&gt;After a server change at Flex Monkey Towers, a few of the links on my blog died. I only just noticed today that the links to &lt;a href="http://flexmonkey.blogspot.com/search/label/Asteroids"&gt;SpaceBalls, my Asteroids inspired physics based game&lt;/a&gt;, had also died. A quick tinker later and they're back up and running.&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;span class="Apple-style-span" style="font-family: 'Helvetica Neue', Arial, Helvetica, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;span class="Apple-style-span" style="font-family: 'Helvetica Neue', Arial, Helvetica, sans-serif;"&gt;&lt;a href="http://www.flexmonkey.co.uk/spaceBalls/SpaceBalls.html"&gt;Here's the game&lt;/a&gt;, with no code rot after 3.5 years. The little blue space ship points towards the mouse pointer, the mouse button fires a missile and the space bar fires your thruster.&lt;/span&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;span class="Apple-style-span" style="font-family: 'Helvetica Neue', Arial, Helvetica, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;span class="Apple-style-span" style="font-family: 'Helvetica Neue', Arial, Helvetica, sans-serif;"&gt;Brings back happy coding memories :)&lt;/span&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/17393483-7853283623970607872?l=flexmonkey.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://flexmonkey.blogspot.com/feeds/7853283623970607872/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=17393483&amp;postID=7853283623970607872' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/17393483/posts/default/7853283623970607872'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/17393483/posts/default/7853283623970607872'/><link rel='alternate' type='text/html' href='http://flexmonkey.blogspot.com/2011/10/blast-from-past.html' title='A Blast From The Past!'/><author><name>Simon Gladman</name><uri>http://www.blogger.com/profile/17449788450837731883</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='28' height='32' src='http://4.bp.blogspot.com/_FGrZThm5JBo/TQ8ZMdgNEUI/AAAAAAAACy4/WGeOchj5VWk/S220/simon_venice.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/-4Ejh5PjhlLA/Tp8hC6PBSEI/AAAAAAAADFc/uWG1b6fmPzM/s72-c/spaceballs.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-17393483.post-5297128262570694646</id><published>2011-08-09T12:38:00.000-07:00</published><updated>2011-08-09T12:38:56.606-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='isTruncated'/><category scheme='http://www.blogger.com/atom/ns#' term='ActionScript'/><category scheme='http://www.blogger.com/atom/ns#' term='Truncated'/><category scheme='http://www.blogger.com/atom/ns#' term='Flex'/><title type='text'>Reacting to changes to isTruncated on Spark Labels</title><content type='html'>If you've ever wanted to execute some code when a Spark Label's text is truncated, you may hope that binding to the &lt;i&gt;isTruncated&lt;/i&gt; property would do the job. For example, you may want to set the background colour:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class="p1"&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&lt;span class="s1"&gt;&amp;lt;s:Label&lt;/span&gt; id="&lt;span class="s2"&gt;labelA&lt;/span&gt;"&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div class="p1"&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&amp;nbsp;backgroundColor="&lt;span class="s2"&gt;{&lt;/span&gt;labelA.isTruncated ? 0xFF0000 : 0xFFFFFF&lt;span class="s2"&gt;}&lt;/span&gt;" &lt;span class="s1"&gt;/&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="p1"&gt;&lt;span class="s1"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="p1"&gt;&lt;span class="s1"&gt;However, the &lt;i&gt;isTruncated&lt;/i&gt; property isn't bindable, so you need to dig a little deeper. Inside the TextBase class, the &lt;i&gt;setIsTruncated() &lt;/i&gt;method dispatches a &lt;i&gt;isTruncatedChanged&lt;/i&gt; event when the truncation state changes. This event isn't in the meta data, so you need to assign an event handler manually:&lt;/span&gt;&lt;/div&gt;&lt;div class="p1"&gt;&lt;span class="s1"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="p1"&gt;&lt;span class="s1"&gt;           &lt;/span&gt;&lt;/div&gt;&lt;div class="p1"&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&lt;span class="s1"&gt;&amp;lt;s:Label&lt;/span&gt; id="&lt;span class="s2"&gt;labelB&lt;/span&gt;"&lt;/span&gt;&lt;/div&gt;&lt;div class="p1"&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&amp;nbsp;creationComplete="labelB_creationCompleteHandler(event)"&lt;span class="s1"&gt;/&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="p1"&gt;&lt;span class="s1"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="p1"&gt;&lt;span class="s1"&gt;The creation complete handler assigns a further handler when the isTruncatedChanged event is fired to set the background colour:&lt;/span&gt;&lt;/div&gt;&lt;div class="p1"&gt;&lt;span class="s1"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="p1"&gt;&lt;span class="s1"&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;           &lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="p1"&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&lt;span class="s1"&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;/span&gt;&amp;lt;fx:Script&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt; &lt;div class="p2"&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&amp;lt;![CDATA[&lt;/div&gt;&lt;div class="p2"&gt;&lt;span class="Apple-tab-span"&gt;&lt;/span&gt;&lt;span class="Apple-tab-span"&gt;&lt;/span&gt;&lt;span class="Apple-tab-span"&gt;&lt;/span&gt;&lt;span class="s2"&gt;&amp;nbsp;import&lt;/span&gt; mx.events.FlexEvent;&lt;/div&gt;&lt;div class="p2"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="p3"&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;/div&gt;&lt;div class="p2"&gt;&lt;span class="Apple-tab-span"&gt;&lt;/span&gt;&lt;span class="Apple-tab-span"&gt;&lt;/span&gt;&lt;span class="Apple-tab-span"&gt;&lt;/span&gt;&lt;span class="s2"&gt;&amp;nbsp;protected&lt;/span&gt; &lt;span class="s3"&gt;function&lt;/span&gt; labelB_creationCompleteHandler(event:FlexEvent):&lt;span class="s2"&gt;void&lt;/span&gt;&lt;/div&gt;&lt;div class="p2"&gt;&lt;span class="Apple-tab-span"&gt;&lt;/span&gt;&lt;span class="Apple-tab-span"&gt;&lt;/span&gt;&lt;span class="Apple-tab-span"&gt;&lt;/span&gt;&amp;nbsp;{&lt;/div&gt;&lt;div class="p2"&gt;&lt;span class="Apple-tab-span"&gt;&lt;/span&gt;&lt;span class="Apple-tab-span"&gt;&lt;/span&gt;&lt;span class="Apple-tab-span"&gt;&lt;/span&gt;&lt;span class="Apple-tab-span"&gt;&lt;/span&gt;&amp;nbsp; labelB.addEventListener(&lt;span class="s4"&gt;'isTruncatedChanged'&lt;/span&gt;, isTruncatedChangeHandler)&lt;/div&gt;&lt;div class="p2"&gt;&lt;span class="Apple-tab-span"&gt;&lt;/span&gt;&lt;span class="Apple-tab-span"&gt;&lt;/span&gt;&lt;span class="Apple-tab-span"&gt;&lt;/span&gt;&amp;nbsp;}&lt;/div&gt;&lt;div class="p2"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="p3"&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;/div&gt;&lt;div class="p2"&gt;&lt;span class="Apple-tab-span"&gt;&lt;/span&gt;&lt;span class="Apple-tab-span"&gt;&lt;/span&gt;&lt;span class="Apple-tab-span"&gt;&lt;/span&gt;&lt;span class="s2"&gt;&amp;nbsp;private&lt;/span&gt; &lt;span class="s3"&gt;function&lt;/span&gt; isTruncatedChangeHandler(event : Event):&lt;span class="s2"&gt;void&lt;/span&gt;&lt;/div&gt;&lt;div class="p2"&gt;&lt;span class="Apple-tab-span"&gt;&lt;/span&gt;&lt;span class="Apple-tab-span"&gt;&lt;/span&gt;&lt;span class="Apple-tab-span"&gt;&lt;/span&gt;&amp;nbsp;{&lt;/div&gt;&lt;div class="p2"&gt;&lt;span class="Apple-tab-span"&gt;&lt;/span&gt;&lt;span class="Apple-tab-span"&gt;&lt;/span&gt;&lt;span class="Apple-tab-span"&gt;&lt;/span&gt;&lt;span class="Apple-tab-span"&gt;&lt;/span&gt;&amp;nbsp; labelB.setStyle(&lt;span class="s4"&gt;'backgroundColor'&lt;/span&gt;, labelB.isTruncated ? 0xFF0000 : 0xFFFFFF);&amp;nbsp;&lt;/div&gt;&lt;div class="p2"&gt;&lt;span class="Apple-tab-span"&gt;&lt;/span&gt;&lt;span class="Apple-tab-span"&gt;&lt;/span&gt;&lt;span class="Apple-tab-span"&gt;&lt;/span&gt;&amp;nbsp;}&lt;/div&gt;&lt;div class="p3"&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;/div&gt;&lt;div class="p2"&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;]]&amp;gt;&lt;/div&gt;&lt;div class="p1"&gt;&lt;span class="s1"&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;/span&gt;&amp;lt;/fx:Script&amp;gt;&lt;/div&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/17393483-5297128262570694646?l=flexmonkey.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://flexmonkey.blogspot.com/feeds/5297128262570694646/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=17393483&amp;postID=5297128262570694646' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/17393483/posts/default/5297128262570694646'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/17393483/posts/default/5297128262570694646'/><link rel='alternate' type='text/html' href='http://flexmonkey.blogspot.com/2011/08/reacting-to-changes-to-istruncated-on.html' title='Reacting to changes to isTruncated on Spark Labels'/><author><name>Simon Gladman</name><uri>http://www.blogger.com/profile/17449788450837731883</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='28' height='32' src='http://4.bp.blogspot.com/_FGrZThm5JBo/TQ8ZMdgNEUI/AAAAAAAACy4/WGeOchj5VWk/S220/simon_venice.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-17393483.post-2100880159065832945</id><published>2011-03-06T09:02:00.000-08:00</published><updated>2011-03-06T09:02:36.854-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='user interaction'/><category scheme='http://www.blogger.com/atom/ns#' term='PressAndHoldButton'/><category scheme='http://www.blogger.com/atom/ns#' term='Flex'/><title type='text'>A Flex Alternative to 'Are You Sure' Dialogs</title><content type='html'>&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://www.flexmonkey.co.uk/PressAndHold-release/PressAndHoldButtonDemo.html" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="192" src="http://1.bp.blogspot.com/-Z3rZDSQF9dw/TXO5D5NMmmI/AAAAAAAAC64/qIcFlt486wM/s400/pressandhold.png" width="333" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;One of my pet hates in interaction design is the use of confirmation dialogs before the user attempts to do anything of worth. More often than not, with a bit of thought most user actions could be recoverable and rather than &lt;a href="http://www.amazon.com/About-Face-Essentials-Interaction-Design/dp/0470084111/ref=sr_1_1?ie=UTF8&amp;amp;s=books&amp;amp;qid=1279145077&amp;amp;sr=1-1"&gt;stopping the proceedings with idiocy&lt;/a&gt;&amp;nbsp;the user could simply press 'undo' and return to their previous state.&lt;br /&gt;&lt;br /&gt;One of my favourite articles bemoaning the use of modal dialogs is &lt;a href="http://www.codinghorror.com/blog/2006/09/unnecessary-dialogs-stopping-the-proceedings-with-idiocy.html"&gt;this one&lt;/a&gt; by Jeff Atwood.&lt;br /&gt;&lt;br /&gt;However, sometimes a user's action isn't undoable. For instance, detonating an explosive charge ain't easy to undo. In scenarios like this, modal confirmation dialogs still aren't a real solution. Users don't read the text in dialog boxes and simply pressing 'ok' becomes habitual.&lt;br /&gt;&lt;br /&gt;What's needed in these situations is a button that requires a&amp;nbsp;definite and&amp;nbsp;decisive user action and maybe my &lt;a href="http://www.flexmonkey.co.uk/PressAndHold-release/PressAndHoldButtonDemo.html"&gt;PressAndHoldButton&lt;/a&gt; does the trick. This requires the user to keep the button held down for some period of time before firing an event.&amp;nbsp;&lt;br /&gt;&lt;br /&gt;The demo has three buttons - before any of those actions are performed, the user has to keep the relevant button depressed for five seconds.&lt;br /&gt;&lt;br /&gt;The demo application is available &lt;a href="http://www.flexmonkey.co.uk/PressAndHold-release/PressAndHoldButtonDemo.html"&gt;here&lt;/a&gt; and the source code &lt;a href="http://www.flexmonkey.co.uk/PressAndHold-release/srcview/index.html"&gt;here&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/17393483-2100880159065832945?l=flexmonkey.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://flexmonkey.blogspot.com/feeds/2100880159065832945/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=17393483&amp;postID=2100880159065832945' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/17393483/posts/default/2100880159065832945'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/17393483/posts/default/2100880159065832945'/><link rel='alternate' type='text/html' href='http://flexmonkey.blogspot.com/2011/03/flex-alternative-to-are-you-sure.html' title='A Flex Alternative to &apos;Are You Sure&apos; Dialogs'/><author><name>Simon Gladman</name><uri>http://www.blogger.com/profile/17449788450837731883</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='28' height='32' src='http://4.bp.blogspot.com/_FGrZThm5JBo/TQ8ZMdgNEUI/AAAAAAAACy4/WGeOchj5VWk/S220/simon_venice.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/-Z3rZDSQF9dw/TXO5D5NMmmI/AAAAAAAAC64/qIcFlt486wM/s72-c/pressandhold.png' height='72' width='72'/><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-17393483.post-4801452890282085413</id><published>2011-01-23T07:34:00.000-08:00</published><updated>2011-01-23T08:10:22.971-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ActionScript'/><category scheme='http://www.blogger.com/atom/ns#' term='morphogenesis'/><category scheme='http://www.blogger.com/atom/ns#' term='Flex'/><category scheme='http://www.blogger.com/atom/ns#' term='Belousov–Zhabotinsky'/><title type='text'>Simulating Belousov–Zhabotinsky Reactions in Flex</title><content type='html'>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://www.flexmonkey.co.uk/belousov/BelousovZhabotinskyPlayground.html"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 257px;" src="http://1.bp.blogspot.com/_FGrZThm5JBo/TTxLAt7YkxI/AAAAAAAAC1E/EdbEZihFslA/s400/belousov.png" border="0" alt="" id="BLOGGER_PHOTO_ID_5565405715223843602" /&gt;&lt;/a&gt;The &lt;a href="http://en.wikipedia.org/wiki/Belousov%E2%80%93Zhabotinsky_reaction"&gt;Belousov-Zhabotinsky&lt;/a&gt; (BZ) reaction is a class of chemical reaction that exhibits morphogenesis or spontaneous pattern creation. The mechanism by which it generates patterns is known as reaction-diffusion and was actually separately proposed by Alan Turing in his famous paper, "&lt;a href="http://www.turingarchive.org/browse.php/B/22"&gt;The Chemical Basis of Morphogenesis&lt;/a&gt;".&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;I stumbled across &lt;a href="http://eprints.ucl.ac.uk/17241/1/17241.pdf"&gt;this paper&lt;/a&gt; written by Alasdair Turner. He wrote some code for &lt;a href="http://processing.org/"&gt;Processing&lt;/a&gt; to simulate the reaction, so I spent a little time this morning porting it to ActionScript and giving it a UI.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;The initial condition is a randomised and homogenous mix of values. As the simulation runs, typical BZ spirals and circles appear - this is morphogenesis.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;I've added horizontal sliders to tweak the rate of reaction between the different substrates in the reaction. Subtle variations in these rates can change the patterns between circles and spirals and have can get the entire virtual petri dish oscillating.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;I've also added &lt;a href="http://en.wikipedia.org/wiki/False-color"&gt;false color rendering&lt;/a&gt; to the output. The values from the BZ solver range from 0 to 1, my code gets the colour value from a linear gradient based on the reaction value in each cell. The list on the left has a handful of gradients that can be selected.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;The code itself is pretty simple - with the exception of an item renderer for the gradients in the list, all the code sits in the main application MXML file. However, it's doing a lot of work each frame and isn't fast.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Does this code simulate 'real reactions? Belousov himself had problems trying to publish his work because he couldn't really explain his findings and there was some disbelief the reaction existed at all. However, there are plenty of examples on YouTube of BZ spirals appearing out of chemical reactions.&lt;br /&gt;&lt;br /&gt;&lt;iframe title="YouTube video player" class="youtube-player" type="text/html" width="320" height="240" src="http://www.youtube.com/embed/3JAqrRnKFHo" frameborder="0" allowfullscreen=""&gt;&lt;/iframe&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;The application &lt;a href="http://www.flexmonkey.co.uk/belousov/BelousovZhabotinskyPlayground.html"&gt;lives here&lt;/a&gt; and the source code is available &lt;a href="http://www.flexmonkey.co.uk/belousov/srcview/index.html"&gt;here&lt;/a&gt;.&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/17393483-4801452890282085413?l=flexmonkey.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://flexmonkey.blogspot.com/feeds/4801452890282085413/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=17393483&amp;postID=4801452890282085413' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/17393483/posts/default/4801452890282085413'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/17393483/posts/default/4801452890282085413'/><link rel='alternate' type='text/html' href='http://flexmonkey.blogspot.com/2011/01/simulating-belousovzhabotinsky.html' title='Simulating Belousov–Zhabotinsky Reactions in Flex'/><author><name>Simon Gladman</name><uri>http://www.blogger.com/profile/17449788450837731883</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='28' height='32' src='http://4.bp.blogspot.com/_FGrZThm5JBo/TQ8ZMdgNEUI/AAAAAAAACy4/WGeOchj5VWk/S220/simon_venice.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_FGrZThm5JBo/TTxLAt7YkxI/AAAAAAAAC1E/EdbEZihFslA/s72-c/belousov.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-17393483.post-1960136249498559967</id><published>2010-12-20T00:53:00.000-08:00</published><updated>2010-12-20T01:02:45.708-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Smerins'/><category scheme='http://www.blogger.com/atom/ns#' term='6Music'/><title type='text'>Happy Christmas in a Ska Style</title><content type='html'>&lt;object width="400" height="300"&gt;&lt;param name="movie" value="http://www.youtube.com/v/oUOcNuCsLa0&amp;amp;hl=en_US&amp;amp;feature=player_embedded&amp;amp;version=3"&gt;&lt;param name="allowFullScreen" value="true"&gt;&lt;param name="allowScriptAccess" value="always"&gt;&lt;embed src="http://www.youtube.com/v/oUOcNuCsLa0&amp;amp;hl=en_US&amp;amp;feature=player_embedded&amp;amp;version=3" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" width="400" height="300"&gt;&lt;/embed&gt;&lt;/object&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Not even vaguely Flex related, but how is this for a festive work of genius by &lt;a href="http://www.smerins.com/"&gt;Smerins Anti-Social Club&lt;/a&gt;? They were given a week to create this Ska version of &lt;i&gt;Walking In The Air&lt;/i&gt; - suggested by listeners of &lt;a href="http://www.bbc.co.uk/6music/"&gt;6Music&lt;/a&gt; and, man alive, it sounds amazing!&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/17393483-1960136249498559967?l=flexmonkey.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://flexmonkey.blogspot.com/feeds/1960136249498559967/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=17393483&amp;postID=1960136249498559967' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/17393483/posts/default/1960136249498559967'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/17393483/posts/default/1960136249498559967'/><link rel='alternate' type='text/html' href='http://flexmonkey.blogspot.com/2010/12/happy-christmas-in-ska-style.html' title='Happy Christmas in a Ska Style'/><author><name>Simon Gladman</name><uri>http://www.blogger.com/profile/17449788450837731883</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='28' height='32' src='http://4.bp.blogspot.com/_FGrZThm5JBo/TQ8ZMdgNEUI/AAAAAAAACy4/WGeOchj5VWk/S220/simon_venice.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-17393483.post-1772422147226613922</id><published>2010-12-19T06:41:00.000-08:00</published><updated>2010-12-19T06:49:29.634-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='datechooser'/><category scheme='http://www.blogger.com/atom/ns#' term='Flex'/><category scheme='http://www.blogger.com/atom/ns#' term='September bug'/><title type='text'>Flex DateChooser 'September' Bug</title><content type='html'>There's an odd little bug with the MX DateChooser. If you put it inside a PopUpAnchor, it always seems to display September in the top bar. This seems an old bug - there's an &lt;a href="https://bugs.adobe.com/jira/browse/SDK-751"&gt;ancient entry for a similar issue&lt;/a&gt; in the Flex bugs database.&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;In the absence of a proper fix, here's my resolution. On the creation complete event, invoke the &lt;i&gt;invalidateDisplayList &lt;/i&gt;method inside a &lt;i&gt;callLater&lt;/i&gt;.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;a href="http://flexmonkey.co.uk/datechooserfix/DateChooserFix.html"&gt;Here's the fix in a demo application&lt;/a&gt;. Press the 'toggle visibility' button - the DateChooser on the left is out-of-the box and the one on the right has my fix. The source code is &lt;a href="http://flexmonkey.co.uk/datechooserfix/srcview/index.html"&gt;here&lt;/a&gt;.&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/17393483-1772422147226613922?l=flexmonkey.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://flexmonkey.blogspot.com/feeds/1772422147226613922/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=17393483&amp;postID=1772422147226613922' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/17393483/posts/default/1772422147226613922'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/17393483/posts/default/1772422147226613922'/><link rel='alternate' type='text/html' href='http://flexmonkey.blogspot.com/2010/12/flex-datechooser-september-bug.html' title='Flex DateChooser &apos;September&apos; Bug'/><author><name>Simon Gladman</name><uri>http://www.blogger.com/profile/17449788450837731883</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='28' height='32' src='http://4.bp.blogspot.com/_FGrZThm5JBo/TQ8ZMdgNEUI/AAAAAAAACy4/WGeOchj5VWk/S220/simon_venice.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-17393483.post-1309536652609798140</id><published>2010-12-19T05:31:00.001-08:00</published><updated>2010-12-19T05:52:05.932-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ActionScript'/><category scheme='http://www.blogger.com/atom/ns#' term='poisson distribution'/><category scheme='http://www.blogger.com/atom/ns#' term='circle graph'/><category scheme='http://www.blogger.com/atom/ns#' term='Flex'/><category scheme='http://www.blogger.com/atom/ns#' term='relationship visualisation'/><category scheme='http://www.blogger.com/atom/ns#' term='bezier curves'/><category scheme='http://www.blogger.com/atom/ns#' term='Flex 4 skinning'/><title type='text'>Visualising Relationships with Circle Graphs</title><content type='html'>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://flexmonkey.co.uk/flug_circlegraph/circlegraph_bin/CircleGraphDemo.html"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 397px;" src="http://2.bp.blogspot.com/_FGrZThm5JBo/TQ4J1C1FLOI/AAAAAAAACyw/6R4PeMjfyIY/s400/highlightrelationship.png" border="0" alt="" id="BLOGGER_PHOTO_ID_5552386197491625186" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;I gave a brief talk last week at the London FLUG about visualising relationships between data using a circle graph. &lt;a href="http://flexmonkey.co.uk/flug_circlegraph/circlegraph_bin/CircleGraphDemo.html"&gt;Here's a link to my demo&lt;/a&gt;. Rather than creating a data set, the demo generates its own random data which can be tweaked in the user interface. The class uses the standard Flex component lifecycle methods, so it should be easy to plug a data provider into it to make it useful.&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;The details of how it all works are available in &lt;a href="http://flexmonkey.co.uk/flug_circlegraph/circlegraph.html"&gt;this presentation&lt;/a&gt;. Click anywhere on the screen to move forward through the slides.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Additionally, I created a tiny project that demonstrates how to move the control point of a Bezier curve along a radial line that bisects the start and end points of the related data. That's &lt;a href="http://flexmonkey.co.uk/flug_circlegraph/bezierdemo_bin/BezierControlPointDemo.html"&gt;available here&lt;/a&gt; - moving the horizontal slider moves the control point and redraws the curve.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Finally, I skinned the circle graph demo using my SoftSkin. The SoftSkin project is &lt;a href="http://flexmonkey.co.uk/flug_circlegraph/softskin_bin/Scratch.html"&gt;available here&lt;/a&gt;, but be warned, it's a bloomin' mess at the moment. Lots of copy and pasting, lots of magic numbers and lots of missing components. &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;So, a little Christmas bundle of all sorts. &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Happy holidays,&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;simon&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/17393483-1309536652609798140?l=flexmonkey.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://flexmonkey.blogspot.com/feeds/1309536652609798140/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=17393483&amp;postID=1309536652609798140' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/17393483/posts/default/1309536652609798140'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/17393483/posts/default/1309536652609798140'/><link rel='alternate' type='text/html' href='http://flexmonkey.blogspot.com/2010/12/visualising-relationships-with-circle.html' title='Visualising Relationships with Circle Graphs'/><author><name>Simon Gladman</name><uri>http://www.blogger.com/profile/17449788450837731883</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='28' height='32' src='http://4.bp.blogspot.com/_FGrZThm5JBo/TQ8ZMdgNEUI/AAAAAAAACy4/WGeOchj5VWk/S220/simon_venice.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_FGrZThm5JBo/TQ4J1C1FLOI/AAAAAAAACyw/6R4PeMjfyIY/s72-c/highlightrelationship.png' height='72' width='72'/><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-17393483.post-624637030681915825</id><published>2010-11-28T04:34:00.000-08:00</published><updated>2010-11-28T04:52:14.444-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='genetic algorithm'/><category scheme='http://www.blogger.com/atom/ns#' term='ActionScript'/><category scheme='http://www.blogger.com/atom/ns#' term='Flex'/><category scheme='http://www.blogger.com/atom/ns#' term='countdown'/><title type='text'>Solving Countdown Puzzles with Genetic Algorithms</title><content type='html'>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_FGrZThm5JBo/TPJM0NgcSEI/AAAAAAAACyM/lfka4n5TDdY/s1600/geneticcountdown.png"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 260px;" src="http://1.bp.blogspot.com/_FGrZThm5JBo/TPJM0NgcSEI/AAAAAAAACyM/lfka4n5TDdY/s400/geneticcountdown.png" border="0" alt="" id="BLOGGER_PHOTO_ID_5544578551109142594" /&gt;&lt;/a&gt;I played with &lt;a href="http://flexmonkey.blogspot.com/search/label/genetic%20algorithm"&gt;genetic algorithms&lt;/a&gt; earlier this year. A few evenings ago, the idea of solving the &lt;a href="http://en.wikipedia.org/wiki/Countdown_(game_show)#Numbers_round"&gt;numbers round&lt;/a&gt; in the TV show &lt;a href="http://en.wikipedia.org/wiki/Countdown_(game_show)"&gt;Countdown&lt;/a&gt; with genetic algorithms popped into my head. So, here are the efforts of a frantic Sunday morning coding session.&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;My application doesn't quite conform to the true rules - I create six random source numbers and a single target number. The application then creates a candidate solution by inserting a random operator (add, subtract, multiply or divide) between each number. This candidate solution then spawns a mutated version - the mutation is a 50/50 chance of either randomly changing an operator or randomly exchanging the order of two of the numbers.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Whichever version of the solution is nearer to the target number lives on to the next generation where it spawns a further mutation. This process repeats until the rounded down result of a solution matches the target number.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;The application is small and to get things finished in a short space of time, I've dispensed of any real framework. The main logic is in &lt;i&gt;GeneticCountdownModel&lt;/i&gt;,  but I've put the fitness function in &lt;i&gt;CandidateSolutionPair&lt;/i&gt;. In a similar fashion, &lt;i&gt;CandidateSolutions&lt;/i&gt; are responsible for their own cloning and mutations.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;The application uses my &lt;a href="http://flexmonkey.blogspot.com/2010/10/skinning-soft-shake-style-buttons-in.html"&gt;SoftSkin&lt;/a&gt; - a skin I've been playing with over the last few weeks. I've included the source, but be warned it's a bit of a mess at the moment. It's still work in progress with lots of little hacks and copy-and-pastes and is desperate need of some serious refactoring.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;The application lives &lt;a href="http://flexmonkey.co.uk/geneticcountdown/GeneticCountdown.html"&gt;here&lt;/a&gt; and the source code is available &lt;a href="http://flexmonkey.co.uk/geneticcountdown/srcview/index.html"&gt;here&lt;/a&gt;.&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/17393483-624637030681915825?l=flexmonkey.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://flexmonkey.blogspot.com/feeds/624637030681915825/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=17393483&amp;postID=624637030681915825' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/17393483/posts/default/624637030681915825'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/17393483/posts/default/624637030681915825'/><link rel='alternate' type='text/html' href='http://flexmonkey.blogspot.com/2010/11/solving-countdown-puzzles-with-genetic.html' title='Solving Countdown Puzzles with Genetic Algorithms'/><author><name>Simon Gladman</name><uri>http://www.blogger.com/profile/17449788450837731883</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='28' height='32' src='http://4.bp.blogspot.com/_FGrZThm5JBo/TQ8ZMdgNEUI/AAAAAAAACy4/WGeOchj5VWk/S220/simon_venice.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_FGrZThm5JBo/TPJM0NgcSEI/AAAAAAAACyM/lfka4n5TDdY/s72-c/geneticcountdown.png' height='72' width='72'/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-17393483.post-1305515995061549314</id><published>2010-10-26T11:34:00.000-07:00</published><updated>2010-10-26T11:49:00.207-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ActionScript'/><category scheme='http://www.blogger.com/atom/ns#' term='animateColor'/><category scheme='http://www.blogger.com/atom/ns#' term='state transitions'/><category scheme='http://www.blogger.com/atom/ns#' term='3d Button'/><category scheme='http://www.blogger.com/atom/ns#' term='Flex 4 skinning'/><title type='text'>Skinning soft "Shake" style buttons in Flex 4</title><content type='html'>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://flexmonkey.co.uk/softbutton-release/Scratch.html"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 169px; height: 180px;" src="http://4.bp.blogspot.com/_FGrZThm5JBo/TMcfkR59p1I/AAAAAAAACuM/6s4U8HQ4lb8/s400/softbutton.png" border="0" alt="" id="BLOGGER_PHOTO_ID_5532425375390213970" /&gt;&lt;/a&gt;Many years ago, I used a video compositing application called &lt;i&gt;&lt;a href="http://en.wikipedia.org/wiki/Shake_(software)"&gt;Shake&lt;/a&gt;&lt;/i&gt;. One of my memories of the application was its beautifully soft, almost organic, widget set.  I thought I'd have a play with Flex skinning to replicate the look.&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;To create a nice 3D border programmatically, I use Spark &lt;i&gt;Paths&lt;/i&gt; to draw four trapezoids which mimic the shape of the mitred parts of a picture frame and act as borders. The top and left borders graduate in colour from the background through near-white to the button face colour. The bottom and right borders also graduate from the background through to the face but through near-black.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;A blur to the borders  smooths out the colour difference at the corners and gives a nice 3D impression.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;When the button is depressed, I swap out the middle gradient colours on the borders to change the effect from an outset button to an inset one. I use an &lt;i&gt;AnimateColor&lt;/i&gt; to soften the transition.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;The application is available &lt;a href="http://flexmonkey.co.uk/softbutton-release/Scratch.html"&gt;here&lt;/a&gt; and the source code &lt;a href="http://flexmonkey.co.uk/softbutton-release/srcview/index.html"&gt;here&lt;/a&gt;.&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/17393483-1305515995061549314?l=flexmonkey.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://flexmonkey.blogspot.com/feeds/1305515995061549314/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=17393483&amp;postID=1305515995061549314' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/17393483/posts/default/1305515995061549314'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/17393483/posts/default/1305515995061549314'/><link rel='alternate' type='text/html' href='http://flexmonkey.blogspot.com/2010/10/skinning-soft-shake-style-buttons-in.html' title='Skinning soft &quot;Shake&quot; style buttons in Flex 4'/><author><name>Simon Gladman</name><uri>http://www.blogger.com/profile/17449788450837731883</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='28' height='32' src='http://4.bp.blogspot.com/_FGrZThm5JBo/TQ8ZMdgNEUI/AAAAAAAACy4/WGeOchj5VWk/S220/simon_venice.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_FGrZThm5JBo/TMcfkR59p1I/AAAAAAAACuM/6s4U8HQ4lb8/s72-c/softbutton.png' height='72' width='72'/><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-17393483.post-4210459387636906991</id><published>2010-10-12T11:02:00.000-07:00</published><updated>2010-10-12T11:11:12.986-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ActionScript'/><category scheme='http://www.blogger.com/atom/ns#' term='parsley'/><category scheme='http://www.blogger.com/atom/ns#' term='Keyframe'/><category scheme='http://www.blogger.com/atom/ns#' term='Flex'/><category scheme='http://www.blogger.com/atom/ns#' term='AnimateTransform'/><category scheme='http://www.blogger.com/atom/ns#' term='MotionPath'/><title type='text'>Flex/Parsley Keyframe Editor</title><content type='html'>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://flexmonkey.co.uk/animationmonkey/AnimationMonkey.html"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 157px;" src="http://4.bp.blogspot.com/_FGrZThm5JBo/TLSi4RDEdvI/AAAAAAAACuA/e7EZwnoC2Fo/s400/animationmonkey.png" border="0" alt="" id="BLOGGER_PHOTO_ID_5527221730223093490" /&gt;&lt;/a&gt;  &lt;p class="p1"&gt;This is a project I've been playing with on and off recently - a keyframe editor for animating arbitrary objects. I thought I'd post it in its current embryonic state to show how &lt;i&gt;MotionPaths&lt;/i&gt; and &lt;i&gt;KeyFrames&lt;/i&gt; can be dynamically edited and applied to interface elements.&lt;/p&gt; &lt;p class="p1"&gt;Embryonic is the key phrase here - the animation 'engine' is done, but the user interface is far from complete (or even attractive). The current UI allows the user to play and stop the animation, select an object from the left hand list and select a particular animated property and then add or edit keyframes.&lt;/p&gt; &lt;p class="p1"&gt;The initial animation data is hard coded in the &lt;i&gt;AnimationData&lt;/i&gt; class. This includes a &lt;i&gt;Parallel&lt;/i&gt; that contains individual &lt;i&gt;AnimationTransforms&lt;/i&gt; for each &lt;i&gt;MotionPath&lt;/i&gt; for each animated property. The &lt;i&gt;Group&lt;/i&gt; class contains the individual items (in this case &lt;i&gt;Rects&lt;/i&gt;) that those &lt;i&gt;MotionPaths&lt;/i&gt; will affect.&lt;/p&gt; &lt;p class="p1"&gt;I'm using the presentation model pattern, so most of the good stuff happens in &lt;i&gt;AnimationMonkeyPresentationModel&lt;/i&gt;. I'm also using Parsley to inject the model and animation data into the view classes and handle messaging. &lt;/p&gt; &lt;p class="p1"&gt;A few pointers on playing with the &lt;i&gt;Keyframes&lt;/i&gt; of a &lt;i&gt;MotionPath&lt;/i&gt;: &lt;i&gt;scaleKeyFrames()&lt;/i&gt; needs to be invoked on the &lt;i&gt;MotionPath&lt;/i&gt; otherwise &lt;i&gt;getValue()&lt;/i&gt; will fail and &lt;i&gt;Keyframes&lt;/i&gt; need to be in time order. My presentation model contains a &lt;i&gt;sortKeyframes()&lt;/i&gt; method to keep them in check.&lt;/p&gt; &lt;p class="p1"&gt;The &lt;i&gt;GraphEditor&lt;/i&gt; allows users to view the motion graph of any animated property. It uses&lt;i&gt; getValue()&lt;/i&gt; to draw the graphs (hence the caveat above) and to check if the mouse is near a point on the graph to offer the user the opportunity to add a new keyframe. Clicking a keyframe node pops up a little editor where the user can change values and change the type of keyframe.&lt;/p&gt;&lt;p class="p1"&gt;The application is available &lt;a href="http://flexmonkey.co.uk/animationmonkey/AnimationMonkey.html"&gt;here&lt;/a&gt; and the source code &lt;a href="http://flexmonkey.co.uk/animationmonkey/srcview/index.html"&gt;here&lt;/a&gt;.&lt;/p&gt; &lt;p class="p2"&gt;&lt;br /&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/17393483-4210459387636906991?l=flexmonkey.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://flexmonkey.blogspot.com/feeds/4210459387636906991/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=17393483&amp;postID=4210459387636906991' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/17393483/posts/default/4210459387636906991'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/17393483/posts/default/4210459387636906991'/><link rel='alternate' type='text/html' href='http://flexmonkey.blogspot.com/2010/10/flexparsley-keyframe-editor.html' title='Flex/Parsley Keyframe Editor'/><author><name>Simon Gladman</name><uri>http://www.blogger.com/profile/17449788450837731883</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='28' height='32' src='http://4.bp.blogspot.com/_FGrZThm5JBo/TQ8ZMdgNEUI/AAAAAAAACy4/WGeOchj5VWk/S220/simon_venice.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_FGrZThm5JBo/TLSi4RDEdvI/AAAAAAAACuA/e7EZwnoC2Fo/s72-c/animationmonkey.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-17393483.post-2148852538688112238</id><published>2010-07-01T10:14:00.000-07:00</published><updated>2010-07-01T12:44:12.902-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ActionScript'/><category scheme='http://www.blogger.com/atom/ns#' term='node based interface'/><category scheme='http://www.blogger.com/atom/ns#' term='parsley'/><category scheme='http://www.blogger.com/atom/ns#' term='presentation model'/><category scheme='http://www.blogger.com/atom/ns#' term='Flex'/><title type='text'>Decoupling the Presentation Layer &amp; the Joy of Interfaces</title><content type='html'>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://www.flexmonkey.co.uk/ParsleyPresentationModelDemo_4/ParsleyPresentationModel.html"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 380px; height: 400px;" src="http://4.bp.blogspot.com/_FGrZThm5JBo/TCzNRn9fcBI/AAAAAAAACIc/p6A4J62MgI0/s400/calculator.png" border="0" alt="" id="BLOGGER_PHOTO_ID_5488987748526157842" /&gt;&lt;/a&gt;I've been playing more with my Parsley Node Based User Interface. My main goal over the last few days has been to completely decouple the presentation code from the data it's displaying and my first proof-of-concept is a simple calculator application.&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;The initial versions of the code used an array collection of instances of &lt;i&gt;Nodes&lt;/i&gt; - this is fine if I'm only ever going to display one type of data, but to make the code a lot more flexible and scalable, I now pass it an array collection of objects that conform to my &lt;i&gt;&lt;a href="http://www.flexmonkey.co.uk/ParsleyPresentationModelDemo_4/srcview/source/presentation/interfaces/INode.as.html"&gt;INode&lt;/a&gt;&lt;/i&gt; interface. The interface contains all the methods that the node based interface requires to render.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;So, I've created a new class that sits outside the presentation package called &lt;i&gt;CalculatorNode&lt;/i&gt; which implements &lt;i&gt;INode&lt;/i&gt;.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;To further decouple the interface from the data, I inject the node renderer and the detail form into the UI. These two classes implement my &lt;a href="http://www.flexmonkey.co.uk/ParsleyPresentationModelDemo_4/srcview/source/presentation/interfaces/INodeRenderer.as.html"&gt;&lt;i&gt;INodeRenderer&lt;/i&gt;&lt;/a&gt; interface and are defined in the &lt;a href="http://www.flexmonkey.co.uk/ParsleyPresentationModelDemo_4/srcview/source/domain/DomainModel.as.html"&gt;&lt;i&gt;DomainModel&lt;/i&gt;&lt;/a&gt; class (a small caveat - in this proof of concept release, I've still got the node widget's height and width hard coded).&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;A double check through the source code and there are no references to any of the calculator classes in the presentation package! All the logic for calculating the output is handled in the &lt;i&gt;CalculatorNode&lt;/i&gt; value object which is a style of domain driven development I quite like. However, to conform to a more MVC style, this logic should really live in a command.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;The &lt;a href="http://www.flexmonkey.co.uk/ParsleyPresentationModelDemo_4/ParsleyPresentationModel.html"&gt;application lives here&lt;/a&gt; and the &lt;a href="http://www.flexmonkey.co.uk/ParsleyPresentationModelDemo_4/srcview/index.html"&gt;full source is available here&lt;/a&gt;. You can add and delete nodes, change them from fixed numbers to operators. The user interaction for creating relationships needs to be changed to allow dragging between nodes, but the checkboxes work OK. If a relationship is unused it's renderered in grey (for example if you pass more that one number to the square root function, only the first number is considered).&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Of course, a calculator is only the beginning. I've been thinking about a CAD type application for this code where each node represents a shape and those shapes can be overlaid with different blend modes.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Finally, I couldn't get &lt;i&gt;SharedObject&lt;/i&gt; to play nicely, so that code is commented out. Any changes you do will be lost with each new session.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;i&gt;Oops in my haste to get this blog out, a managed to release a little bug when adding a new node. This is now fixed!&lt;/i&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/17393483-2148852538688112238?l=flexmonkey.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://flexmonkey.blogspot.com/feeds/2148852538688112238/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=17393483&amp;postID=2148852538688112238' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/17393483/posts/default/2148852538688112238'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/17393483/posts/default/2148852538688112238'/><link rel='alternate' type='text/html' href='http://flexmonkey.blogspot.com/2010/07/decoupling-presentation-layer-joy-of.html' title='Decoupling the Presentation Layer &amp; the Joy of Interfaces'/><author><name>Simon Gladman</name><uri>http://www.blogger.com/profile/17449788450837731883</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='28' height='32' src='http://4.bp.blogspot.com/_FGrZThm5JBo/TQ8ZMdgNEUI/AAAAAAAACy4/WGeOchj5VWk/S220/simon_venice.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_FGrZThm5JBo/TCzNRn9fcBI/AAAAAAAACIc/p6A4J62MgI0/s72-c/calculator.png' height='72' width='72'/><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-17393483.post-6940106129122094472</id><published>2010-06-25T13:31:00.000-07:00</published><updated>2010-06-25T14:02:30.267-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='datechooser'/><category scheme='http://www.blogger.com/atom/ns#' term='CalendarLayout'/><category scheme='http://www.blogger.com/atom/ns#' term='ActionScript'/><category scheme='http://www.blogger.com/atom/ns#' term='Flex'/><title type='text'>Displaying Color Coded Events in the Flex DateChooser</title><content type='html'>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://flexmonkey.co.uk/ColorfulDateChooser/Calendar.html"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 276px;" src="http://3.bp.blogspot.com/_FGrZThm5JBo/TCUSF_tYdSI/AAAAAAAACIU/WQ_XAZTbCEc/s400/calendar.png" border="0" alt="" id="BLOGGER_PHOTO_ID_5486811615231243554" /&gt;&lt;/a&gt;Although the Flex &lt;i&gt;DateChooser&lt;/i&gt; class does a great job of allowing the user to select dates, it doesn't support highlighting arbitrary dates. If you want to inform your user of events, you need to extend the component.&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;a href="http://www.cyberslingers.com/weblog/post/Adding-Calendar-Event-Entries-to-the-Flex-DateChooser-Component.aspx"&gt;Kevin Brammer did a great job some time ago to fix this&lt;/a&gt;, however - and with the greatest of respect - I thought I could improve upon his code and use the Flex component lifecycle framework to bind his &lt;i&gt;ExtendedDateChooser&lt;/i&gt; to an array collection of events.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;So, &lt;a href="http://flexmonkey.co.uk/ColorfulDateChooser/Calendar.html"&gt;here's my version&lt;/a&gt;. The &lt;i&gt;dateCollection&lt;/i&gt; is a collection of objects that  have the properties &lt;i&gt;color&lt;/i&gt;, &lt;i&gt;date&lt;/i&gt; and &lt;i&gt;narrative &lt;/i&gt;(although if your objects don't use those property names, you can change the &lt;i&gt;colorField&lt;/i&gt;, &lt;i&gt;dateField&lt;/i&gt; and &lt;i&gt;narrativeField&lt;/i&gt; of the component).&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;When either the collection changes or &lt;i&gt;invalidateDisplayList()&lt;/i&gt; is invoked, the &lt;i&gt;addEvents()&lt;/i&gt; method loops over the collection and sets the background and foreground colors of the individual &lt;i&gt;UITextFields&lt;/i&gt; that make up the &lt;i&gt;CalendarLayout&lt;/i&gt;. I also check the luminosity of the background color and set the foreground to ensure it's readable.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;The data grid on the right displays the contents of the events collection and in this demo you can add and remove events.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;The &lt;a href="http://flexmonkey.co.uk/ColorfulDateChooser/srcview/source/widgets/ExtendedDateChooser.as.html"&gt;real meat lives here&lt;/a&gt; and the rest of &lt;a href="http://flexmonkey.co.uk/ColorfulDateChooser/srcview/index.html"&gt;the source code is here&lt;/a&gt;.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;i&gt;One little post script - the renderer only displays one event per date. Multiple events per date are for version 2 :)&lt;/i&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/17393483-6940106129122094472?l=flexmonkey.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://flexmonkey.blogspot.com/feeds/6940106129122094472/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=17393483&amp;postID=6940106129122094472' title='6 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/17393483/posts/default/6940106129122094472'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/17393483/posts/default/6940106129122094472'/><link rel='alternate' type='text/html' href='http://flexmonkey.blogspot.com/2010/06/displaying-color-coded-events-in-flex.html' title='Displaying Color Coded Events in the Flex DateChooser'/><author><name>Simon Gladman</name><uri>http://www.blogger.com/profile/17449788450837731883</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='28' height='32' src='http://4.bp.blogspot.com/_FGrZThm5JBo/TQ8ZMdgNEUI/AAAAAAAACy4/WGeOchj5VWk/S220/simon_venice.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_FGrZThm5JBo/TCUSF_tYdSI/AAAAAAAACIU/WQ_XAZTbCEc/s72-c/calendar.png' height='72' width='72'/><thr:total>6</thr:total></entry><entry><id>tag:blogger.com,1999:blog-17393483.post-7012391096258734473</id><published>2010-06-24T01:37:00.000-07:00</published><updated>2010-06-25T01:07:29.393-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ObjectUtil.copy'/><category scheme='http://www.blogger.com/atom/ns#' term='registerClassAlias'/><category scheme='http://www.blogger.com/atom/ns#' term='node based interface'/><category scheme='http://www.blogger.com/atom/ns#' term='parsley'/><category scheme='http://www.blogger.com/atom/ns#' term='domainModel'/><category scheme='http://www.blogger.com/atom/ns#' term='Flex'/><category scheme='http://www.blogger.com/atom/ns#' term='DynamicCommand'/><title type='text'>Parsley Node Based Interface Evolved - Dynamic Commands &amp; Domain Model</title><content type='html'>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://www.flexmonkey.co.uk/ParsleyPresentationModelDemo_2/ParsleyPresentationModel.html"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 238px;" src="http://1.bp.blogspot.com/_FGrZThm5JBo/TCMZpsv1YqI/AAAAAAAACIM/rTjvnlgNN3k/s400/parsley_demo.png" border="0" alt="" id="BLOGGER_PHOTO_ID_5486256975244518050" /&gt;&lt;/a&gt;My adventures with Parsley continue! Over the last few evenings, I've extended my &lt;a href="http://flexmonkey.blogspot.com/2010/06/first-dive-into-parsley-and.html"&gt;previous experiment&lt;/a&gt;:&lt;div&gt;&lt;ul&gt;&lt;li&gt;&lt;i&gt;Pseudo drag-and-drop &lt;/i&gt;- the nodes can now be repositioned with a drag. This code doesn't the Flex &lt;i&gt;DragManager&lt;/i&gt;, rather it invokes &lt;i&gt;moveSelectedNode()&lt;/i&gt; on the presentation model and then the views with a message handler for &lt;i&gt;SelectedMoveMessage&lt;/i&gt; update themselves. &lt;/li&gt;&lt;li&gt;&lt;i&gt;DynamicCommands - &lt;/i&gt;I've implemented two commands to save and retrieve networks from a SharedObject. When the user clicks either 'get network' or 'save network', these commands are invoked via the &lt;i&gt;Configuration&lt;/i&gt; IoC class. This class acts a little like the &lt;i&gt;FrontController&lt;/i&gt; in Cairngorm or the EventMap in Mate and mediates between messages and commands.&lt;/li&gt;&lt;li&gt;&lt;i&gt;DomainModel&lt;/i&gt; - I've added a list on the left of the screen to preview what's in the domain model. You can see that until the 'save network' button is pressed, the domain model remains the same.&lt;/li&gt;&lt;/ul&gt;&lt;div&gt;Flex passes complex objects round by reference. This means that if I inject the domain model into the presentation model and start changing the presentation model, those changes are immediately applied to the domain model. To stop this, I use the &lt;i&gt;ObjectUtil.copy()&lt;/i&gt; method in conjunction with &lt;i&gt;registerClassAlias&lt;/i&gt;. These give me a strongly typed clone of my model.&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Relationships between nodes are managed by ticking and unticking the checkboxes in the inputs list in the detail view.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;The application is still abstract, the next step is to allow node renderers to be injected into the presentation code so that the same node based interface code can be used to manage different types of data from a &lt;a href="http://flexmonkey.blogspot.com/2008/10/weekend-tinkering-with-flex-node-based.html"&gt;simple calculator&lt;/a&gt; to an &lt;a href="http://flexmonkey.blogspot.com/2008/12/pixel-bender-blender-now-supports-array.html"&gt;image composition tool&lt;/a&gt;.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;The application lives &lt;a href="http://www.flexmonkey.co.uk/ParsleyPresentationModelDemo_2/ParsleyPresentationModel.html"&gt;here&lt;/a&gt; and the source code is available &lt;a href="http://www.flexmonkey.co.uk/ParsleyPresentationModelDemo_2/srcview/index.html"&gt;here&lt;/a&gt;.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;i&gt;Please note - on my Mac, this works beautifully under Chrome and Firefox using Flash Player 10.1. On a PC, the SharedObject code seems to sometimes crash Flash Player - especially under IE, but Chrome and Firefox are a little more stable.&lt;/i&gt;&lt;/b&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/17393483-7012391096258734473?l=flexmonkey.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://flexmonkey.blogspot.com/feeds/7012391096258734473/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=17393483&amp;postID=7012391096258734473' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/17393483/posts/default/7012391096258734473'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/17393483/posts/default/7012391096258734473'/><link rel='alternate' type='text/html' href='http://flexmonkey.blogspot.com/2010/06/parsley-node-based-interface-evolved.html' title='Parsley Node Based Interface Evolved - Dynamic Commands &amp; Domain Model'/><author><name>Simon Gladman</name><uri>http://www.blogger.com/profile/17449788450837731883</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='28' height='32' src='http://4.bp.blogspot.com/_FGrZThm5JBo/TQ8ZMdgNEUI/AAAAAAAACy4/WGeOchj5VWk/S220/simon_venice.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_FGrZThm5JBo/TCMZpsv1YqI/AAAAAAAACIM/rTjvnlgNN3k/s72-c/parsley_demo.png' height='72' width='72'/><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-17393483.post-4495117160467552151</id><published>2010-06-15T12:07:00.001-07:00</published><updated>2010-06-15T12:32:38.864-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='frameworks'/><category scheme='http://www.blogger.com/atom/ns#' term='node based interface'/><category scheme='http://www.blogger.com/atom/ns#' term='parsley'/><category scheme='http://www.blogger.com/atom/ns#' term='presentation model'/><category scheme='http://www.blogger.com/atom/ns#' term='Flex'/><title type='text'>First Dive into Parsley and the Presentation Model</title><content type='html'>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://www.flexmonkey.co.uk/ParsleyPresentationModelDemo/ParsleyPresentationModel.html"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 229px;" src="http://1.bp.blogspot.com/_FGrZThm5JBo/TBfPkd1qlbI/AAAAAAAACIE/4PZnCpQm9RI/s400/parsely.png" border="0" alt="" id="BLOGGER_PHOTO_ID_5483079296738825650" /&gt;&lt;/a&gt;I've spent the last few evenings playing with the &lt;a href="http://www.spicefactory.org/"&gt;Parsley Framework&lt;/a&gt; and using a presentation model. There's a &lt;a href="http://opensource.adobe.com/wiki/display/cairngorm/SimpleSampleApplicationExplained"&gt;great article here&lt;/a&gt; that helped me out a lot and the &lt;a href="http://www.spicefactory.org/parsley/docs/2.2/manual/"&gt;Spice Factory documentation&lt;/a&gt; is very good too.&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Since I have a longstanding love of network interfaces, I thought I'd create a simple network UI. Here's a quick run though of the main areas of interest:&lt;/div&gt;&lt;div&gt;&lt;ul&gt;&lt;li&gt;The main application file is quite sparse. All it contains is a reference to my Parsley configuration file and two view classes.&lt;/li&gt;&lt;li&gt;The configuration file - &lt;i&gt;config.Configuration&lt;/i&gt; - contains a reference to my presentation model.&lt;/li&gt;&lt;li&gt;The &lt;i&gt;presentation&lt;/i&gt; package contains the real meat. This is my first experience of using the presentation model pattern and IMHO, it's a great way of working. The model is injected into both the network and detail views. The model has no knowledge of the views, but the views - being injected with a typed model - can invoke methods on the model. For example, the network view invokes &lt;i&gt;setSelectedNode() &lt;/i&gt;and the detail view invokes &lt;i&gt;updateSelectedNode()&lt;/i&gt;.&lt;/li&gt;&lt;li&gt;The two main view classes, &lt;i&gt;NetworkRenderer&lt;/i&gt; and &lt;i&gt;NodeDetail&lt;/i&gt; use the IOC pattern to accept the presentation model. The former contains a Parsley &lt;i&gt;MessageHandler&lt;/i&gt; to render the nodes and relationships when the nodes collection changes. The form elements in the detail view are simply bound to various properties of the selected node.&lt;/li&gt;&lt;/ul&gt;&lt;div&gt;This is just a demo - there is lots not implemented. You can't, for example, create relationships or add new nodes. I'll carry on fleshing this demo out and add those functions over the next few days. However, the detail view does allow you to change the selected node's label and position.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;One minor point - after rendering relationships in previous applications with convoluted &lt;i&gt;curveTo()&lt;/i&gt; methods, it occurred to me that an easing function would do the job far better. If you look into the guts of &lt;i&gt;NetworkRenderer&lt;/i&gt;, you'll see I use the &lt;i&gt;Power&lt;/i&gt; class to draw the curved lines.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Have a delve into the &lt;a href="http://www.flexmonkey.co.uk/ParsleyPresentationModelDemo/srcview/index.html"&gt;source code&lt;/a&gt;, although it's sparsly commented, I think it's quite easy to follow. &lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;The application is &lt;a href="http://www.flexmonkey.co.uk/ParsleyPresentationModelDemo/ParsleyPresentationModel.html"&gt;available here&lt;/a&gt; and it's source code enabled.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Enjoy!&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/17393483-4495117160467552151?l=flexmonkey.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://flexmonkey.blogspot.com/feeds/4495117160467552151/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=17393483&amp;postID=4495117160467552151' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/17393483/posts/default/4495117160467552151'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/17393483/posts/default/4495117160467552151'/><link rel='alternate' type='text/html' href='http://flexmonkey.blogspot.com/2010/06/first-dive-into-parsley-and.html' title='First Dive into Parsley and the Presentation Model'/><author><name>Simon Gladman</name><uri>http://www.blogger.com/profile/17449788450837731883</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='28' height='32' src='http://4.bp.blogspot.com/_FGrZThm5JBo/TQ8ZMdgNEUI/AAAAAAAACy4/WGeOchj5VWk/S220/simon_venice.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_FGrZThm5JBo/TBfPkd1qlbI/AAAAAAAACIE/4PZnCpQm9RI/s72-c/parsely.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-17393483.post-1704917563382905923</id><published>2010-06-12T06:05:00.001-07:00</published><updated>2010-06-12T06:15:31.929-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='TreeItemRenderer'/><category scheme='http://www.blogger.com/atom/ns#' term='centered'/><category scheme='http://www.blogger.com/atom/ns#' term='itemRenderer'/><category scheme='http://www.blogger.com/atom/ns#' term='Flex'/><category scheme='http://www.blogger.com/atom/ns#' term='tree'/><category scheme='http://www.blogger.com/atom/ns#' term='justified'/><title type='text'>Aligning the Label in a Tree Control</title><content type='html'>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_FGrZThm5JBo/TBOGK2MQ0sI/AAAAAAAACH8/vwb4rt9ZbYg/s1600/treerender.png"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 280px;" src="http://1.bp.blogspot.com/_FGrZThm5JBo/TBOGK2MQ0sI/AAAAAAAACH8/vwb4rt9ZbYg/s400/treerender.png" border="0" alt="" id="BLOGGER_PHOTO_ID_5481872692343788226" /&gt;&lt;/a&gt;If you've ever rendered images in a tree control, you may have noticed both the image and the label are effectively top, left justified. There's no CSS solution to changing this, the answer is to extend Flex's &lt;i&gt;TreeItemRenderer&lt;/i&gt; and move the renderer's label in ActionScript.&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;a href="http://flexmonkey.co.uk/CenteredTreeControlDemoRelease/CenteredTreeControlDemo.html"&gt;Here's my version&lt;/a&gt;. Inside &lt;i&gt;updateDisplayList()&lt;/i&gt; are a few lines of ActionScript that reposition label to make right justified and vertically centered. The SWF is source code enabled and that source is available &lt;a href="http://flexmonkey.co.uk/CenteredTreeControlDemoRelease/srcview/index.html"&gt;here&lt;/a&gt;.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;simon&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/17393483-1704917563382905923?l=flexmonkey.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://flexmonkey.blogspot.com/feeds/1704917563382905923/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=17393483&amp;postID=1704917563382905923' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/17393483/posts/default/1704917563382905923'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/17393483/posts/default/1704917563382905923'/><link rel='alternate' type='text/html' href='http://flexmonkey.blogspot.com/2010/06/aligning-label-in-tree-control.html' title='Aligning the Label in a Tree Control'/><author><name>Simon Gladman</name><uri>http://www.blogger.com/profile/17449788450837731883</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='28' height='32' src='http://4.bp.blogspot.com/_FGrZThm5JBo/TQ8ZMdgNEUI/AAAAAAAACy4/WGeOchj5VWk/S220/simon_venice.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_FGrZThm5JBo/TBOGK2MQ0sI/AAAAAAAACH8/vwb4rt9ZbYg/s72-c/treerender.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-17393483.post-7888388481349903560</id><published>2010-05-26T10:40:00.000-07:00</published><updated>2010-05-26T10:48:53.533-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ActionScript'/><category scheme='http://www.blogger.com/atom/ns#' term='alignment'/><category scheme='http://www.blogger.com/atom/ns#' term='Flex'/><category scheme='http://www.blogger.com/atom/ns#' term='HorizontalList'/><title type='text'>Centre Aligned HorizontalList in Flex</title><content type='html'>A short while ago, I was bemoaning the fact that the Flex &lt;i&gt;HorizontalList&lt;/i&gt; control only ever left aligned its items. Over the weekend, I thought about this again and realised that by overriding the &lt;i&gt;measure()&lt;/i&gt; method, I could set the width of the horizontal list based on its contents and allow its container to center it.&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;a href="http://flexmonkey.co.uk/alignedHorizontalList-bin-release/AlignedHorizontalListDemo.html"&gt;Here's a demo of my &lt;/a&gt;&lt;i&gt;&lt;a href="http://flexmonkey.co.uk/alignedHorizontalList-bin-release/AlignedHorizontalListDemo.html"&gt;AlignedHorizontalLost&lt;/a&gt;&lt;/i&gt;&lt;a href="http://flexmonkey.co.uk/alignedHorizontalList-bin-release/AlignedHorizontalListDemo.html"&gt; control&lt;/a&gt;. It only contains two overridden methods - &lt;i&gt;updateDisplayList()&lt;/i&gt; explicitly invokes &lt;i&gt;measure()&lt;/i&gt; and the overridden &lt;i&gt;measure() &lt;/i&gt;resizes the control using the &lt;i&gt;measureWidthOfItems() &lt;/i&gt;function.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;If you open the demo, you can add and remove items. The top list is the regular left aligned HorizontalList and the bottom is my extended version.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;a href="http://flexmonkey.co.uk/alignedHorizontalList-bin-release/srcview/index.html"&gt;The complete source is available here&lt;/a&gt;.&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/17393483-7888388481349903560?l=flexmonkey.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://flexmonkey.blogspot.com/feeds/7888388481349903560/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=17393483&amp;postID=7888388481349903560' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/17393483/posts/default/7888388481349903560'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/17393483/posts/default/7888388481349903560'/><link rel='alternate' type='text/html' href='http://flexmonkey.blogspot.com/2010/05/centre-aligned-horizontallist-in-flex.html' title='Centre Aligned HorizontalList in Flex'/><author><name>Simon Gladman</name><uri>http://www.blogger.com/profile/17449788450837731883</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='28' height='32' src='http://4.bp.blogspot.com/_FGrZThm5JBo/TQ8ZMdgNEUI/AAAAAAAACy4/WGeOchj5VWk/S220/simon_venice.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-17393483.post-6062117169214348435</id><published>2010-04-12T11:13:00.000-07:00</published><updated>2010-04-12T11:18:47.904-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Thailand'/><category scheme='http://www.blogger.com/atom/ns#' term='Bangkok'/><title type='text'>A week without Flex....</title><content type='html'>....can it be done? Spending a whole week without writing a single line of code?&lt;br /&gt;&lt;br /&gt;&lt;div&gt;Well, I managed it with a frantic week whizzing round Bangkok and taking more pictures than you can shake a stick at. If you have some spare time, &lt;a href="http://www.flickr.com/photos/49293850@N08/"&gt;here are the fruits of my photographic labour&lt;/a&gt;.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Now I'm back at a computer, my thoughts naturally turn to Flex, physics and some experiments playing with &lt;a href="http://www.psyked.co.uk/category/box2d"&gt;Box2D&lt;/a&gt;.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;simon&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/17393483-6062117169214348435?l=flexmonkey.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://flexmonkey.blogspot.com/feeds/6062117169214348435/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=17393483&amp;postID=6062117169214348435' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/17393483/posts/default/6062117169214348435'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/17393483/posts/default/6062117169214348435'/><link rel='alternate' type='text/html' href='http://flexmonkey.blogspot.com/2010/04/week-without-flex.html' title='A week without Flex....'/><author><name>Simon Gladman</name><uri>http://www.blogger.com/profile/17449788450837731883</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='28' height='32' src='http://4.bp.blogspot.com/_FGrZThm5JBo/TQ8ZMdgNEUI/AAAAAAAACy4/WGeOchj5VWk/S220/simon_venice.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-17393483.post-6326081289065269038</id><published>2010-04-02T10:20:00.001-07:00</published><updated>2010-04-02T10:34:12.499-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='particles'/><category scheme='http://www.blogger.com/atom/ns#' term='getColorBoundsRect'/><category scheme='http://www.blogger.com/atom/ns#' term='motion control'/><category scheme='http://www.blogger.com/atom/ns#' term='Flex'/><category scheme='http://www.blogger.com/atom/ns#' term='flint'/><title type='text'>Motion Controlled Painting with Flint Particles</title><content type='html'>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_FGrZThm5JBo/S7YnaM-P7TI/AAAAAAAACDw/AkMHpbSfBNg/s1600/bodypaint.jpg"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 225px;" src="http://4.bp.blogspot.com/_FGrZThm5JBo/S7YnaM-P7TI/AAAAAAAACDw/AkMHpbSfBNg/s400/bodypaint.jpg" border="0" alt="" id="BLOGGER_PHOTO_ID_5455591329718332722" /&gt;&lt;/a&gt;A while ago, I visited the Decode exhibition at the Victoria &amp;amp; Albert museum. One piece I realled liked was &lt;a href="http://www.vam.ac.uk/microsites/decode/exhibition/interactivity/artist/5"&gt;Body Paint&lt;/a&gt; by Mehmet Akten. Over the last few days, I've been playing with an homage using Flint Particles and some simple motion control using the Flex Camera object.&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;a href="http://flexmonkey.co.uk/motion_body_paint_poc/MotionBodyPaint.html"&gt;You can see my proof of concept work here&lt;/a&gt;. On my MacBook, I had to explicitly set the camera in the Flex options dialog to the USB camera, but PC's seem to work fine with the default settings.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;The source code is available and pretty much all the 'meat' of the application is in &lt;i&gt;MotionBodyPaint.mxml&lt;/i&gt;.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;In a nutshell, I use the Flex Difference blend mode between consecutive frames to create a greyscale image that controls the emission of particles. &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;The &lt;i&gt;getColorBoundsRect() &lt;/i&gt;function creates me a rectangle of the white areas of the frame after applying the &lt;i&gt;threshold()&lt;/i&gt; method. By comparing consecutive rectangles, I create a direction for the initial particle velocity so the particle direction roughly mimics the overall direction of movement.&lt;br /&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;If you're using the debugger version of Flash Player, there are a few little bugs that crop up which I think is related to an empty greyscale image getting passed into the Flint engine. However, if you use the regular version, it works fine.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Although far from finished, this proof of concept works quite well - enjoy it as an Easter treat :)&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;simon&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/17393483-6326081289065269038?l=flexmonkey.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://flexmonkey.blogspot.com/feeds/6326081289065269038/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=17393483&amp;postID=6326081289065269038' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/17393483/posts/default/6326081289065269038'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/17393483/posts/default/6326081289065269038'/><link rel='alternate' type='text/html' href='http://flexmonkey.blogspot.com/2010/04/motion-controlled-painting-with-flint.html' title='Motion Controlled Painting with Flint Particles'/><author><name>Simon Gladman</name><uri>http://www.blogger.com/profile/17449788450837731883</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='28' height='32' src='http://4.bp.blogspot.com/_FGrZThm5JBo/TQ8ZMdgNEUI/AAAAAAAACy4/WGeOchj5VWk/S220/simon_venice.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_FGrZThm5JBo/S7YnaM-P7TI/AAAAAAAACDw/AkMHpbSfBNg/s72-c/bodypaint.jpg' height='72' width='72'/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-17393483.post-9002576302680339607</id><published>2010-03-10T13:43:00.000-08:00</published><updated>2010-03-10T14:58:21.857-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='particles'/><category scheme='http://www.blogger.com/atom/ns#' term='ActionScript'/><category scheme='http://www.blogger.com/atom/ns#' term='particlelab'/><category scheme='http://www.blogger.com/atom/ns#' term='node based interface'/><category scheme='http://www.blogger.com/atom/ns#' term='Flex'/><category scheme='http://www.blogger.com/atom/ns#' term='flint'/><title type='text'>Flex Flint Particles Editor with Node Based UI</title><content type='html'>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://flexmonkey.co.uk/ParticleLabRelease_2001/main.html"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 317px;" src="http://1.bp.blogspot.com/_FGrZThm5JBo/S5gS_333qyI/AAAAAAAACDo/sJebo7dfyyY/s400/ParticleLabNodeUI.PNG" border="0" alt="" id="BLOGGER_PHOTO_ID_5447124637843958562" /&gt;&lt;/a&gt;&lt;br /&gt;Following some feedback on my first release of &lt;a href="http://flexmonkey.blogspot.com/2010/02/particlelab-20.html"&gt;ParticleLab 2.0&lt;/a&gt;, I decided to rebuild my &lt;a href="http://flexmonkey.blogspot.com/search/label/node%20based%20interface"&gt;node based user interface&lt;/a&gt; from the ground up. I feel the main issue with my&lt;a href="http://flexmonkey.blogspot.com/2009/01/particlelab-node-based-particle-system.html"&gt; original node based particle editor&lt;/a&gt; was the sheer size of the nodes meant navigating through the scenes was quite an unfriendly experience. To that end, I've stuck with the detail panel but added a node based UI for navigation and selection.&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;This now offers an immediate view of the entire scene and illustrates the relationships between all the objects. Although the UI doesn't yet allow users to create relationships, it can display shared nodes (for example several emitters may all use the same gravity well action).&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;I've based the new UI on a set of Flex TileLists - one for each category of Flint object. Using TileLists gives me all the nice transitions when nodes are added or removed and handles layout nicely. It's a shame that the TileList can't center justify its children.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;The next step is to add in place editing for the different zones. This version uses &lt;a href="http://www.degrafa.org/"&gt;Degrafa&lt;/a&gt; to render the zones in the editor and renderer.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Because this is the first attempt at recreating a Flex node based UI and there's a lot of room for tweaking, optimising, refactoring and general faffing about, I'm holding back on releasing the source. However, the application is &lt;a href="http://flexmonkey.co.uk/ParticleLabRelease_2001/main.html"&gt;available here&lt;/a&gt;.&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/17393483-9002576302680339607?l=flexmonkey.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://flexmonkey.blogspot.com/feeds/9002576302680339607/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=17393483&amp;postID=9002576302680339607' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/17393483/posts/default/9002576302680339607'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/17393483/posts/default/9002576302680339607'/><link rel='alternate' type='text/html' href='http://flexmonkey.blogspot.com/2010/03/flex-flint-particles-editor-with-node.html' title='Flex Flint Particles Editor with Node Based UI'/><author><name>Simon Gladman</name><uri>http://www.blogger.com/profile/17449788450837731883</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='28' height='32' src='http://4.bp.blogspot.com/_FGrZThm5JBo/TQ8ZMdgNEUI/AAAAAAAACy4/WGeOchj5VWk/S220/simon_venice.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_FGrZThm5JBo/S5gS_333qyI/AAAAAAAACDo/sJebo7dfyyY/s72-c/ParticleLabNodeUI.PNG' height='72' width='72'/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-17393483.post-347621813886449689</id><published>2010-03-01T13:40:00.000-08:00</published><updated>2011-02-03T01:24:04.085-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='genetic algorithm'/><category scheme='http://www.blogger.com/atom/ns#' term='ActionScript'/><category scheme='http://www.blogger.com/atom/ns#' term='gesture recognition'/><category scheme='http://www.blogger.com/atom/ns#' term='Flex'/><category scheme='http://www.blogger.com/atom/ns#' term='geneticType'/><title type='text'>Genetic Algorithms &amp; Typography Evolved</title><content type='html'>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://flexmonkey.co.uk/GeneticTypeRelease_2/GeneticType.html"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 152px;" src="http://4.bp.blogspot.com/_FGrZThm5JBo/S4w0rV-ML1I/AAAAAAAACDU/sHc7i3d0mRA/s400/geneticType_2.png" border="0" alt="" id="BLOGGER_PHOTO_ID_5443783968821096274" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;div&gt;I had some free time on Sunday and on the &lt;a href="http://www.eurostar.com/"&gt;Eurostar&lt;/a&gt; today to add in a few more fun features into my GeneticType application.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Firstly, I've added an &lt;i&gt;animation&lt;/i&gt; tab. Whenever a mutated version of a letter is generated which is fitter than its parent, it's stored as a key frame. The animation tab normalises the keyframes and uses the timer class to step through each one. This is the first step to using the application for transitions and I think it works really well. I've capped the total number of keyframes to 10,000 for each character.  I haven't really had time to run this for hours, but I'm sure 10,000 will be more than enough.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Secondly, I added a blur control. This makes triangles nearer the letter fitter. Using hard edges means there's no way of telling if a triangle is fitter depending on its distance. Obviously, the better fix is a better fitness function - maybe one that uses shape recognition. However, I'm not sure even my speedy fingers can get than done in two  hours on the Eurostar.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Finally, I dug out some &lt;a href="http://flexmonkey.blogspot.com/2008/04/clockwise-or-anti-clockwise.html"&gt;really old code&lt;/a&gt; for video playback control. The user is able to jog and shuttle the playback simply by tracing a clockwise or anti-clockwise shape over the canvas with their  pointing device with the button held down. IMHO, this works really well - there's no target control, just gesture anywhere on the screen.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;It's taken almost two years for me to find a home for that code, I'm pleased I got use out of it eventually.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;The new version of the application lives &lt;a href="http://flexmonkey.co.uk/GeneticTypeRelease_2/GeneticType.html"&gt;here&lt;/a&gt; (it's a new location to keep the evolution of the application available) - right click for the source.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Back to &lt;a href="http://flexmonkey.blogspot.com/2010/02/particlelab-20.html"&gt;particles&lt;/a&gt; with any free this week - step one is adding a node based UI.&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/17393483-347621813886449689?l=flexmonkey.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://flexmonkey.blogspot.com/feeds/347621813886449689/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=17393483&amp;postID=347621813886449689' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/17393483/posts/default/347621813886449689'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/17393483/posts/default/347621813886449689'/><link rel='alternate' type='text/html' href='http://flexmonkey.blogspot.com/2010/03/genetic-algorithms-typography-evolved.html' title='Genetic Algorithms &amp; Typography Evolved'/><author><name>Simon Gladman</name><uri>http://www.blogger.com/profile/17449788450837731883</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='28' height='32' src='http://4.bp.blogspot.com/_FGrZThm5JBo/TQ8ZMdgNEUI/AAAAAAAACy4/WGeOchj5VWk/S220/simon_venice.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_FGrZThm5JBo/S4w0rV-ML1I/AAAAAAAACDU/sHc7i3d0mRA/s72-c/geneticType_2.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-17393483.post-6261608239341742903</id><published>2010-02-26T00:16:00.000-08:00</published><updated>2010-02-26T11:56:48.140-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='typography'/><category scheme='http://www.blogger.com/atom/ns#' term='genetic algorithm'/><category scheme='http://www.blogger.com/atom/ns#' term='ActionScript'/><category scheme='http://www.blogger.com/atom/ns#' term='Flex'/><category scheme='http://www.blogger.com/atom/ns#' term='geneticType'/><title type='text'>Typography using Genetic Algorithms in Flex</title><content type='html'>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_FGrZThm5JBo/S4gnZOtAqKI/AAAAAAAACDM/c2FYKGKaDnw/s1600-h/geneticType.png"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 113px;" src="http://3.bp.blogspot.com/_FGrZThm5JBo/S4gnZOtAqKI/AAAAAAAACDM/c2FYKGKaDnw/s400/geneticType.png" border="0" alt="" id="BLOGGER_PHOTO_ID_5442643464074340514" /&gt;&lt;/a&gt;&lt;div style="text-align: left;"&gt;&lt;span class="Apple-style-span"  style="color:#551A8B;"&gt;&lt;u&gt;&lt;br /&gt;&lt;/u&gt;&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;I took some time off from &lt;a href="http://flexmonkey.blogspot.com/2010/02/particlelab-20.html"&gt;particles&lt;/a&gt; this week after a conversation in the pub started me thinking about genetic algorithms. &lt;a href="http://en.wikipedia.org/wiki/Genetic_algorithms"&gt;Genetic algorithms&lt;/a&gt; are a technique by which a randomised solution to a problem is created and a mutated version (or versions) is (or are) spawned. The original solution and the mutated version are compared for their fitness against a solution and the fitter lives on the spawn another mutated version.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;In my experiment, the solutions are random arrays of translucent triangles and the fitness function compares those random arrays against a character of text. The idea being after several generations of mutation and selection through the fitness function, the random array would start to resemble the target character .&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;a href="http://flexmonkey.co.uk/GeneticTypeRelease/GeneticType.html"&gt;Here's the work-in-progress Flex application&lt;/a&gt; (right click for source). I've added a UI that allows the user to select the target text, tweak some parameters and run the simulation.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;This was primarily an intellectual exercise, but I can the see real applications:&lt;/div&gt;&lt;div&gt;&lt;ul&gt;&lt;li&gt;Creating properly, randomised deconstructed type: most deconstructed type is based on a fixed font and each instance of each letter is identical. To me, this just looks odd and each instance of the same character should look different.&lt;/li&gt;&lt;li&gt;As a source of still  images for interesting typographic transitions. It would be interesting to store each new successful (i.e. fitter) mutation and animate them from their original fully  randomised state to their more evolved state.&lt;/li&gt;&lt;/ul&gt;&lt;div&gt;The fitness function lives in the &lt;i&gt;GeneticTypeWidget &lt;/i&gt;class. In a nutshell, it examines every pixel in the parent 'dna' and the mutated 'dna' against the target text. Since I'm only using black and white, I've selected a single, arbitrary colour channel for comparison to speed things up. As Flex loops over each pixel, it adds the the pixel difference to a fitness variable and at the end of the loop, the 'dna' whose fitness variable is less lives on for another generation.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;On my machine, it can take a good few minutes before the images start to resemble the target text. Sans serif, simple characters tend to work best and as the simulation runs, the mutations become less and less likely to be fitter than their parent, so the successful mutations become less frequent.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;The application lives &lt;a href="http://flexmonkey.co.uk/GeneticTypeRelease/GeneticType.html"&gt;here&lt;/a&gt; and the source code &lt;a href="http://flexmonkey.co.uk/GeneticTypeRelease/srcview/index.html"&gt;here&lt;/a&gt;.&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;i&gt;[Note: the initial random triangle code has been tweaked so they are smaller triangles and the effect is a lot nicer]&lt;/i&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/17393483-6261608239341742903?l=flexmonkey.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://flexmonkey.blogspot.com/feeds/6261608239341742903/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=17393483&amp;postID=6261608239341742903' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/17393483/posts/default/6261608239341742903'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/17393483/posts/default/6261608239341742903'/><link rel='alternate' type='text/html' href='http://flexmonkey.blogspot.com/2010/02/typography-using-genetic-algorithms-in.html' title='Typography using Genetic Algorithms in Flex'/><author><name>Simon Gladman</name><uri>http://www.blogger.com/profile/17449788450837731883</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='28' height='32' src='http://4.bp.blogspot.com/_FGrZThm5JBo/TQ8ZMdgNEUI/AAAAAAAACy4/WGeOchj5VWk/S220/simon_venice.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_FGrZThm5JBo/S4gnZOtAqKI/AAAAAAAACDM/c2FYKGKaDnw/s72-c/geneticType.png' height='72' width='72'/><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-17393483.post-7701857769637236463</id><published>2010-02-21T12:30:00.001-08:00</published><updated>2010-02-21T12:47:28.233-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='particles'/><category scheme='http://www.blogger.com/atom/ns#' term='ActionScript'/><category scheme='http://www.blogger.com/atom/ns#' term='particlelab'/><category scheme='http://www.blogger.com/atom/ns#' term='Flex'/><category scheme='http://www.blogger.com/atom/ns#' term='flint'/><category scheme='http://www.blogger.com/atom/ns#' term='Physics'/><title type='text'>ParticleLab 2.0</title><content type='html'>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_FGrZThm5JBo/S4GYO4UkczI/AAAAAAAACCc/E1Ycox_MIwM/s1600-h/ParticleLab.PNG"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 209px;" src="http://3.bp.blogspot.com/_FGrZThm5JBo/S4GYO4UkczI/AAAAAAAACCc/E1Ycox_MIwM/s400/ParticleLab.PNG" border="0" alt="" id="BLOGGER_PHOTO_ID_5440797206244520754" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;div&gt;Over a year ago, I wrote a network based application for editing &lt;a href="http://flintparticles.org/"&gt;Flint Particle&lt;/a&gt; scenes - &lt;a href="http://flexmonkey.blogspot.com/2009/01/particlelab-flex-particle-editor.html"&gt;ParticleLab&lt;/a&gt;. Although a lovely idea in theory, it wasn't a great user experience to create complex particle systems. So over the last few months, I've been playing with version 2 of ParticleLab which is available &lt;a href="http://flexmonkey.co.uk/ParticleLabRelease_2000/main.html"&gt;here&lt;/a&gt;.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;The interface is a lot more traditional and, more importantly, a lot more usable.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Flint scenes consist of one or more emitters and these emitters have counters, initialisers and actions. For example, an emitter may have colour and position initialisers and a gravity action. The new UI allows the user to select an emitter from the bottom toolbar and then access the additional properties through the form on the right.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;I've included two of Richard's examples - gravity well and flocking. These can be selected from the combobox in the bottom left of the application. If you add a new emitter, it comes bundled with some basic initialisers and actions to save time.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Now I've completed the basic engine, enhancing the user experience is my next step. I want to allow users to edit positions and zones through the GUI rather than entering values in numeric steppers. But as it stands, it does allow users to experiment with Flint. There's a great summary of what the different Flint classes do here: &lt;a href="http://slekx.com/2009/12/flint-visual-introduction/"&gt;http://slekx.com/2009/12/flint-visual-introduction/&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;I've enabled the source code, with one caveat. Although I use Cairngorm every day at work and I've a great advocate of frameworks, when my brain is working faster than my fingers, Cairngorm is too verbose. To that end, I use my own framework of sorts. The views broadcast events via &lt;a href="http://flexmonkey.blogspot.com/search/label/EventBroker"&gt;EventBroker&lt;/a&gt; and those are handled by a manager class. The manager does all the hard work.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Because properties of Flint objects aren't bindable, the manager cheats a bit and broadcasts change events that the editor and renderer subscribe to.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;The application is available &lt;a href="http://flexmonkey.co.uk/ParticleLabRelease_2000/main.html"&gt;here &lt;/a&gt;and the source &lt;a href="http://flexmonkey.co.uk/ParticleLabRelease_2000/srcview/index.html"&gt;here&lt;/a&gt;.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;simon&lt;br /&gt;&lt;div style="text-align: center;"&gt;&lt;span class="Apple-style-span"  style="color:#0000EE;"&gt;&lt;u&gt;&lt;br /&gt;&lt;/u&gt;&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/17393483-7701857769637236463?l=flexmonkey.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://flexmonkey.blogspot.com/feeds/7701857769637236463/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=17393483&amp;postID=7701857769637236463' title='6 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/17393483/posts/default/7701857769637236463'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/17393483/posts/default/7701857769637236463'/><link rel='alternate' type='text/html' href='http://flexmonkey.blogspot.com/2010/02/particlelab-20.html' title='ParticleLab 2.0'/><author><name>Simon Gladman</name><uri>http://www.blogger.com/profile/17449788450837731883</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='28' height='32' src='http://4.bp.blogspot.com/_FGrZThm5JBo/TQ8ZMdgNEUI/AAAAAAAACy4/WGeOchj5VWk/S220/simon_venice.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_FGrZThm5JBo/S4GYO4UkczI/AAAAAAAACCc/E1Ycox_MIwM/s72-c/ParticleLab.PNG' height='72' width='72'/><thr:total>6</thr:total></entry><entry><id>tag:blogger.com,1999:blog-17393483.post-8129010532904282667</id><published>2010-01-24T04:53:00.000-08:00</published><updated>2010-01-24T05:10:56.886-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ActionScript'/><category scheme='http://www.blogger.com/atom/ns#' term='gesture recognition'/><category scheme='http://www.blogger.com/atom/ns#' term='Flex'/><title type='text'>Simple Gesture Recognition in Flex</title><content type='html'>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_FGrZThm5JBo/S1xC7Mwp1KI/AAAAAAAACA0/T_4AOrj2OMI/s1600-h/gesture.jpg"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 318px; height: 235px;" src="http://4.bp.blogspot.com/_FGrZThm5JBo/S1xC7Mwp1KI/AAAAAAAACA0/T_4AOrj2OMI/s400/gesture.jpg" border="0" alt="" id="BLOGGER_PHOTO_ID_5430288835506984098" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;div&gt;I played with this before Christmas one weekend and rediscovered it last week. Although it's nowhere near complete, it's an interesting exercise and may be useful to some.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;The test bed application allows users to enter the figures 0-9 via simple gestures. A gesture starts with a mouse down on a box and ends after the user has moused over several boxes and releases the button.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;The &lt;i&gt;GesturePopUp&lt;/i&gt; class accepts an array collection of &lt;i&gt;Gesture&lt;/i&gt; objects. In turn, each &lt;i&gt;Gesture&lt;/i&gt; object contains an array that describes each position of that gesture. For example, the '1' character comprises of an array containing the positions 2, 5 and 8.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;While the user is performing a gesture, the code checks for any items in its &lt;i&gt;gesturesArrayCollection&lt;/i&gt; and displays all the relevant matches.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Why 'pop up'? When I first started writing this, I imagined the 3x3 grid as a pop up - maybe launched by pressing the space bar. Imagine you have a full screen video player, the grid could pop up to allow the user to execute commands such as play, pause, stop, etc.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;The application lives &lt;a href="http://flexmonkey.co.uk/gesture-release/SimpleGestureRecognition.html"&gt;here&lt;/a&gt; and the source code is available &lt;a href="http://flexmonkey.co.uk/gesture-release/srcview/index.html"&gt;here&lt;/a&gt;.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;simon&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/17393483-8129010532904282667?l=flexmonkey.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://flexmonkey.blogspot.com/feeds/8129010532904282667/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=17393483&amp;postID=8129010532904282667' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/17393483/posts/default/8129010532904282667'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/17393483/posts/default/8129010532904282667'/><link rel='alternate' type='text/html' href='http://flexmonkey.blogspot.com/2010/01/simple-gesture-recognition-in-flex.html' title='Simple Gesture Recognition in Flex'/><author><name>Simon Gladman</name><uri>http://www.blogger.com/profile/17449788450837731883</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='28' height='32' src='http://4.bp.blogspot.com/_FGrZThm5JBo/TQ8ZMdgNEUI/AAAAAAAACy4/WGeOchj5VWk/S220/simon_venice.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_FGrZThm5JBo/S1xC7Mwp1KI/AAAAAAAACA0/T_4AOrj2OMI/s72-c/gesture.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-17393483.post-4743630919413143590</id><published>2009-09-10T11:00:00.000-07:00</published><updated>2009-09-10T11:05:15.294-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ActionScript'/><category scheme='http://www.blogger.com/atom/ns#' term='HierarchicalData'/><category scheme='http://www.blogger.com/atom/ns#' term='AdvancedDataGrid'/><category scheme='http://www.blogger.com/atom/ns#' term='Flex'/><title type='text'>Dynamic Summary Headers on Hierarchical Data</title><content type='html'>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_FGrZThm5JBo/Sqk_EljLY4I/AAAAAAAABS0/pPI3xhhm-Ec/s1600-h/summary.png" style="text-decoration: none;"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 87px;" src="http://1.bp.blogspot.com/_FGrZThm5JBo/Sqk_EljLY4I/AAAAAAAABS0/pPI3xhhm-Ec/s400/summary.png" border="0" alt="" id="BLOGGER_PHOTO_ID_5379900577902453634" /&gt;&lt;/a&gt;&lt;p class="MsoNormal"&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;Let’s suppose you are displaying hierarchical data in the advanced data grid, but your child data has different properties depending on its parent. For example, you might be displaying the departments of a store with different products having different properties – a camera has a sensor type and a television has a display type.&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Here’s a little demonstration of how you can create dynamic headers at the parent level to solve this. It’s a bit hacky, but works. &lt;/p&gt;  &lt;p class="MsoNormal"&gt;I have two data types – a &lt;i style="mso-bidi-font-style: normal"&gt;LineItem&lt;/i&gt;, which is my product, and a &lt;i style="mso-bidi-font-style: normal"&gt;Department&lt;/i&gt;, which, surprisingly is my department. Both types have ‘abstract’ properties, elegantly named &lt;i style="mso-bidi-font-style:normal"&gt;columnA&lt;/i&gt;, &lt;i style="mso-bidi-font-style:normal"&gt;columnB&lt;/i&gt;, etc. At the &lt;i style="mso-bidi-font-style:normal"&gt;LineItem&lt;/i&gt; level, these properties hold the type specific data and at the &lt;i style="mso-bidi-font-style:normal"&gt;Department&lt;/i&gt; level, these properties are actually getter functions that return a header string for that type.&lt;/p&gt;  &lt;p class="MsoNormal"&gt;For example, my &lt;i style="mso-bidi-font-style:normal"&gt;columnB&lt;/i&gt; getter looks like this:&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom:0cm;margin-bottom:.0001pt;line-height: normal;mso-layout-grid-align:none;text-autospace:none"&gt;&lt;span class="Apple-style-span"   style="font-family:'courier new';color:#0033FF;"&gt;&lt;b&gt;&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;span class="Apple-style-span"   style="font-family:'courier new';color:#0033FF;"&gt;&lt;b&gt;&lt;p class="MsoNormal" style="margin-bottom:0cm;margin-bottom:.0001pt;line-height: normal;mso-layout-grid-align:none;text-autospace:none"&gt;&lt;span style="font-size: 10pt; font-family: Arial, sans-serif; "&gt;&lt;span class="Apple-style-span"  style="color:#CCCCCC;"&gt;                        &lt;/span&gt;&lt;/span&gt;&lt;b&gt;&lt;span style="font-size: 10pt; font-family: Arial, sans-serif; "&gt;&lt;span class="Apple-style-span"  style="color:#CCCCCC;"&gt;public&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style="font-size: 10pt; font-family: Arial, sans-serif; "&gt;&lt;span class="Apple-style-span"  style="color:#CCCCCC;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;b&gt;&lt;span style="font-size: 10pt; font-family: Arial, sans-serif; "&gt;&lt;span class="Apple-style-span"  style="color:#CCCCCC;"&gt;function&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style="font-size: 10pt; font-family: Arial, sans-serif; "&gt;&lt;span class="Apple-style-span"  style="color:#CCCCCC;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;b&gt;&lt;span style="font-size: 10pt; font-family: Arial, sans-serif; "&gt;&lt;span class="Apple-style-span"  style="color:#CCCCCC;"&gt;get&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style="font-size: 10pt; font-family: Arial, sans-serif; "&gt;&lt;span class="Apple-style-span"  style="color:#CCCCCC;"&gt; columnB():String&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:10.0pt;font-family:&amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;"&gt;&lt;span class="Apple-style-span"  style="color:#CCCCCC;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom:0cm;margin-bottom:.0001pt;line-height: normal;mso-layout-grid-align:none;text-autospace:none"&gt;&lt;span style="font-size: 10pt; font-family: Arial, sans-serif; "&gt;&lt;span class="Apple-style-span"  style="color:#CCCCCC;"&gt;                        {&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:10.0pt; font-family:&amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;"&gt;&lt;span class="Apple-style-span"  style="color:#CCCCCC;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom:0cm;margin-bottom:.0001pt;line-height: normal;mso-layout-grid-align:none;text-autospace:none"&gt;&lt;span style="font-size: 10pt; font-family: Arial, sans-serif; "&gt;&lt;span class="Apple-style-span"  style="color:#CCCCCC;"&gt;                                    &lt;/span&gt;&lt;/span&gt;&lt;b&gt;&lt;span style="font-size: 10pt; font-family: Arial, sans-serif; "&gt;&lt;span class="Apple-style-span"  style="color:#CCCCCC;"&gt;var&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style="font-size: 10pt; font-family: Arial, sans-serif; "&gt;&lt;span class="Apple-style-span"  style="color:#CCCCCC;"&gt; returnString:String = &lt;/span&gt;&lt;/span&gt;&lt;b&gt;&lt;span style="font-size: 10pt; font-family: Arial, sans-serif; "&gt;&lt;span class="Apple-style-span"  style="color:#CCCCCC;"&gt;''&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style="font-size:10.0pt;font-family:&amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;"&gt;&lt;span class="Apple-style-span"  style="color:#CCCCCC;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom:0cm;margin-bottom:.0001pt;line-height: normal;mso-layout-grid-align:none;text-autospace:none"&gt;&lt;span style="font-size: 10pt; font-family: Arial, sans-serif; "&gt;&lt;span class="Apple-style-span"  style="color:#CCCCCC;"&gt;                                    &lt;/span&gt;&lt;/span&gt;&lt;span style="font-size: 10.0pt;font-family:&amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;"&gt;&lt;span class="Apple-style-span"  style="color:#CCCCCC;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom:0cm;margin-bottom:.0001pt;line-height: normal;mso-layout-grid-align:none;text-autospace:none"&gt;&lt;span style="font-size: 10pt; font-family: Arial, sans-serif; "&gt;&lt;span class="Apple-style-span"  style="color:#CCCCCC;"&gt;                                    &lt;/span&gt;&lt;/span&gt;&lt;b&gt;&lt;span style="font-size: 10pt; font-family: Arial, sans-serif; "&gt;&lt;span class="Apple-style-span"  style="color:#CCCCCC;"&gt;if&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style="font-size: 10pt; font-family: Arial, sans-serif; "&gt;&lt;span class="Apple-style-span"  style="color:#CCCCCC;"&gt; (&lt;/span&gt;&lt;/span&gt;&lt;b&gt;&lt;span style="font-size: 10pt; font-family: Arial, sans-serif; "&gt;&lt;span class="Apple-style-span"  style="color:#CCCCCC;"&gt;this&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style="font-size: 10pt; font-family: Arial, sans-serif; "&gt;&lt;span class="Apple-style-span"  style="color:#CCCCCC;"&gt;.isOpen)&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:10.0pt;font-family:&amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;"&gt;&lt;span class="Apple-style-span"  style="color:#CCCCCC;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom:0cm;margin-bottom:.0001pt;line-height: normal;mso-layout-grid-align:none;text-autospace:none"&gt;&lt;span style="font-size: 10pt; font-family: Arial, sans-serif; "&gt;&lt;span class="Apple-style-span"  style="color:#CCCCCC;"&gt;                                    {&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size: 10.0pt;font-family:&amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;"&gt;&lt;span class="Apple-style-span"  style="color:#CCCCCC;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom:0cm;margin-bottom:.0001pt;line-height: normal;mso-layout-grid-align:none;text-autospace:none"&gt;&lt;span style="font-size: 10pt; font-family: Arial, sans-serif; "&gt;&lt;span class="Apple-style-span"  style="color:#CCCCCC;"&gt;                                                &lt;/span&gt;&lt;/span&gt;&lt;b&gt;&lt;span style="font-size: 10pt; font-family: Arial, sans-serif; "&gt;&lt;span class="Apple-style-span"  style="color:#CCCCCC;"&gt;switch&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style="font-size: 10pt; font-family: Arial, sans-serif; "&gt;&lt;span class="Apple-style-span"  style="color:#CCCCCC;"&gt; (&lt;/span&gt;&lt;/span&gt;&lt;b&gt;&lt;span style="font-size: 10pt; font-family: Arial, sans-serif; "&gt;&lt;span class="Apple-style-span"  style="color:#CCCCCC;"&gt;this&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style="font-size: 10pt; font-family: Arial, sans-serif; "&gt;&lt;span class="Apple-style-span"  style="color:#CCCCCC;"&gt;.type)&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:10.0pt;font-family:&amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;"&gt;&lt;span class="Apple-style-span"  style="color:#CCCCCC;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom:0cm;margin-bottom:.0001pt;line-height: normal;mso-layout-grid-align:none;text-autospace:none"&gt;&lt;span style="font-size: 10pt; font-family: Arial, sans-serif; "&gt;&lt;span class="Apple-style-span"  style="color:#CCCCCC;"&gt;                                                {&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:10.0pt;font-family:&amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;"&gt;&lt;span class="Apple-style-span"  style="color:#CCCCCC;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom:0cm;margin-bottom:.0001pt;line-height: normal;mso-layout-grid-align:none;text-autospace:none"&gt;&lt;span style="font-size: 10pt; font-family: Arial, sans-serif; "&gt;&lt;span class="Apple-style-span"  style="color:#CCCCCC;"&gt;                                                            &lt;/span&gt;&lt;/span&gt;&lt;b&gt;&lt;span style="font-size: 10pt; font-family: Arial, sans-serif; "&gt;&lt;span class="Apple-style-span"  style="color:#CCCCCC;"&gt;case&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style="font-size: 10pt; font-family: Arial, sans-serif; "&gt;&lt;span class="Apple-style-span"  style="color:#CCCCCC;"&gt; CAMERA:&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:10.0pt;font-family:&amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;"&gt;&lt;span class="Apple-style-span"  style="color:#CCCCCC;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom:0cm;margin-bottom:.0001pt;line-height: normal;mso-layout-grid-align:none;text-autospace:none"&gt;&lt;span style="font-size: 10pt; font-family: Arial, sans-serif; "&gt;&lt;span class="Apple-style-span"  style="color:#CCCCCC;"&gt;                                                                        returnString = &lt;/span&gt;&lt;/span&gt;&lt;b&gt;&lt;span style="font-size: 10pt; font-family: Arial, sans-serif; "&gt;&lt;span class="Apple-style-span"  style="color:#CCCCCC;"&gt;"Lens"&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style="font-size:10.0pt; font-family:&amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;"&gt;&lt;span class="Apple-style-span"  style="color:#CCCCCC;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom:0cm;margin-bottom:.0001pt;line-height: normal;mso-layout-grid-align:none;text-autospace:none"&gt;&lt;span style="font-size: 10pt; font-family: Arial, sans-serif; "&gt;&lt;span class="Apple-style-span"  style="color:#CCCCCC;"&gt;                                                                        &lt;/span&gt;&lt;/span&gt;&lt;b&gt;&lt;span style="font-size: 10pt; font-family: Arial, sans-serif; "&gt;&lt;span class="Apple-style-span"  style="color:#CCCCCC;"&gt;break&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style="font-size:10.0pt;font-family:&amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;"&gt;&lt;span class="Apple-style-span"  style="color:#CCCCCC;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom:0cm;margin-bottom:.0001pt;line-height: normal;mso-layout-grid-align:none;text-autospace:none"&gt;&lt;span style="font-size: 10pt; font-family: Arial, sans-serif; "&gt;&lt;span class="Apple-style-span"  style="color:#CCCCCC;"&gt;                                                            &lt;/span&gt;&lt;/span&gt;&lt;b&gt;&lt;span style="font-size: 10pt; font-family: Arial, sans-serif; "&gt;&lt;span class="Apple-style-span"  style="color:#CCCCCC;"&gt;case&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style="font-size: 10pt; font-family: Arial, sans-serif; "&gt;&lt;span class="Apple-style-span"  style="color:#CCCCCC;"&gt; TELEVISION:&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:10.0pt;font-family:&amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;"&gt;&lt;span class="Apple-style-span"  style="color:#CCCCCC;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom:0cm;margin-bottom:.0001pt;line-height: normal;mso-layout-grid-align:none;text-autospace:none"&gt;&lt;span style="font-size: 10pt; font-family: Arial, sans-serif; "&gt;&lt;span class="Apple-style-span"  style="color:#CCCCCC;"&gt;                                                                        returnString = &lt;/span&gt;&lt;/span&gt;&lt;b&gt;&lt;span style="font-size: 10pt; font-family: Arial, sans-serif; "&gt;&lt;span class="Apple-style-span"  style="color:#CCCCCC;"&gt;"Display Type"&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style="font-size:10.0pt; font-family:&amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;"&gt;&lt;span class="Apple-style-span"  style="color:#CCCCCC;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom:0cm;margin-bottom:.0001pt;line-height: normal;mso-layout-grid-align:none;text-autospace:none"&gt;&lt;span style="font-size: 10pt; font-family: Arial, sans-serif; "&gt;&lt;span class="Apple-style-span"  style="color:#CCCCCC;"&gt;                                                                        &lt;/span&gt;&lt;/span&gt;&lt;b&gt;&lt;span style="font-size: 10pt; font-family: Arial, sans-serif; "&gt;&lt;span class="Apple-style-span"  style="color:#CCCCCC;"&gt;break&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style="font-size:10.0pt;font-family:&amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;"&gt;&lt;span class="Apple-style-span"  style="color:#CCCCCC;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom:0cm;margin-bottom:.0001pt;line-height: normal;mso-layout-grid-align:none;text-autospace:none"&gt;&lt;span style="font-size: 10pt; font-family: Arial, sans-serif; "&gt;&lt;span class="Apple-style-span"  style="color:#CCCCCC;"&gt;                                                            &lt;/span&gt;&lt;/span&gt;&lt;b&gt;&lt;span style="font-size: 10pt; font-family: Arial, sans-serif; "&gt;&lt;span class="Apple-style-span"  style="color:#CCCCCC;"&gt;case&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style="font-size: 10pt; font-family: Arial, sans-serif; "&gt;&lt;span class="Apple-style-span"  style="color:#CCCCCC;"&gt; PETS:&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:10.0pt;font-family:&amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;"&gt;&lt;span class="Apple-style-span"  style="color:#CCCCCC;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom:0cm;margin-bottom:.0001pt;line-height: normal;mso-layout-grid-align:none;text-autospace:none"&gt;&lt;span style="font-size: 10pt; font-family: Arial, sans-serif; "&gt;&lt;span class="Apple-style-span"  style="color:#CCCCCC;"&gt;                                                                        returnString = &lt;/span&gt;&lt;/span&gt;&lt;b&gt;&lt;span style="font-size: 10pt; font-family: Arial, sans-serif; "&gt;&lt;span class="Apple-style-span"  style="color:#CCCCCC;"&gt;"Favourite Food"&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style="font-size: 10.0pt;font-family:&amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;"&gt;&lt;span class="Apple-style-span"  style="color:#CCCCCC;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom:0cm;margin-bottom:.0001pt;line-height: normal;mso-layout-grid-align:none;text-autospace:none"&gt;&lt;span style="font-size: 10pt; font-family: Arial, sans-serif; "&gt;&lt;span class="Apple-style-span"  style="color:#CCCCCC;"&gt;                                                                        &lt;/span&gt;&lt;/span&gt;&lt;b&gt;&lt;span style="font-size: 10pt; font-family: Arial, sans-serif; "&gt;&lt;span class="Apple-style-span"  style="color:#CCCCCC;"&gt;break&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style="font-size:10.0pt;font-family:&amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;"&gt;&lt;span class="Apple-style-span"  style="color:#CCCCCC;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom:0cm;margin-bottom:.0001pt;line-height: normal;mso-layout-grid-align:none;text-autospace:none"&gt;&lt;span style="font-size: 10pt; font-family: Arial, sans-serif; "&gt;&lt;span class="Apple-style-span"  style="color:#CCCCCC;"&gt;                                                            &lt;/span&gt;&lt;/span&gt;&lt;b&gt;&lt;span style="font-size: 10pt; font-family: Arial, sans-serif; "&gt;&lt;span class="Apple-style-span"  style="color:#CCCCCC;"&gt;default&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style="font-size: 10pt; font-family: Arial, sans-serif; "&gt;&lt;span class="Apple-style-span"  style="color:#CCCCCC;"&gt;:&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:10.0pt;font-family:&amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;"&gt;&lt;span class="Apple-style-span"  style="color:#CCCCCC;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom:0cm;margin-bottom:.0001pt;line-height: normal;mso-layout-grid-align:none;text-autospace:none"&gt;&lt;span style="font-size: 10pt; font-family: Arial, sans-serif; "&gt;&lt;span class="Apple-style-span"  style="color:#CCCCCC;"&gt;                                                                        returnString = &lt;/span&gt;&lt;/span&gt;&lt;b&gt;&lt;span style="font-size: 10pt; font-family: Arial, sans-serif; "&gt;&lt;span class="Apple-style-span"  style="color:#CCCCCC;"&gt;'Unknown Department Type!'&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style="font-size: 10.0pt;font-family:&amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;"&gt;&lt;span class="Apple-style-span"  style="color:#CCCCCC;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom:0cm;margin-bottom:.0001pt;line-height: normal;mso-layout-grid-align:none;text-autospace:none"&gt;&lt;span style="font-size: 10pt; font-family: Arial, sans-serif; "&gt;&lt;span class="Apple-style-span"  style="color:#CCCCCC;"&gt;                                                                        &lt;/span&gt;&lt;/span&gt;&lt;b&gt;&lt;span style="font-size: 10pt; font-family: Arial, sans-serif; "&gt;&lt;span class="Apple-style-span"  style="color:#CCCCCC;"&gt;break&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style="font-size:10.0pt;font-family:&amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;"&gt;&lt;span class="Apple-style-span"  style="color:#CCCCCC;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom:0cm;margin-bottom:.0001pt;line-height: normal;mso-layout-grid-align:none;text-autospace:none"&gt;&lt;span style="font-size: 10pt; font-family: Arial, sans-serif; "&gt;&lt;span class="Apple-style-span"  style="color:#CCCCCC;"&gt;                                                }&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:10.0pt;font-family:&amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;"&gt;&lt;span class="Apple-style-span"  style="color:#CCCCCC;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom:0cm;margin-bottom:.0001pt;line-height: normal;mso-layout-grid-align:none;text-autospace:none"&gt;&lt;span style="font-size: 10pt; font-family: Arial, sans-serif; "&gt;&lt;span class="Apple-style-span"  style="color:#CCCCCC;"&gt;                                    }&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size: 10.0pt;font-family:&amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;"&gt;&lt;span class="Apple-style-span"  style="color:#CCCCCC;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom:0cm;margin-bottom:.0001pt;line-height: normal;mso-layout-grid-align:none;text-autospace:none"&gt;&lt;span style="font-size: 10pt; font-family: Arial, sans-serif; "&gt;&lt;span class="Apple-style-span"  style="color:#CCCCCC;"&gt;                                    &lt;/span&gt;&lt;/span&gt;&lt;b&gt;&lt;span style="font-size: 10pt; font-family: Arial, sans-serif; "&gt;&lt;span class="Apple-style-span"  style="color:#CCCCCC;"&gt;return&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style="font-size: 10pt; font-family: Arial, sans-serif; "&gt;&lt;span class="Apple-style-span"  style="color:#CCCCCC;"&gt; returnString&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:10.0pt;font-family:&amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;"&gt;&lt;span class="Apple-style-span"  style="color:#CCCCCC;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="font-size: 10pt; line-height: 115%; font-family: Arial, sans-serif; "&gt;&lt;span class="Apple-style-span"  style="color:#CCCCCC;"&gt;                        }&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;/b&gt;&lt;/span&gt;&lt;p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;I also wanted to hide the headers when the department row was collapsed, so naughtily, the advanced data grid sets the department’s &lt;i style="mso-bidi-font-style:normal"&gt;isOpen&lt;/i&gt; property when the user expands or collapses the row.&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;a href="http://flexmonkey.co.uk/summaryheaders-bin-release/SummaryHeaders.html"&gt;The application is available here &lt;/a&gt;- right click for the source code.&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/17393483-4743630919413143590?l=flexmonkey.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://flexmonkey.blogspot.com/feeds/4743630919413143590/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=17393483&amp;postID=4743630919413143590' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/17393483/posts/default/4743630919413143590'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/17393483/posts/default/4743630919413143590'/><link rel='alternate' type='text/html' href='http://flexmonkey.blogspot.com/2009/09/dynamic-summary-headers-on-hierarchical.html' title='Dynamic Summary Headers on Hierarchical Data'/><author><name>Simon Gladman</name><uri>http://www.blogger.com/profile/17449788450837731883</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='28' height='32' src='http://4.bp.blogspot.com/_FGrZThm5JBo/TQ8ZMdgNEUI/AAAAAAAACy4/WGeOchj5VWk/S220/simon_venice.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_FGrZThm5JBo/Sqk_EljLY4I/AAAAAAAABS0/pPI3xhhm-Ec/s72-c/summary.png' height='72' width='72'/><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-17393483.post-3738199725294810722</id><published>2009-07-27T06:23:00.001-07:00</published><updated>2009-07-27T06:29:48.685-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Design Pattern'/><category scheme='http://www.blogger.com/atom/ns#' term='ActionScript'/><category scheme='http://www.blogger.com/atom/ns#' term='EventBroker'/><category scheme='http://www.blogger.com/atom/ns#' term='DevelopmentArc'/><title type='text'>EventBroker saved my life!</title><content type='html'>Just a quick tip - if you have components within components within components and bubbling events are slowing your Flex application down to a crawl, take a look at the implementation of the publisher/subscriber pattern (you did read &lt;a href="http://www.amazon.co.uk/Design-patterns-elements-reusable-object-oriented/dp/0201633612/ref=sr_1_1?ie=UTF8&amp;amp;qid=1248701106&amp;amp;sr=8-1"&gt;Design Patterns&lt;/a&gt;, didn't you :)) called &lt;a href="http://code.google.com/p/developmentarc-core/wiki/EventBroker"&gt;EventBroker&lt;/a&gt;.&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;It allows you to broadcast events from anywhere in your application and subscribe to them anywhere else. No need for bubbling through layers of UI.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;I owe the guys at &lt;a href="http://www.developmentarc.com/site/"&gt;DevelopmentArc&lt;/a&gt; a pint or two...&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/17393483-3738199725294810722?l=flexmonkey.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://flexmonkey.blogspot.com/feeds/3738199725294810722/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=17393483&amp;postID=3738199725294810722' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/17393483/posts/default/3738199725294810722'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/17393483/posts/default/3738199725294810722'/><link rel='alternate' type='text/html' href='http://flexmonkey.blogspot.com/2009/07/eventbroker-saved-my-life.html' title='EventBroker saved my life!'/><author><name>Simon Gladman</name><uri>http://www.blogger.com/profile/17449788450837731883</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='28' height='32' src='http://4.bp.blogspot.com/_FGrZThm5JBo/TQ8ZMdgNEUI/AAAAAAAACy4/WGeOchj5VWk/S220/simon_venice.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-17393483.post-7043638478662764893</id><published>2009-07-16T11:38:00.000-07:00</published><updated>2009-07-16T11:43:06.849-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='listData'/><category scheme='http://www.blogger.com/atom/ns#' term='itemRenderer'/><category scheme='http://www.blogger.com/atom/ns#' term='AdvancedDataGrid'/><category scheme='http://www.blogger.com/atom/ns#' term='Flex'/><title type='text'>ItemRenderers in the AdvancedDataGrid</title><content type='html'>&lt;div&gt;Here's something that's maybe not immediately obvious when creating item renderers for the ADG. More often than not, the ADG's selected index isn't the corresponding index in the data provider. For instance, grouping rows count in the ADG but not in the data providers.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Classes like &lt;i&gt;List &lt;/i&gt;have a data property that item renderers can use to access their data, the ADG uses &lt;i&gt;BaseListData&lt;/i&gt;.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Let's have a look at a super simple implementation of the ADG:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&amp;lt;mx:AdvancedDataGrid itemRenderer="ClickableItemRenderer"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;  &lt;span class="Apple-style-span" style="white-space: normal; "&gt;&amp;lt;mx:dataProvider&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;   &lt;span class="Apple-style-span" style="white-space: normal; "&gt;&amp;lt;mx:Object name="Simon" age="21" gender="male" /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;   &lt;span class="Apple-style-span" style="white-space: normal; "&gt;&amp;lt;mx:Object name="Bill" age="42" gender="male" /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;   &lt;span class="Apple-style-span" style="white-space: normal; "&gt;&amp;lt;mx:Object name="Fred" age="35" gender="male" /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;   &lt;span class="Apple-style-span" style="white-space: normal; "&gt;&amp;lt;mx:Object name="Angela" age="21" gender="female" /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;   &lt;span class="Apple-style-span" style="white-space: normal; "&gt;&amp;lt;mx:Object name="Jane" age="37" gender="female" /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;  &lt;span class="Apple-style-span" style="white-space: normal; "&gt;&amp;lt;/mx:dataProvider&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt; &lt;span class="Apple-style-span" style="white-space: normal; "&gt;&amp;lt;&lt;span class="Apple-style-span" style="font-family: Georgia; font-size: 16px; "&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;/mx:AdvancedDataGrid&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;&lt;/div&gt;&lt;div&gt;You'll notice that the item renderer is a new class - &lt;i&gt;ClickableItemRenderer&lt;/i&gt;. This implements &lt;i&gt;IDropInListItemRenderer &lt;/i&gt;and has getter and setter methods to set its listData property:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&amp;lt;?xml version="1.0" encoding="utf-8"?&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&amp;lt;mx:Box xmlns:mx="http://www.adobe.com/2006/mxml" &lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;implements="mx.controls.listClasses.IDropInListItemRenderer " &lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;doubleClickEnabled="true" doubleClick="doubleClickHandler()"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt; &lt;span class="Apple-style-span" style="white-space: normal; "&gt;&amp;lt;mx:Script&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;   &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;import mx.utils.ObjectUtil;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;   &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;import mx.controls.Alert;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;   &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;import mx.controls.listClasses.BaseListData;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;   &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;import mx.controls.advancedDataGridClasses.AdvancedDataGridListData;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;   &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;   &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;private var _listData:BaseListData;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;   &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;   &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;public function get listData():BaseListData&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;   &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;  &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;      return _listData;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;   &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;  &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;    &lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;   &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;public function set listData(value:BaseListData):void&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;   &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;    &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;_listData = value;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;    &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;labelWidget.text = AdvancedDataGridListData(listData).label &lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;   &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;}&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;   &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;   &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;   &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;private function doubleClickHandler():void&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;   &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;    &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;Alert.show('Data field: ' + AdvancedDataGridListData(listData).dataField + '\n'+&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;        &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;'Contents:' +  AdvancedDataGridListData(listData).label + '\n' +&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;        &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;'Row:\n' + ObjectUtil.toString(AdvancedDataGridListData(listData).item))&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;   &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;   &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt; &lt;span class="Apple-style-span" style="white-space: normal; "&gt;&amp;lt;/mx:Script&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt; &lt;span class="Apple-style-span" style="white-space: normal; "&gt;&amp;lt;mx:Label id="labelWidget"/&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&amp;lt;/mx:Box&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Double clicking any cell in the ADG now opens an alert that summarises the data field, contents and entire row.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Hope this is useful,&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;simon&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/17393483-7043638478662764893?l=flexmonkey.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://flexmonkey.blogspot.com/feeds/7043638478662764893/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=17393483&amp;postID=7043638478662764893' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/17393483/posts/default/7043638478662764893'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/17393483/posts/default/7043638478662764893'/><link rel='alternate' type='text/html' href='http://flexmonkey.blogspot.com/2009/07/itemrenderers-in-advanceddatagrid.html' title='ItemRenderers in the AdvancedDataGrid'/><author><name>Simon Gladman</name><uri>http://www.blogger.com/profile/17449788450837731883</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='28' height='32' src='http://4.bp.blogspot.com/_FGrZThm5JBo/TQ8ZMdgNEUI/AAAAAAAACy4/WGeOchj5VWk/S220/simon_venice.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-17393483.post-5509770060120258285</id><published>2009-07-07T06:59:00.000-07:00</published><updated>2009-07-07T08:25:25.041-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='GroupingCollection'/><category scheme='http://www.blogger.com/atom/ns#' term='AdvancedDataGrid'/><category scheme='http://www.blogger.com/atom/ns#' term='sorting'/><title type='text'>Sorting a grouping collection</title><content type='html'>If you write your own header &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_0"&gt;renderer&lt;/span&gt; for the advanced data grid (&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_1"&gt;ADG&lt;/span&gt;) that uses a grouping collection as its &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_2"&gt;datasource&lt;/span&gt;, you may find that clicking the header to sort doesn't work. In my case, the &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_3"&gt;ADG&lt;/span&gt; sorted on the first click, but failed on the subsequent clicks.&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;To save you the few hours I spent finding the solution to this problem, here's how to &lt;span class="blsp-spelling-corrected" id="SPELLING_ERROR_4"&gt;programmatically &lt;/span&gt;sort a grouping collection. In my case, the &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_5"&gt;ADG&lt;/span&gt; header &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_6"&gt;renderer&lt;/span&gt; dispatches an event when the user clicks it to invoke this method:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;   &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;private function &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_7"&gt;sortHandler&lt;/span&gt;(&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_8"&gt;dataField&lt;/span&gt;:String):void    &lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;   &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;    &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;var sort:Sort = new Sort();&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;    &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;  &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;        &lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_9"&gt;advancedDataGrid&lt;/span&gt;.&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_10"&gt;validateNow&lt;/span&gt;()&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;  &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;        &lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;sort.fields = [new &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_11"&gt;SortField&lt;/span&gt;(&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_12"&gt;dataField&lt;/span&gt;,true)]&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;  &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;        &lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;advancedDataGrid.dataProvider.sort = sort&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;  &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;        &lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;advancedDataGrid.dataProvider.refresh()&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;   &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;My &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_13"&gt;ADG&lt;/span&gt; is named &lt;i&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_14"&gt;advancedDataGrid&lt;/span&gt;&lt;/i&gt;.&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/17393483-5509770060120258285?l=flexmonkey.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://flexmonkey.blogspot.com/feeds/5509770060120258285/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=17393483&amp;postID=5509770060120258285' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/17393483/posts/default/5509770060120258285'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/17393483/posts/default/5509770060120258285'/><link rel='alternate' type='text/html' href='http://flexmonkey.blogspot.com/2009/07/sorting-grouping-collection.html' title='Sorting a grouping collection'/><author><name>Simon Gladman</name><uri>http://www.blogger.com/profile/17449788450837731883</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='28' height='32' src='http://4.bp.blogspot.com/_FGrZThm5JBo/TQ8ZMdgNEUI/AAAAAAAACy4/WGeOchj5VWk/S220/simon_venice.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-17393483.post-8558593657788334056</id><published>2009-04-29T02:36:00.000-07:00</published><updated>2009-04-29T02:49:20.900-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='recruitment'/><category scheme='http://www.blogger.com/atom/ns#' term='Flex'/><title type='text'>Looking for Flex Talent in London</title><content type='html'>Wow - two months since my last blog. I've had a busy few months moving house, changing, err,  'marital status' (&lt;span style="font-style: italic;"&gt;SWFP looking for...&lt;/span&gt;) and leaving Tag after a decade to move to a great SAP Netweaver company in Trafalgar Square called &lt;a href="http://www.keytree.co.uk/"&gt;Keytree&lt;/a&gt;. I've returned to my roots and my days are spent happily coding super slick Flex user interfaces to Keytree's power house SAP solutions.&lt;br /&gt;&lt;br /&gt;The opportunity to be at the forefront of integrating Flex and SAP is really exciting. So all my free time right now is spent working on some secret in-house projects, and my experiments with physics and other Flex goodies don't really get much time at the moment - hence the lack of blogging.&lt;br /&gt;&lt;br /&gt;I'm also currently putting feelers out for some fresh Flex talent around London to help me out on a new project (with other sexy Flex projects in the pipeline). If you're a middle weight Flex programmer with a good sense of interaction design, usability and aesthetics and you're looking for some great projects, please drop me a line: &lt;span style="font-style: italic;"&gt;simon.gladman [@] keytree.co.uk&lt;/span&gt; with your CV, some examples of your work and salary expectations.&lt;br /&gt;&lt;br /&gt;A new version of &lt;a href="http://flexmonkey.co.uk/spaceballs/spaceballs.html"&gt;Space Balls&lt;/a&gt; is in my pipeline :)&lt;br /&gt;&lt;br /&gt;simon&lt;br /&gt;&lt;br /&gt;PS: No agencies! I'm looking to recruit directly only :)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/17393483-8558593657788334056?l=flexmonkey.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://flexmonkey.blogspot.com/feeds/8558593657788334056/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=17393483&amp;postID=8558593657788334056' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/17393483/posts/default/8558593657788334056'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/17393483/posts/default/8558593657788334056'/><link rel='alternate' type='text/html' href='http://flexmonkey.blogspot.com/2009/04/looking-for-flex-talent-in-london.html' title='Looking for Flex Talent in London'/><author><name>Simon Gladman</name><uri>http://www.blogger.com/profile/17449788450837731883</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='28' height='32' src='http://4.bp.blogspot.com/_FGrZThm5JBo/TQ8ZMdgNEUI/AAAAAAAACy4/WGeOchj5VWk/S220/simon_venice.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-17393483.post-1519415807365260530</id><published>2009-02-23T22:25:00.000-08:00</published><updated>2009-02-23T22:57:08.644-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Declarative Graphics'/><category scheme='http://www.blogger.com/atom/ns#' term='ActionScript'/><category scheme='http://www.blogger.com/atom/ns#' term='gumbo'/><category scheme='http://www.blogger.com/atom/ns#' term='vector graphics'/><category scheme='http://www.blogger.com/atom/ns#' term='Flex'/><title type='text'>Binding Properties on Flex 4 Declarative Graphics</title><content type='html'>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://flexmonkey.co.uk/cubicbezier/GumboTests.html"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 281px;" src="http://1.bp.blogspot.com/_FGrZThm5JBo/SaOVgpORr5I/AAAAAAAAAmA/WJCfexU3UEU/s400/cubicbezier.png" border="0" alt="" id="BLOGGER_PHOTO_ID_5306249174026661778" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;Before &lt;a href="http://labs.adobe.com/wiki/index.php/Gumbo"&gt;Flex 4&lt;/a&gt;, if you were displaying vector graphics that were changing, your code needed to clear down the graphics object of your display class and re-render the graphics. What you couldn't do was, for example, simply change the position of the beginning or end of a line or curve. &lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Flex 4 introduces something slightly different - declarative graphics. With these, you define graphics as an object and their properties can be bound. Here's a super simple, five minute demonstration. At the top of the page, I create a &lt;a href="http://livedocs.adobe.com/flex/gumbo/langref/mx/graphics/CubicBezierSegment.html"&gt;CubicBezierSegment &lt;/a&gt;(another new feature of Flex 4). &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;The interesting thing about the Bezier segment is that all its properties - the positions of the start, control points and terminus and the weight and color of the stroke - are bound to a set of numeric steppers in the right hand panel. This means that when you change one of those steppers, there's no additional ActionScript - the Bezier curve redraws itself through the joy of binding.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;This ain't no &lt;a href="http://aviary.com/tools/raven"&gt;Raven&lt;/a&gt; - but if you're working with vector graphics, Flex 4 is the way to go.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;The &lt;a href="http://flexmonkey.co.uk/cubicbezier/GumboTests.html"&gt;demo application&lt;/a&gt; is here and the &lt;a href="http://flexmonkey.co.uk/cubicbezier/srcview/index.html"&gt;source code&lt;/a&gt; is here.&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/17393483-1519415807365260530?l=flexmonkey.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://flexmonkey.blogspot.com/feeds/1519415807365260530/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=17393483&amp;postID=1519415807365260530' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/17393483/posts/default/1519415807365260530'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/17393483/posts/default/1519415807365260530'/><link rel='alternate' type='text/html' href='http://flexmonkey.blogspot.com/2009/02/binding-properties-on-flex-4.html' title='Binding Properties on Flex 4 Declarative Graphics'/><author><name>Simon Gladman</name><uri>http://www.blogger.com/profile/17449788450837731883</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='28' height='32' src='http://4.bp.blogspot.com/_FGrZThm5JBo/TQ8ZMdgNEUI/AAAAAAAACy4/WGeOchj5VWk/S220/simon_venice.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_FGrZThm5JBo/SaOVgpORr5I/AAAAAAAAAmA/WJCfexU3UEU/s72-c/cubicbezier.png' height='72' width='72'/><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-17393483.post-5564460549390364477</id><published>2009-02-21T03:43:00.000-08:00</published><updated>2009-02-21T04:00:02.745-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='pseudo color'/><category scheme='http://www.blogger.com/atom/ns#' term='Computational Fluid Dynamics'/><category scheme='http://www.blogger.com/atom/ns#' term='ActionScript'/><category scheme='http://www.blogger.com/atom/ns#' term='false color'/><category scheme='http://www.blogger.com/atom/ns#' term='Flex'/><title type='text'>False Color Fluid Dynamics Bug Fixed</title><content type='html'>&lt;a href="http://2.bp.blogspot.com/_FGrZThm5JBo/SZ_pqeMPh2I/AAAAAAAAAlY/I63RKem8zDA/s1600-h/mateFluidMap.png"&gt;&lt;img id="BLOGGER_PHOTO_ID_5305215801933924194" style="DISPLAY: block; MARGIN: 0px auto 10px; WIDTH: 400px; CURSOR: hand; HEIGHT: 302px; TEXT-ALIGN: center" alt="" src="http://2.bp.blogspot.com/_FGrZThm5JBo/SZ_pqeMPh2I/AAAAAAAAAlY/I63RKem8zDA/s400/mateFluidMap.png" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;div&gt;The keener eyed of you may have noticed a typo in &lt;em&gt;getRenderColorValuesArray()&lt;/em&gt;. The first argument to &lt;em&gt;createGradientBox&lt;/em&gt; should be &lt;strong&gt;255&lt;/strong&gt; not &lt;strong&gt;200&lt;/strong&gt;.&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;The fixed version of the &lt;a href="http://www.flexmonkey.co.uk/MateFluidSim_v3/MateFluidSimulation.html"&gt;application lives here &lt;/a&gt;and the &lt;a href="http://www.flexmonkey.co.uk/MateFluidSim_v3/srcview/index.html"&gt;source code lives here&lt;/a&gt;.&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/17393483-5564460549390364477?l=flexmonkey.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://flexmonkey.blogspot.com/feeds/5564460549390364477/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=17393483&amp;postID=5564460549390364477' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/17393483/posts/default/5564460549390364477'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/17393483/posts/default/5564460549390364477'/><link rel='alternate' type='text/html' href='http://flexmonkey.blogspot.com/2009/02/false-color-fluid-dynamics-bug-fixed.html' title='False Color Fluid Dynamics Bug Fixed'/><author><name>Simon Gladman</name><uri>http://www.blogger.com/profile/17449788450837731883</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='28' height='32' src='http://4.bp.blogspot.com/_FGrZThm5JBo/TQ8ZMdgNEUI/AAAAAAAACy4/WGeOchj5VWk/S220/simon_venice.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_FGrZThm5JBo/SZ_pqeMPh2I/AAAAAAAAAlY/I63RKem8zDA/s72-c/mateFluidMap.png' height='72' width='72'/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-17393483.post-3088420712883224725</id><published>2009-02-19T22:58:00.000-08:00</published><updated>2009-02-19T23:28:16.586-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='pseudo color'/><category scheme='http://www.blogger.com/atom/ns#' term='Computational Fluid Dynamics'/><category scheme='http://www.blogger.com/atom/ns#' term='ActionScript'/><category scheme='http://www.blogger.com/atom/ns#' term='false color'/><category scheme='http://www.blogger.com/atom/ns#' term='Mate'/><category scheme='http://www.blogger.com/atom/ns#' term='Flex'/><title type='text'>False/Pseudo Colour Rendering of Flex Computational Fluid Dynamics Demo</title><content type='html'>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://www.flexmonkey.co.uk/MateFluidSim_v2/MateFluidSimulation.html"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 304px;" src="http://1.bp.blogspot.com/_FGrZThm5JBo/SZ5UnxJ5bAI/AAAAAAAAAlQ/HuXFG8ngIaA/s400/FluidSimScreenGrab.png" border="0" alt="" id="BLOGGER_PHOTO_ID_5304770453275503618" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;div&gt;&lt;a href="http://en.wikipedia.org/wiki/Pseudo-color"&gt;Pseudo colour&lt;/a&gt; rendering is a technique whereby individual pixels in a gray scale images are assigned a color based on a function or gradient. Last night I added pseudo colour rendering to my Flex computational fluid dynamics demo.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;The first thing was to add the gradient data to the &lt;span class="Apple-style-span" style="font-style: italic;"&gt;AdvancedOptionsModel &lt;/span&gt;and create a gradient editor for the user interface. Luckily &lt;a href="http://mariosh.com/"&gt;Mariusz Tkaczyk&lt;/a&gt; has written a &lt;a href="http://mariosh.com/components/gradient-editor/"&gt;nice gradient editor&lt;/a&gt; which was a snip to drop into my &lt;span class="Apple-style-span" style="font-style: italic;"&gt;Toolbar&lt;/span&gt; class.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;My initial thought was to have the toolbar supply the renderer with an array of color values for different temperatures. However, there's something very un-MVC about this approach - really the &lt;span class="Apple-style-span" style="font-style: italic;"&gt;FluidManager &lt;/span&gt;should have that responsibility. To that end, I wrote this handy little function that accepts the same arguments as &lt;span class="Apple-style-span" style="font-style: italic;"&gt;beginGradientFill &lt;/span&gt;and returns an array of &lt;span class="Apple-style-span" style="font-style: italic;"&gt;uints &lt;/span&gt;for each step of a gradient.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Here's the function:&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;  &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;private function getRenderColorValuesArray(gradientType:String, colors:Array, alphas:Array, ratios:Array):Array&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;  &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;   &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;// quite a useful function to get the color value of a given gradient at any point....&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;   &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;var renderColorValuesArray:Array=new Array()&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;   &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;var swatch:Canvas=new Canvas()&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;   &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;var bitmapData:BitmapData=new BitmapData(255,1)&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;   &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;var gradientBoxMatrix:Matrix=new Matrix()&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;   &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;   &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;gradientBoxMatrix.createGradientBox(200,1)&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;   &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;swatch.graphics.beginGradientFill(gradientType, colors, alphas, ratios, gradientBoxMatrix)&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;   &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;swatch.graphics.drawRect(0,0,255,1)&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;   &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;swatch.graphics.endFill()&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;  &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;   &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;bitmapData.draw(swatch)&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;   &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;   &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;for(var i:int=0; i&lt;=255; i++)&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;   &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;    &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;renderColorValuesArray.push( bitmapData.getPixel(i, 0))&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;   &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;   &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;   &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;return renderColorValuesArray&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;  &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;}&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;  &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;The &lt;a href="http://www.flexmonkey.co.uk/MateFluidSim_v2/srcview/index.html"&gt;complete source code is available here&lt;/a&gt; and the new&lt;a href="http://www.flexmonkey.co.uk/MateFluidSim_v2/MateFluidSimulation.html"&gt; psychedelic version of the application lives here&lt;/a&gt;.&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/17393483-3088420712883224725?l=flexmonkey.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://flexmonkey.blogspot.com/feeds/3088420712883224725/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=17393483&amp;postID=3088420712883224725' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/17393483/posts/default/3088420712883224725'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/17393483/posts/default/3088420712883224725'/><link rel='alternate' type='text/html' href='http://flexmonkey.blogspot.com/2009/02/falsepseudo-colour-rendering-of-flex.html' title='False/Pseudo Colour Rendering of Flex Computational Fluid Dynamics Demo'/><author><name>Simon Gladman</name><uri>http://www.blogger.com/profile/17449788450837731883</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='28' height='32' src='http://4.bp.blogspot.com/_FGrZThm5JBo/TQ8ZMdgNEUI/AAAAAAAACy4/WGeOchj5VWk/S220/simon_venice.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_FGrZThm5JBo/SZ5UnxJ5bAI/AAAAAAAAAlQ/HuXFG8ngIaA/s72-c/FluidSimScreenGrab.png' height='72' width='72'/><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-17393483.post-5793830835561239479</id><published>2009-02-13T01:11:00.000-08:00</published><updated>2009-02-13T01:19:17.229-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Computational Fluid Dynamics'/><category scheme='http://www.blogger.com/atom/ns#' term='ActionScript'/><category scheme='http://www.blogger.com/atom/ns#' term='Mate'/><category scheme='http://www.blogger.com/atom/ns#' term='Flex'/><title type='text'>Mate Framework Part II - Porting Computational Fluid Dynamics to Mate</title><content type='html'>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://flexmonkey.co.uk/MateFluidSim/MateFluidSimulation.html"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 250px;" src="http://4.bp.blogspot.com/_FGrZThm5JBo/SZU5fNGoZ0I/AAAAAAAAAlI/Dot2dKAL77o/s400/mateCFD.png" border="0" alt="" id="BLOGGER_PHOTO_ID_5302207344554829634" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;I've spent my free time over the last few days porting my CFD demonstration application to the &lt;a href="http://mate.asfusion.com/"&gt;Mate Framework&lt;/a&gt;. I think I've got all the nooks and crannies covered, so &lt;a href="http://flexmonkey.co.uk/MateFluidSim/MateFluidSimulation.html"&gt;here it is&lt;/a&gt;, along with &lt;a href="http://flexmonkey.co.uk/MateFluidSim/srcview/index.html"&gt;the source code&lt;/a&gt;.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;I've restyled the application, really to help distinguish it visually from the previous version while I was working on two codebases simultaneously. The skin is &lt;a href="http://scalenine.com/themes/darkroom/darkroom.html"&gt;Darkroom, &lt;/a&gt;with a few tweaks, and I've replaced the font with &lt;a href="http://en.wikipedia.org/wiki/Gill_Sans"&gt;Gill Sans&lt;/a&gt;.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;The MainEventMap is the real plumbing behind the application. Whereas in my previous 'Simongorm' version, there was some obfuscation around passing variables and handling events between the classes (especially between the FluidManager and the FluidSolver), under Mate we have a single class where all the relationships are made clear.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;The MethodInvokers and EventHandlers under Mate still slightly frustrate me. It would be such an  improvement if the EventHandlers could somehow pass the event type to the MethodInvokers so that the arguments property could autocomplete and do compile checking. I've had a few occasions where I've mistyped a property name or missed a closing bracket - this hasn't been picked up by the compiler and I've had to scrabble around finding my typo.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;I've probably got a few too many different event classes - maybe be being slightly more judicious with the type property I could rationalise them. But what I do have is a set of quite distinct event classes with (hopefully) self documenting names.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;It could be argued that the view classes are too tightly bound to the manager and models. I've used a lot of references to public static properties of the FluidManager (e.g. the different ambient temperature types). Ideally, these would be injected into the views to allow them to act as a user interface for different types of manager and model. &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Currently, the application renders in greyscale based on the density or temperature of the cell. This morning, I started playing with a graduation widget that allows users to define hot and cold colors and arbitrary values in between. This gives a much richer 'false color' image. Hopefully, I'll find time over the weekend to implement this and I'll post it next week.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/17393483-5793830835561239479?l=flexmonkey.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://flexmonkey.blogspot.com/feeds/5793830835561239479/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=17393483&amp;postID=5793830835561239479' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/17393483/posts/default/5793830835561239479'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/17393483/posts/default/5793830835561239479'/><link rel='alternate' type='text/html' href='http://flexmonkey.blogspot.com/2009/02/mate-framework-part-ii-porting.html' title='Mate Framework Part II - Porting Computational Fluid Dynamics to Mate'/><author><name>Simon Gladman</name><uri>http://www.blogger.com/profile/17449788450837731883</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='28' height='32' src='http://4.bp.blogspot.com/_FGrZThm5JBo/TQ8ZMdgNEUI/AAAAAAAACy4/WGeOchj5VWk/S220/simon_venice.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_FGrZThm5JBo/SZU5fNGoZ0I/AAAAAAAAAlI/Dot2dKAL77o/s72-c/mateCFD.png' height='72' width='72'/><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-17393483.post-2541714865594536853</id><published>2009-02-09T09:48:00.000-08:00</published><updated>2009-02-09T09:58:18.971-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='DZone'/><title type='text'>FlexMonkey is one of DZone's Most Valued Bloggers</title><content type='html'>I'm very flattered to have been invited to become one of &lt;a href="http://www.dzone.com/links/index.html"&gt;DZone's&lt;/a&gt; &lt;a href="http://www.dzone.com/mvbs"&gt;Most Valued Bloggers&lt;/a&gt;. Simply being on the same web page as &lt;a href="http://www.forta.com/"&gt;Ben Forta&lt;/a&gt; is quite a thrill!&lt;br /&gt;&lt;br /&gt;Keep an eye out on their &lt;a href="http://ria.dzone.com/"&gt;RIA Zone&lt;/a&gt; - you should see something from me there soon...&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/17393483-2541714865594536853?l=flexmonkey.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://flexmonkey.blogspot.com/feeds/2541714865594536853/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=17393483&amp;postID=2541714865594536853' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/17393483/posts/default/2541714865594536853'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/17393483/posts/default/2541714865594536853'/><link rel='alternate' type='text/html' href='http://flexmonkey.blogspot.com/2009/02/flexmonkey-is-one-of-dzones-most-valued.html' title='FlexMonkey is one of DZone&apos;s Most Valued Bloggers'/><author><name>Simon Gladman</name><uri>http://www.blogger.com/profile/17449788450837731883</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='28' height='32' src='http://4.bp.blogspot.com/_FGrZThm5JBo/TQ8ZMdgNEUI/AAAAAAAACy4/WGeOchj5VWk/S220/simon_venice.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-17393483.post-4488516534619937552</id><published>2009-02-09T05:39:00.001-08:00</published><updated>2009-02-12T03:21:54.121-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Computational Fluid Dynamics'/><category scheme='http://www.blogger.com/atom/ns#' term='ActionScript'/><category scheme='http://www.blogger.com/atom/ns#' term='Flex'/><category scheme='http://www.blogger.com/atom/ns#' term='Physics'/><title type='text'>Further Experiments with Computational Fluid Dynamics in Flex</title><content type='html'>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://flexmonkey.co.uk/FluidSim/FluidSimulation.html"&gt;&lt;img id="BLOGGER_PHOTO_ID_5300791888839699474" style="DISPLAY: block; MARGIN: 0px auto 10px; WIDTH: 400px; CURSOR: pointer; HEIGHT: 300px; TEXT-ALIGN: center" alt="" src="http://1.bp.blogspot.com/_FGrZThm5JBo/SZAyI1qP7BI/AAAAAAAAAjU/XjDiJ-C9Ym8/s400/fluidsim.png" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;This weekend was my birthday weekend, so less time was devoted to Flex than usual, but between &lt;a href="http://en.wikipedia.org/wiki/Gin_tonic"&gt;Gin &amp;amp; Tonics&lt;/a&gt;, I did find time to put a user interface onto my CFD playground to allow users to edit all those &lt;a href="http://en.wikipedia.org/wiki/Magic_number_%28programming%29"&gt;magic numbers&lt;/a&gt; hidden away in the source code.&lt;br /&gt;&lt;br /&gt;If your machine is fairly speedy, upping the linear solver iterations can produce some pretty &lt;a href="http://en.wikipedia.org/wiki/Eddies"&gt;eddies&lt;/a&gt; in the flow and upping the diffusion factor can give a pretty flame effect. The two buoyancy values change how hot, white areas flow upwards.&lt;br /&gt;&lt;br /&gt;Have a play. The &lt;a href="http://flexmonkey.co.uk/FluidSim/FluidSimulation.html"&gt;application is here&lt;/a&gt; and the &lt;a href="http://flexmonkey.co.uk/FluidSim/srcview/index.html"&gt;source code here&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;After an &lt;a href="http://mate.asfusion.com/news/sample-application-by-simon-gladman"&gt;honourable mention&lt;/a&gt; on the &lt;a href="http://mate.asfusion.com/"&gt;Mate&lt;/a&gt; front page, I will spend the next few days porting this code from 'Simongorm' to Mate. That should make the &lt;span style="FONT-STYLE: italic"&gt;FluidManager &lt;/span&gt;a lot more portable if you want to use it in your own projects.&lt;br /&gt;&lt;br /&gt;If you are in London tomorrow, I'll be at the &lt;a href="http://www.ukcfug.org/post.cfm/next-meeting-february-10th-little-fluffy-clouds"&gt;ColdFusion UK User Group&lt;/a&gt; meeting in Soho, see you there.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/17393483-4488516534619937552?l=flexmonkey.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://flexmonkey.blogspot.com/feeds/4488516534619937552/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=17393483&amp;postID=4488516534619937552' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/17393483/posts/default/4488516534619937552'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/17393483/posts/default/4488516534619937552'/><link rel='alternate' type='text/html' href='http://flexmonkey.blogspot.com/2009/02/further-experiments-with-computational.html' title='Further Experiments with Computational Fluid Dynamics in Flex'/><author><name>Simon Gladman</name><uri>http://www.blogger.com/profile/17449788450837731883</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='28' height='32' src='http://4.bp.blogspot.com/_FGrZThm5JBo/TQ8ZMdgNEUI/AAAAAAAACy4/WGeOchj5VWk/S220/simon_venice.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_FGrZThm5JBo/SZAyI1qP7BI/AAAAAAAAAjU/XjDiJ-C9Ym8/s72-c/fluidsim.png' height='72' width='72'/><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-17393483.post-4160333545840952090</id><published>2009-02-04T01:01:00.000-08:00</published><updated>2009-02-04T01:48:20.418-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Computational Fluid Dynamics'/><category scheme='http://www.blogger.com/atom/ns#' term='ActionScript'/><category scheme='http://www.blogger.com/atom/ns#' term='CFDevCon'/><category scheme='http://www.blogger.com/atom/ns#' term='Flex'/><category scheme='http://www.blogger.com/atom/ns#' term='Physics'/><title type='text'>Experiments with Computational Fluid Dynamics in Flex</title><content type='html'>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://flexmonkey.co.uk/FluidSim/FluidSimulation.html"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 302px;" src="http://4.bp.blogspot.com/_FGrZThm5JBo/SYlZbqk2BnI/AAAAAAAAAjM/w9kH_wZmRFg/s400/CFD.png" alt="" id="BLOGGER_PHOTO_ID_5298864768398263922" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;   &lt;w:latentstyles deflockedstate="false" defunhidewhenused="true" defsemihidden="true" defqformat="false" defpriority="99" latentstylecount="267"&gt;   &lt;w:lsdexception locked="false" priority="0" semihidden="false" unhidewhenused="false" qformat="true" name="Normal"&gt;   &lt;w:lsdexception locked="false" priority="9" semihidden="false" unhidewhenused="false" qformat="true" name="heading 1"&gt;   &lt;w:lsdexception locked="false" priority="9" qformat="true" name="heading 2"&gt;   &lt;w:lsdexception locked="false" priority="9" qformat="true" name="heading 3"&gt;   &lt;w:lsdexception locked="false" priority="9" qformat="true" name="heading 4"&gt;   &lt;w:lsdexception locked="false" priority="9" qformat="true" name="heading 5"&gt;   &lt;w:lsdexception locked="false" priority="9" qformat="true" name="heading 6"&gt;   &lt;w:lsdexception locked="false" priority="9" qformat="true" name="heading 7"&gt;   &lt;w:lsdexception locked="false" priority="9" qformat="true" name="heading 8"&gt;   &lt;w:lsdexception locked="false" priority="9" qformat="true" name="heading 9"&gt;   &lt;w:lsdexception locked="false" priority="39" name="toc 1"&gt;   &lt;w:lsdexception locked="false" priority="39" name="toc 2"&gt;   &lt;w:lsdexception locked="false" priority="39" name="toc 3"&gt;   &lt;w:lsdexception locked="false" priority="39" name="toc 4"&gt;   &lt;w:lsdexception locked="false" priority="39" name="toc 5"&gt;   &lt;w:lsdexception locked="false" priority="39" name="toc 6"&gt;   &lt;w:lsdexception locked="false" priority="39" name="toc 7"&gt;   &lt;w:lsdexception locked="false" priority="39" name="toc 8"&gt;   &lt;w:lsdexception locked="false" priority="39" name="toc 9"&gt;   &lt;w:lsdexception locked="false" priority="35" qformat="true" name="caption"&gt;   &lt;w:lsdexception locked="false" priority="10" semihidden="false" unhidewhenused="false" qformat="true" name="Title"&gt;   &lt;w:lsdexception locked="false" priority="1" name="Default Paragraph Font"&gt;   &lt;w:lsdexception locked="false" priority="11" semihidden="false" unhidewhenused="false" qformat="true" name="Subtitle"&gt;   &lt;w:lsdexception locked="false" priority="22" semihidden="false" unhidewhenused="false" qformat="true" name="Strong"&gt;   &lt;w:lsdexception locked="false" priority="20" semihidden="false" unhidewhenused="false" qformat="true" name="Emphasis"&gt;   &lt;w:lsdexception locked="false" priority="59" semihidden="false" unhidewhenused="false" name="Table Grid"&gt;   &lt;w:lsdexception locked="false" unhidewhenused="false" name="Placeholder Text"&gt;   &lt;w:lsdexception locked="false" priority="1" semihidden="false" unhidewhenused="false" qformat="true" name="No Spacing"&gt;   &lt;w:lsdexception locked="false" priority="60" semihidden="false" unhidewhenused="false" name="Light Shading"&gt;   &lt;w:lsdexception locked="false" priority="61" semihidden="false" unhidewhenused="false" name="Light List"&gt;   &lt;w:lsdexception locked="false" priority="62" semihidden="false" unhidewhenused="false" name="Light Grid"&gt;   &lt;w:lsdexception locked="false" priority="63" semihidden="false" unhidewhenused="false" name="Medium Shading 1"&gt;   &lt;w:lsdexception locked="false" priority="64" semihidden="false" unhidewhenused="false" name="Medium Shading 2"&gt;   &lt;w:lsdexception locked="false" priority="65" semihidden="false" unhidewhenused="false" name="Medium List 1"&gt;   &lt;w:lsdexception locked="false" priority="66" semihidden="false" unhidewhenused="false" name="Medium List 2"&gt;   &lt;w:lsdexception locked="false" priority="67" semihidden="false" unhidewhenused="false" name="Medium Grid 1"&gt;   &lt;w:lsdexception locked="false" priority="68" semihidden="false" unhidewhenused="false" name="Medium Grid 2"&gt;   &lt;w:lsdexception locked="false" priority="69" semihidden="false" unhidewhenused="false" name="Medium Grid 3"&gt;   &lt;w:lsdexception locked="false" priority="70" semihidden="false" unhidewhenused="false" name="Dark List"&gt;   &lt;w:lsdexception locked="false" priority="71" semihidden="false" unhidewhenused="false" name="Colorful Shading"&gt;   &lt;w:lsdexception locked="false" priority="72" semihidden="false" unhidewhenused="false" name="Colorful List"&gt;   &lt;w:lsdexception locked="false" priority="73" semihidden="false" unhidewhenused="false" name="Colorful Grid"&gt;   &lt;w:lsdexception locked="false" priority="60" semihidden="false" unhidewhenused="false" name="Light Shading Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="61" semihidden="false" unhidewhenused="false" name="Light List Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="62" semihidden="false" unhidewhenused="false" name="Light Grid Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="63" semihidden="false" unhidewhenused="false" name="Medium Shading 1 Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="64" semihidden="false" unhidewhenused="false" name="Medium Shading 2 Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="65" semihidden="false" unhidewhenused="false" name="Medium List 1 Accent 1"&gt;   &lt;w:lsdexception locked="false" unhidewhenused="false" name="Revision"&gt;   &lt;w:lsdexception locked="false" priority="34" semihidden="false" unhidewhenused="false" qformat="true" name="List Paragraph"&gt;   &lt;w:lsdexception locked="false" priority="29" semihidden="false" unhidewhenused="false" qformat="true" name="Quote"&gt;   &lt;w:lsdexception locked="false" priority="30" semihidden="false" unhidewhenused="false" qformat="true" name="Intense Quote"&gt;   &lt;w:lsdexception locked="false" priority="66" semihidden="false" unhidewhenused="false" name="Medium List 2 Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="67" semihidden="false" unhidewhenused="false" name="Medium Grid 1 Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="68" semihidden="false" unhidewhenused="false" name="Medium Grid 2 Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="69" semihidden="false" unhidewhenused="false" name="Medium Grid 3 Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="70" semihidden="false" unhidewhenused="false" name="Dark List Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="71" semihidden="false" unhidewhenused="false" name="Colorful Shading Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="72" semihidden="false" unhidewhenused="false" name="Colorful List Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="73" semihidden="false" unhidewhenused="false" name="Colorful Grid Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="60" semihidden="false" unhidewhenused="false" name="Light Shading Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="61" semihidden="false" unhidewhenused="false" name="Light List Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="62" semihidden="false" unhidewhenused="false" name="Light Grid Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="63" semihidden="false" unhidewhenused="false" name="Medium Shading 1 Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="64" semihidden="false" unhidewhenused="false" name="Medium Shading 2 Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="65" semihidden="false" unhidewhenused="false" name="Medium List 1 Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="66" semihidden="false" unhidewhenused="false" name="Medium List 2 Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="67" semihidden="false" unhidewhenused="false" name="Medium Grid 1 Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="68" semihidden="false" unhidewhenused="false" name="Medium Grid 2 Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="69" semihidden="false" unhidewhenused="false" name="Medium Grid 3 Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="70" semihidden="false" unhidewhenused="false" name="Dark List Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="71" semihidden="false" unhidewhenused="false" name="Colorful Shading Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="72" semihidden="false" unhidewhenused="false" name="Colorful List Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="73" semihidden="false" unhidewhenused="false" name="Colorful Grid Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="60" semihidden="false" unhidewhenused="false" name="Light Shading Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="61" semihidden="false" unhidewhenused="false" name="Light List Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="62" semihidden="false" unhidewhenused="false" name="Light Grid Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="63" semihidden="false" unhidewhenused="false" name="Medium Shading 1 Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="64" semihidden="false" unhidewhenused="false" name="Medium Shading 2 Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="65" semihidden="false" unhidewhenused="false" name="Medium List 1 Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="66" semihidden="false" unhidewhenused="false" name="Medium List 2 Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="67" semihidden="false" unhidewhenused="false" name="Medium Grid 1 Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="68" semihidden="false" unhidewhenused="false" name="Medium Grid 2 Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="69" semihidden="false" unhidewhenused="false" name="Medium Grid 3 Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="70" semihidden="false" unhidewhenused="false" name="Dark List Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="71" semihidden="false" unhidewhenused="false" name="Colorful Shading Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="72" semihidden="false" unhidewhenused="false" name="Colorful List Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="73" semihidden="false" unhidewhenused="false" name="Colorful Grid Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="60" semihidden="false" unhidewhenused="false" name="Light Shading Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="61" semihidden="false" unhidewhenused="false" name="Light List Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="62" semihidden="false" unhidewhenused="false" name="Light Grid Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="63" semihidden="false" unhidewhenused="false" name="Medium Shading 1 Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="64" semihidden="false" unhidewhenused="false" name="Medium Shading 2 Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="65" semihidden="false" unhidewhenused="false" name="Medium List 1 Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="66" semihidden="false" unhidewhenused="false" name="Medium List 2 Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="67" semihidden="false" unhidewhenused="false" name="Medium Grid 1 Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="68" semihidden="false" unhidewhenused="false" name="Medium Grid 2 Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="69" semihidden="false" unhidewhenused="false" name="Medium Grid 3 Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="70" semihidden="false" unhidewhenused="false" name="Dark List Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="71" semihidden="false" unhidewhenused="false" name="Colorful Shading Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="72" semihidden="false" unhidewhenused="false" name="Colorful List Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="73" semihidden="false" unhidewhenused="false" name="Colorful Grid Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="60" semihidden="false" unhidewhenused="false" name="Light Shading Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="61" semihidden="false" unhidewhenused="false" name="Light List Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="62" semihidden="false" unhidewhenused="false" name="Light Grid Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="63" semihidden="false" unhidewhenused="false" name="Medium Shading 1 Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="64" semihidden="false" unhidewhenused="false" name="Medium Shading 2 Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="65" semihidden="false" unhidewhenused="false" name="Medium List 1 Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="66" semihidden="false" unhidewhenused="false" name="Medium List 2 Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="67" semihidden="false" unhidewhenused="false" name="Medium Grid 1 Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="68" semihidden="false" unhidewhenused="false" name="Medium Grid 2 Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="69" semihidden="false" unhidewhenused="false" name="Medium Grid 3 Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="70" semihidden="false" unhidewhenused="false" name="Dark List Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="71" semihidden="false" unhidewhenused="false" name="Colorful Shading Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="72" semihidden="false" unhidewhenused="false" name="Colorful List Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="73" semihidden="false" unhidewhenused="false" name="Colorful Grid Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="60" semihidden="false" unhidewhenused="false" name="Light Shading Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="61" semihidden="false" unhidewhenused="false" name="Light List Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="62" semihidden="false" unhidewhenused="false" name="Light Grid Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="63" semihidden="false" unhidewhenused="false" name="Medium Shading 1 Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="64" semihidden="false" unhidewhenused="false" name="Medium Shading 2 Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="65" semihidden="false" unhidewhenused="false" name="Medium List 1 Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="66" semihidden="false" unhidewhenused="false" name="Medium List 2 Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="67" semihidden="false" unhidewhenused="false" name="Medium Grid 1 Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="68" semihidden="false" unhidewhenused="false" name="Medium Grid 2 Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="69" semihidden="false" unhidewhenused="false" name="Medium Grid 3 Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="70" semihidden="false" unhidewhenused="false" name="Dark List Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="71" semihidden="false" unhidewhenused="false" name="Colorful Shading Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="72" semihidden="false" unhidewhenused="false" name="Colorful List Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="73" semihidden="false" unhidewhenused="false" name="Colorful Grid Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="19" semihidden="false" unhidewhenused="false" qformat="true" name="Subtle Emphasis"&gt;   &lt;w:lsdexception locked="false" priority="21" semihidden="false" unhidewhenused="false" qformat="true" name="Intense Emphasis"&gt;   &lt;w:lsdexception locked="false" priority="31" semihidden="false" unhidewhenused="false" qformat="true" name="Subtle Reference"&gt;   &lt;w:lsdexception locked="false" priority="32" semihidden="false" unhidewhenused="false" qformat="true" name="Intense Reference"&gt;   &lt;w:lsdexception locked="false" priority="33" semihidden="false" unhidewhenused="false" qformat="true" name="Book Title"&gt;   &lt;w:lsdexception locked="false" priority="37" name="Bibliography"&gt;   &lt;w:lsdexception locked="false" priority="39" qformat="true" name="TOC Heading"&gt;  &lt;/w:LatentStyles&gt; &lt;/xml&gt;&lt;style&gt; &lt;!--  /* Font Definitions */  @font-face  {font-family:"Cambria Math";  panose-1:2 4 5 3 5 4 6 3 2 4;  mso-font-charset:0;  mso-generic-font-family:roman;  mso-font-pitch:variable;  mso-font-signature:-1610611985 1107304683 0 0 159 0;} @font-face  {font-family:Calibri;  panose-1:2 15 5 2 2 2 4 3 2 4;  mso-font-alt:"Century Gothic";  mso-font-charset:0;  mso-generic-font-family:swiss;  mso-font-pitch:variable;  mso-font-signature:-1610611985 1073750139 0 0 159 0;} @font-face  {font-family:Consolas;  panose-1:2 11 6 9 2 2 4 3 2 4;  mso-font-charset:0;  mso-generic-font-family:modern;  mso-font-pitch:fixed;  mso-font-signature:-1610611985 1073750091 0 0 159 0;}  /* Style Definitions */  p.MsoNormal, li.MsoNormal, div.MsoNormal  {mso-style-unhide:no;  mso-style-qformat:yes;  mso-style-parent:"";  margin:0cm;  margin-bottom:.0001pt;  mso-pagination:widow-orphan;  font-size:11.0pt;  font-family:"Calibri","sans-serif";  mso-ascii-font-family:Calibri;  mso-ascii-theme-font:minor-latin;  mso-fareast-font-family:Calibri;  mso-fareast-theme-font:minor-latin;  mso-hansi-font-family:Calibri;  mso-hansi-theme-font:minor-latin;  mso-bidi-font-family:"Times New Roman";  mso-bidi-theme-font:minor-bidi;} a:link, span.MsoHyperlink  {mso-style-priority:99;  color:blue;  mso-themecolor:hyperlink;  text-decoration:underline;  text-underline:single;} a:visited, span.MsoHyperlinkFollowed  {mso-style-noshow:yes;  mso-style-priority:99;  color:purple;  mso-themecolor:followedhyperlink;  text-decoration:underline;  text-underline:single;} p.MsoPlainText, li.MsoPlainText, div.MsoPlainText  {mso-style-noshow:yes;  mso-style-priority:99;  mso-style-link:"Plain Text Char";  margin:0cm;  margin-bottom:.0001pt;  mso-pagination:widow-orphan;  font-size:10.5pt;  font-family:Consolas;  mso-fareast-font-family:Calibri;  mso-fareast-theme-font:minor-latin;  mso-bidi-font-family:"Times New Roman";  mso-bidi-theme-font:minor-bidi;} span.PlainTextChar  {mso-style-name:"Plain Text Char";  mso-style-noshow:yes;  mso-style-priority:99;  mso-style-unhide:no;  mso-style-locked:yes;  mso-style-link:"Plain Text";  mso-ansi-font-size:10.5pt;  mso-bidi-font-size:10.5pt;  font-family:Consolas;  mso-ascii-font-family:Consolas;  mso-hansi-font-family:Consolas;} .MsoChpDefault  {mso-style-type:export-only;  mso-default-props:yes;  mso-ascii-font-family:Calibri;  mso-ascii-theme-font:minor-latin;  mso-fareast-font-family:Calibri;  mso-fareast-theme-font:minor-latin;  mso-hansi-font-family:Calibri;  mso-hansi-theme-font:minor-latin;  mso-bidi-font-family:"Times New Roman";  mso-bidi-theme-font:minor-bidi;} @page Section1  {size:612.0pt 792.0pt;  margin:72.0pt 72.0pt 72.0pt 72.0pt;  mso-header-margin:36.0pt;  mso-footer-margin:36.0pt;  mso-paper-source:0;} div.Section1  {page:Section1;} --&gt; &lt;/style&gt;&lt;!--[if gte mso 10]&gt; &lt;style&gt;  /* Style Definitions */  table.MsoNormalTable  {mso-style-name:"Table Normal";  mso-tstyle-rowband-size:0;  mso-tstyle-colband-size:0;  mso-style-noshow:yes;  mso-style-priority:99;  mso-style-qformat:yes;  mso-style-parent:"";  mso-padding-alt:0cm 5.4pt 0cm 5.4pt;  mso-para-margin:0cm;  mso-para-margin-bottom:.0001pt;  mso-pagination:widow-orphan;  font-size:10.0pt;  font-family:"Times New Roman","serif";  mso-fareast-font-family:"Times New Roman";} &lt;/style&gt; &lt;![endif]--&gt;Last week I started thinking about writing a new action class for Flint particles for Computational Fluid Dynamics (CFD). If you've ever researched real time CFD, you will have come across &lt;a href="http://www.dgp.toronto.edu/people/stam/reality/Research/pdf/GDC03.pdf"&gt;Real Time Fluid Dynamics for Games&lt;/a&gt; by Jos Stam. The paper breaks down the steps required for a simulation and provides the C code. Jos's solution is cell based rather than particle based so it's not immediatly applicable to my ParticleLab, but it's still a really interesting project.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;I spent Saturday porting the C code to ActionScript. By Saturday afternoon, my beautifully crafted cell objects and array collections were feeling slow, really slow. In a quest for elegance, I'd lost a lot in performance. Luckily, I found Pierluigi Pesenti's superb &lt;a href="http://blog.oaxoa.com/"&gt;Oaxoa blog&lt;/a&gt; and his &lt;a href="http://blog.oaxoa.com/2008/01/21/actionscript-3-fluids-simulation/"&gt;port of Jos's code to ActionScript&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;Pierluigi's code is a lot truer to Jos's C code and runs far quicker than my first attempts. So I happily trashed my code in favour of his.&lt;br /&gt;&lt;br /&gt;The one big difference between the ActionScript and the original C is that, for speed purposes, Pierluigi has reduced the iterations in his relaxation code that's used to diffuse velocities and densities. I haven't put a user interface widget in to allow the user to change the number of iterations, but you can experiment with this value by changing the top value of the 'k' loop in the linearSolver() method in FluidSolver.as.&lt;br /&gt;&lt;br /&gt;This simulation is hard coded to a 50x50 grid. Again, there's no UI to allow the user to increase the resolution, but if your machine can handle it, you may want to experiment by upping the resolution. This is controlled by the gridSize contsant in the main FluidSimulation.mxml file,&lt;br /&gt;&lt;br /&gt;My 'CFDLab' - which is more like a convection lab - allows users to add and edit source objects. These are areas of fixed 'temperature' with some user defined random variance. For example, a box with a low temperature appears black in the simulation and being cold, oozes black goo downwards, alternatively, a box with a hign temperature (the maximum temperature is 255) renders as a white box and emits a rising white smoke.&lt;br /&gt;&lt;br /&gt;In addition to source objects, the user can reset the ambient temperature. I've also popped in a few presets which you can access from the drop down in the bottom right.&lt;br /&gt;&lt;br /&gt;The Flex skin is 'Undefined' (http://www.scalenine.com/themes/undefined/Undefined.html) which was the winner of Scale Nine's 'Skin To Win' challenge last year.&lt;br /&gt;&lt;br /&gt;This was a true 'stream of conciousness' piece of coding and in my eagerness to get the code working, I ended up using my own 'framework' over Mate. By looking at the code, you can see how the main MXML file acts as the controller, invoking methods on the FluidModel (which should really be renamed FluidManager) in response to user events dispatched by the Toobar class.&lt;br /&gt;&lt;br /&gt;The &lt;a href="http://flexmonkey.co.uk/FluidSim/FluidSimulation.html"&gt;application is available here&lt;/a&gt; and the &lt;a href="http://flexmonkey.co.uk/FluidSim/srcview/index.html"&gt;source code here&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;Finally, if you're in London tonight, I'll be at &lt;a href="http://www.meetup.com/flexlondon/calendar/9543999/?a=ce1p_rt"&gt;Flex In The Pub&lt;/a&gt; - see you for a beer!&lt;br /&gt;&lt;br /&gt;simon gladman&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/17393483-4160333545840952090?l=flexmonkey.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://flexmonkey.blogspot.com/feeds/4160333545840952090/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=17393483&amp;postID=4160333545840952090' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/17393483/posts/default/4160333545840952090'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/17393483/posts/default/4160333545840952090'/><link rel='alternate' type='text/html' href='http://flexmonkey.blogspot.com/2009/02/experiments-with-computational-fluid.html' title='Experiments with Computational Fluid Dynamics in Flex'/><author><name>Simon Gladman</name><uri>http://www.blogger.com/profile/17449788450837731883</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='28' height='32' src='http://4.bp.blogspot.com/_FGrZThm5JBo/TQ8ZMdgNEUI/AAAAAAAACy4/WGeOchj5VWk/S220/simon_venice.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_FGrZThm5JBo/SYlZbqk2BnI/AAAAAAAAAjM/w9kH_wZmRFg/s72-c/CFD.png' height='72' width='72'/><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-17393483.post-4017938204487078818</id><published>2009-01-28T09:12:00.000-08:00</published><updated>2009-01-28T09:22:14.102-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Flex'/><title type='text'>FlexMonkey for Hire!</title><content type='html'>After over ten years working at &lt;a href="http://www.tagworldwide.com/"&gt;Tag Worldwide&lt;/a&gt;, the time has come to move on. I've really enjoyed my time at Tag, but after working on the same application for a decade I need some new challenges.&lt;br /&gt;&lt;br /&gt;As somebody who really, really loves to write great software, the additional responsibilities of being 'development director' do interfere with my writing gigabytes of amazing ActionScript.&lt;br /&gt;&lt;br /&gt;My background is ColdFusion, SQL, JavaScript and, of course, Flex. I'm creative, inventive, enthusiastic and despite being a bit of a spod, I really love working with people, presenting and leading teams.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.flexmonkey.co.uk/CurriculumVitae.pdf"&gt;My CV is available here.&lt;/a&gt; Drop me a line if you have any exciting opportunities.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/17393483-4017938204487078818?l=flexmonkey.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://flexmonkey.blogspot.com/feeds/4017938204487078818/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=17393483&amp;postID=4017938204487078818' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/17393483/posts/default/4017938204487078818'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/17393483/posts/default/4017938204487078818'/><link rel='alternate' type='text/html' href='http://flexmonkey.blogspot.com/2009/01/flexmonkey-for-hire.html' title='FlexMonkey for Hire!'/><author><name>Simon Gladman</name><uri>http://www.blogger.com/profile/17449788450837731883</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='28' height='32' src='http://4.bp.blogspot.com/_FGrZThm5JBo/TQ8ZMdgNEUI/AAAAAAAACy4/WGeOchj5VWk/S220/simon_venice.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-17393483.post-866986773963706710</id><published>2009-01-28T01:03:00.000-08:00</published><updated>2009-01-28T01:37:42.721-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='frameworks'/><category scheme='http://www.blogger.com/atom/ns#' term='ActionScript'/><category scheme='http://www.blogger.com/atom/ns#' term='Mate'/><category scheme='http://www.blogger.com/atom/ns#' term='Flex'/><title type='text'>Quick Introduction to the Mate Framework for Flex</title><content type='html'>Although at work I have implemented &lt;a href="http://en.wikipedia.org/wiki/Cairngorm_%28Flex_framework%29"&gt;Cairngorm&lt;/a&gt; as our preferred framework, for the personal projects that you see on my blog, I have my own framework of sorts. My framework involves creating view objects that use standard Flex binding to my data models, using Flex's BindingUtils to react to model changes and using the main MXML file to invoke methods on my models in response to events on the views.&lt;br /&gt;&lt;br /&gt;Recently, there's been a lot of chatter regarding the &lt;a href="http://mate.asfusion.com/"&gt;Mate&lt;/a&gt; framework, so last night started a little project to try it out.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://flexmonkey.co.uk/mate-bin-release/mate.html"&gt;This slightly useless little application&lt;/a&gt; allows users to create any number of coloured boxes (which I refer to as GraphicLayers), either filled or unfilled. They can select any of the GraphicLayers using a list view on the left and edit them. Let me run through the architecture to give you some insight into developing using Mate.&lt;br /&gt;&lt;br /&gt;The fundamental object is a GraphicLayer - this is a value object that defines how our boxes will be rendered. Also inside my models directory is the GraphicLayersManager which contains an array collection of GraphicLayers and the business logic surrounding it.&lt;br /&gt;&lt;br /&gt;I've created four view classes:&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;An Editor class that allows users to edit the properties of the currently selected GraphicLayer &lt;/li&gt;&lt;li&gt;A Renderer class that renders a GraphicLayer &lt;/li&gt;&lt;li&gt;A Thumbnail class that extends the Renderer but at a thumbnail size&lt;/li&gt;&lt;li&gt;A ListView class that lists the array collection of GraphicLayers and uses the Thumbnail class as its item renderer. The list view allows the user to define the currently selected GraphicLayer which is displayed in the Renderer and is editable in the Editor.&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;The view classes dispatch different events depending on user activity:&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;The GraphicLayerChangeEvent is dispatched when a user edits or adds a GraphicLayer. The event has two types - a change and an add.&lt;/li&gt;&lt;li&gt;The GraphicLayerSelectionChangeEvent is dispatched when a user changes the current selection in the list view.&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;Under the maps directory is the MainEventMap class. This class glues everything together using either EventHandlers or Injectors.&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;EventHandlers have a type property which refers to the event type. When a view dispatches an event, it is these that invoke methods on the GraphicLayersManager to change the array collection of GraphicLayers.&lt;/li&gt;&lt;li&gt;Injectors define the binding between properties of the GraphicLayersManager and view objects.&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;Having all the plumbing in a central location makes navigating the architecture of your application really easy. However, I do have reservations about the lack of checking at compile time of some of the properties in classes like the MethodInvoker's method property. Luckily, the Mate debugger is really helpful and using Flex's debug feature helps locate bugs and niggles very quickly.&lt;br /&gt;&lt;br /&gt;Overall, I really like Mate - it feels a lot lighter than Cairngorm and was a breeze to pick up. I've &lt;a href="http://flexmonkey.co.uk/mate-bin-release/srcview/index.html"&gt;enabled the source code view&lt;/a&gt; on this little application, I hope it helps towards your understanding of this new framework.&lt;br /&gt;&lt;br /&gt;The application is &lt;a href="http://flexmonkey.co.uk/mate-bin-release/mate.html"&gt;available here&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;simon gladman&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/17393483-866986773963706710?l=flexmonkey.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://flexmonkey.blogspot.com/feeds/866986773963706710/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=17393483&amp;postID=866986773963706710' title='6 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/17393483/posts/default/866986773963706710'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/17393483/posts/default/866986773963706710'/><link rel='alternate' type='text/html' href='http://flexmonkey.blogspot.com/2009/01/quick-introduction-to-mate-framework.html' title='Quick Introduction to the Mate Framework for Flex'/><author><name>Simon Gladman</name><uri>http://www.blogger.com/profile/17449788450837731883</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='28' height='32' src='http://4.bp.blogspot.com/_FGrZThm5JBo/TQ8ZMdgNEUI/AAAAAAAACy4/WGeOchj5VWk/S220/simon_venice.jpg'/></author><thr:total>6</thr:total></entry><entry><id>tag:blogger.com,1999:blog-17393483.post-1794430888633713608</id><published>2009-01-22T05:46:00.000-08:00</published><updated>2009-01-22T23:55:52.097-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='particles'/><category scheme='http://www.blogger.com/atom/ns#' term='ActionScript'/><category scheme='http://www.blogger.com/atom/ns#' term='particlelab'/><category scheme='http://www.blogger.com/atom/ns#' term='Flex'/><category scheme='http://www.blogger.com/atom/ns#' term='flint'/><title type='text'>ParticleLab - Flex Particle Editor Continued</title><content type='html'>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://flexmonkey.co.uk/flintparticlelabrelease/flintparticlelab.html"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 320px;" src="http://3.bp.blogspot.com/_FGrZThm5JBo/SXh43rdWAgI/AAAAAAAAAiA/-iSzb5OokXg/s400/particleLab.png" alt="" id="BLOGGER_PHOTO_ID_5294114259927958018" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;A few new additions to my Flint powered ParticleLab:&lt;br /&gt;&lt;br /&gt;&lt;ol&gt;&lt;li&gt;Improved performance while rendering the curve during the creation of relationships.&lt;/li&gt;&lt;li&gt;Added zones! Nodes such as the &lt;span style="font-style: italic;"&gt;position &lt;/span&gt;and &lt;span style="font-style: italic;"&gt;velocity &lt;/span&gt;ini&lt;span id="gtbmisp_4"    style="border: 0pt none ; margin: 0pt; padding: 0pt; background: transparent none repeat scroll 0% 0%; font-style: normal; font-variant: normal; font-weight: bold; line-height: normal; font-size-adjust: none; font-stretch: normal; position: static; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial; text-align: left; text-indent: 0pt; text-transform: none; text-decoration: underline; cursor: pointer;font-family:serif;font-size:100%;color:red;"&gt;&lt;/span&gt;tialisers can now be linked to a variety of different zones.&lt;/li&gt;&lt;li&gt;Added an overview list that centers the selected node when clicked.&lt;/li&gt;&lt;li&gt;Created a new class to allow the editing of point data.&lt;/li&gt;&lt;/ol&gt;Item three is an important addition when editing really complex networks - when the user clicks on an item, the canvas moves to put the selected node into the center of the screen. I also fancied a right hand toolbar as an homage to the venerable &lt;a href="http://www.3drender.com/sunday/images2/ConscienceScreen.jpg"&gt;SoftImage&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;Next step is to add some example networks to show off the power of Flint particles, and then to start playing with 3D.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://flexmonkey.co.uk/flintparticlelabrelease/flintparticlelab.html"&gt;ParticleLab is available here&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;simon gladman&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/17393483-1794430888633713608?l=flexmonkey.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://flexmonkey.blogspot.com/feeds/1794430888633713608/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=17393483&amp;postID=1794430888633713608' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/17393483/posts/default/1794430888633713608'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/17393483/posts/default/1794430888633713608'/><link rel='alternate' type='text/html' href='http://flexmonkey.blogspot.com/2009/01/particlelab-flex-particle-editor.html' title='ParticleLab - Flex Particle Editor Continued'/><author><name>Simon Gladman</name><uri>http://www.blogger.com/profile/17449788450837731883</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='28' height='32' src='http://4.bp.blogspot.com/_FGrZThm5JBo/TQ8ZMdgNEUI/AAAAAAAACy4/WGeOchj5VWk/S220/simon_venice.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_FGrZThm5JBo/SXh43rdWAgI/AAAAAAAAAiA/-iSzb5OokXg/s72-c/particleLab.png' height='72' width='72'/><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-17393483.post-2147402178655431842</id><published>2009-01-18T22:37:00.000-08:00</published><updated>2009-01-18T23:37:07.995-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='particles'/><category scheme='http://www.blogger.com/atom/ns#' term='ActionScript'/><category scheme='http://www.blogger.com/atom/ns#' term='node based interface'/><category scheme='http://www.blogger.com/atom/ns#' term='Flex'/><category scheme='http://www.blogger.com/atom/ns#' term='flint'/><title type='text'>ParticleLab - Node Based Particle System Editor</title><content type='html'>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://flexmonkey.co.uk/flintparticlelabrelease/flintparticlelab.html#"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 195px;" src="http://1.bp.blogspot.com/_FGrZThm5JBo/SXQjsyertpI/AAAAAAAAAhQ/rYVdcpO3_QM/s400/particlelab.jpg" alt="" id="BLOGGER_PHOTO_ID_5292894714438858386" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;A long time ago when I was working in 3D with applications like Maya and XSI, I spent many a happy hour tinkering with particle systems. Particle systems allow animators to create effects such as smoke and liquids by creating many individual particles affected by forces such as gravity.&lt;br /&gt;&lt;br /&gt;I've extended my Flex node based interface code to create an application to create scenes that use the excellent &lt;a href="http://flintparticles.org/"&gt;Flint Particle System&lt;/a&gt;. Far from finished, you can see my work in progress &lt;a href="http://flexmonkey.co.uk/flintparticlelabrelease/flintparticlelab.html"&gt;here&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;On opening the application, you're presented with a default particle scene - an emitter with some basic properties, but tied to an 'approach neighbors' action. If you press 'start', the emitter starts playing and the action draws the particles to themselves.&lt;br /&gt;&lt;br /&gt;I've plugged in a good variety of Flint objects to play with. What's really missing is an editor node for the different position zones. Right now, you're stuck with fixed emitters either in a point, a box or a disc.&lt;br /&gt;&lt;br /&gt;My first criticism of my work to date is that you need to many nodes to get particles doing anything of interest. At the minimum, you need an emitter, a 'move' action and a 'position' initializer. This isn't a fault of Flint itself, rather I can resolve it by creating a new emitter node that comes with the fundamentals built in.&lt;br /&gt;&lt;br /&gt;As a point of interest, I didn't hand code each editor UI for each different node type. Flex contains the supremely useful &lt;span style="font-style: italic;"&gt;describeType() &lt;/span&gt;method which returns an XML object that contains an object's properties. Using that XML, I build the UI dynamically. This makes adding new Flint objects child's play.&lt;br /&gt;&lt;br /&gt;A note on color coding: I wanted to differentiate between different node types with color. Since I'm pretty color blind myself, I tried to use fairly distinct colors but after a while I started to get confused too. Last night I added some code that disables nodes during the relationship build state (i.e. when you start a drag from an output semi-circle) and that, IMHO, makes it clear what can link to what.&lt;br /&gt;&lt;br /&gt;Once again, &lt;a href="http://flexmonkey.co.uk/flintparticlelabrelease/flintparticlelab.html"&gt;the application is available here&lt;/a&gt; - enjoy!&lt;br /&gt;&lt;br /&gt;simon gladman&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/17393483-2147402178655431842?l=flexmonkey.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://flexmonkey.blogspot.com/feeds/2147402178655431842/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=17393483&amp;postID=2147402178655431842' title='10 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/17393483/posts/default/2147402178655431842'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/17393483/posts/default/2147402178655431842'/><link rel='alternate' type='text/html' href='http://flexmonkey.blogspot.com/2009/01/particlelab-node-based-particle-system.html' title='ParticleLab - Node Based Particle System Editor'/><author><name>Simon Gladman</name><uri>http://www.blogger.com/profile/17449788450837731883</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='28' height='32' src='http://4.bp.blogspot.com/_FGrZThm5JBo/TQ8ZMdgNEUI/AAAAAAAACy4/WGeOchj5VWk/S220/simon_venice.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_FGrZThm5JBo/SXQjsyertpI/AAAAAAAAAhQ/rYVdcpO3_QM/s72-c/particlelab.jpg' height='72' width='72'/><thr:total>10</thr:total></entry><entry><id>tag:blogger.com,1999:blog-17393483.post-7902634696223908076</id><published>2009-01-06T00:44:00.000-08:00</published><updated>2009-01-06T01:11:11.606-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Senocular'/><category scheme='http://www.blogger.com/atom/ns#' term='ActionScript'/><category scheme='http://www.blogger.com/atom/ns#' term='Flex'/><category scheme='http://www.blogger.com/atom/ns#' term='Scalextric'/><title type='text'>Scalextric in Flex - Prototype Components for Slot Car Racing</title><content type='html'>&lt;a href="http://4.bp.blogspot.com/_FGrZThm5JBo/SWMaMdzVpMI/AAAAAAAAAd8/1YWkd_N-rtI/s1600-h/slotcar.png"&gt;&lt;img id="BLOGGER_PHOTO_ID_5288099188923802818" style="DISPLAY: block; MARGIN: 0px auto 10px; WIDTH: 318px; CURSOR: hand; HEIGHT: 320px; TEXT-ALIGN: center" alt="" src="http://4.bp.blogspot.com/_FGrZThm5JBo/SWMaMdzVpMI/AAAAAAAAAd8/1YWkd_N-rtI/s320/slotcar.png" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Over the Christmas break I started developing the beginnings of a &lt;a href="http://www.scalextric.com/"&gt;Scalextric&lt;/a&gt; style game in Flex. Although the game is nowhere near playable, the two main classes are pretty much working and if you're thinking of doing a similar style game, some of this code may be useful to you.&lt;br /&gt;&lt;br&gt;The view class is &lt;em&gt;TrackRenderer&lt;/em&gt; - it renders a &lt;em&gt;TrackScene&lt;/em&gt; object and if its &lt;em&gt;isRunning&lt;/em&gt; property is set to false it acts as an editor widget. When you first launch my demo, the &lt;em&gt;TrackScene&lt;/em&gt; is empty, by clicking on the renderer you can start adding vertices. The first track segment has to be vertical or horizontal, but subsequent sections can be at 45 degrees and create an arc.&lt;br /&gt;&lt;br&gt;The scene is bound to the renderer, so there's no additonal ActionScript when adding and removing vertices or when positioning the car.&lt;br /&gt;&lt;br&gt;There are a whole load of rules in &lt;em&gt;TrackScene&lt;/em&gt; that define what makes a legal vertex. The renderer displays a green circle on legal targets and red on illegal. In a nutshell, you can create smooth transitions between arcs and lines.&lt;br /&gt;&lt;br&gt;Once you have defined a path through a set of vertices, set the velocity in the numeric stepper at the top of the page and click the 'race' button to send your little car icon around the track. I've used some code from &lt;a href="http://www.senocular.com/"&gt;Senocular&lt;/a&gt; to follow the path.&lt;br /&gt;&lt;br&gt;There's no crash code yet - but the scene has a &lt;em&gt;followVertexIndex&lt;/em&gt; property which indicates the next vertex index that the car is at and it exposes its &lt;em&gt;trackVertexCollection&lt;/em&gt;. With that information, you can compare the car's speed against the radius of the current segment and decide that the car needs to fly off the track.&lt;br&gt;&lt;br /&gt;The &lt;a href="http://flexmonkey.co.uk/SlotCar/SlotCar.html"&gt;demo is available here&lt;/a&gt; and the &lt;a href="http://flexmonkey.co.uk/SlotCar/srcview/index.html"&gt;source code is here&lt;/a&gt;.&lt;br /&gt;&lt;br&gt;I'm about to move on to a &lt;a href="http://flintparticles.org/"&gt;Flint Particles &lt;/a&gt;project, so this code may be on a back burner for a while, but if you use it, I'd love to see the results.&lt;br /&gt;&lt;br&gt;simon gladman&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/17393483-7902634696223908076?l=flexmonkey.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://flexmonkey.blogspot.com/feeds/7902634696223908076/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=17393483&amp;postID=7902634696223908076' title='6 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/17393483/posts/default/7902634696223908076'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/17393483/posts/default/7902634696223908076'/><link rel='alternate' type='text/html' href='http://flexmonkey.blogspot.com/2009/01/scalextric-in-flex-prototype-components.html' title='Scalextric in Flex - Prototype Components for Slot Car Racing'/><author><name>Simon Gladman</name><uri>http://www.blogger.com/profile/17449788450837731883</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='28' height='32' src='http://4.bp.blogspot.com/_FGrZThm5JBo/TQ8ZMdgNEUI/AAAAAAAACy4/WGeOchj5VWk/S220/simon_venice.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_FGrZThm5JBo/SWMaMdzVpMI/AAAAAAAAAd8/1YWkd_N-rtI/s72-c/slotcar.png' height='72' width='72'/><thr:total>6</thr:total></entry><entry><id>tag:blogger.com,1999:blog-17393483.post-5335012913331025204</id><published>2008-12-19T00:23:00.001-08:00</published><updated>2011-08-25T12:42:29.971-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='gumbo'/><category scheme='http://www.blogger.com/atom/ns#' term='dynamic audio'/><category scheme='http://www.blogger.com/atom/ns#' term='flash player 10'/><category scheme='http://www.blogger.com/atom/ns#' term='sound synthesis'/><title type='text'>Born to Synthesise – Sound Synthesis in Flash Player 10</title><content type='html'>&lt;a href="http://2.bp.blogspot.com/_FGrZThm5JBo/SUtaIOiE9yI/AAAAAAAAAdU/CVd-kt3gUVA/s1600-h/synth.PNG"&gt;&lt;span style="color: white;"&gt;&lt;img alt="" border="0" id="BLOGGER_PHOTO_ID_5281414085408519970" src="http://2.bp.blogspot.com/_FGrZThm5JBo/SUtaIOiE9yI/AAAAAAAAAdU/CVd-kt3gUVA/s400/synth.PNG" style="cursor: hand; display: block; height: 251px; margin: 0px auto 10px; text-align: center; width: 400px;" /&gt;&lt;/span&gt;&lt;/a&gt;&lt;span style="color: white;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;div&gt;&lt;div class="MsoNormal"&gt;&lt;span style="color: white;"&gt;One of the new features of Flash Player 10 is dynamic sound generation or sound synthesis, which is the ability to write directly to the Sound object and create audio from scratch.&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;o:p&gt;&lt;span style="color: white;"&gt;&lt;/span&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;span style="color: white;"&gt;This is a very easy process – in a nutshell, you need to create an event handler for the Sound object’s &lt;b style="mso-bidi-font-weight: normal;"&gt;&lt;i style="mso-bidi-font-style: normal;"&gt;SampleDataEvent.SAMPLE_DATA&lt;/i&gt;&lt;/b&gt; event which returns the wave form. This could be a basic sine wave based on a combination of the event’s position property and a loop of up to 8192 samples. &lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;o:p&gt;&lt;span style="color: white;"&gt;&lt;/span&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;span style="color: white;"&gt;Why 8192 samples? Well, the Flash Player samples audio at the same rate as an audio CD – 44.1k samples per second, and we need to supply a sample to each channel (left and right) which gives us 8192.&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;o:p&gt;&lt;span style="color: white;"&gt;&lt;/span&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;span style="color: white;"&gt;So a basic sine wave function could look something like this:&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;o:p&gt;&lt;span style="color: white;"&gt;&lt;/span&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;span class="Apple-style-span" style="color: white; font-family: 'courier new'; font-size: 85%;"&gt;Math.sin((Number(position)/Math.PI/4 * frequency))* volume&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;o:p&gt;&lt;span style="color: white;"&gt;&lt;/span&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;span style="color: white;"&gt;Where the &lt;i style="mso-bidi-font-style: normal;"&gt;position&lt;/i&gt; is the sum of the &lt;b style="mso-bidi-font-weight: normal;"&gt;&lt;i style="mso-bidi-font-style: normal;"&gt;SampleDataEvent.position&lt;/i&gt;&lt;/b&gt; and our loop counter.&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;o:p&gt;&lt;span style="color: white;"&gt;&lt;/span&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;span style="color: white;"&gt;We can also use the sin function to approximate a square wave using a Fourier series:&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;o:p&gt;&lt;span style="color: white;"&gt;&lt;/span&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="mso-layout-grid-align: none;"&gt;&lt;span style="font-family: 'courier new';"&gt;&lt;span style="color: white;"&gt;&lt;span style="font-size: 85%;"&gt;&lt;b&gt;var&lt;/b&gt; square:Number=Math.sin((Number(position)/Math.PI/2 * frequency)) +&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="mso-layout-grid-align: none;"&gt;&lt;span style="font-family: 'courier new';"&gt;&lt;span style="color: white; font-size: 85%;"&gt;(Math.sin((Number(position)/Math.PI/4 * frequency * 3)) / 3) +&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="mso-layout-grid-align: none;"&gt;&lt;span style="font-family: 'courier new';"&gt;&lt;span style="color: white; font-size: 85%;"&gt;(Math.sin((Number(position)/Math.PI/4 * frequency * 5)) / 5) +&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="mso-layout-grid-align: none;"&gt;&lt;span style="font-family: 'courier new';"&gt;&lt;span style="color: white; font-size: 85%;"&gt;(Math.sin((Number(position)/Math.PI/4 * frequency * 7)) / 7) +&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="mso-layout-grid-align: none;"&gt;&lt;span style="font-family: 'courier new';"&gt;&lt;span style="color: white; font-size: 85%;"&gt;(Math.sin((Number(position)/Math.PI/4 * frequency * 9)) / 9) +&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="mso-layout-grid-align: none;"&gt;&lt;span style="font-family: 'courier new';"&gt;&lt;span style="color: white; font-size: 85%;"&gt;(Math.sin((Number(position)/Math.PI/4 * frequency * 11)) / 11) +&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="mso-layout-grid-align: none;"&gt;&lt;span style="font-family: 'courier new';"&gt;&lt;span style="color: white; font-size: 85%;"&gt;(Math.sin((Number(position)/Math.PI/4 * frequency * 13)) / 13) +&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;span class="Apple-style-span" style="font-family: 'courier new'; font-size: small;"&gt;&lt;/span&gt;&lt;span style="color: white;"&gt;&lt;span style="font-size: 85%;"&gt;&lt;span style="font-family: 'courier new';"&gt;(Math.sin((Number(position)/Math.PI/4 * &lt;span style="font-family: 'courier new';"&gt;frequency&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: 'courier new';"&gt; * 15)) / 15)&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;o:p&gt;&lt;span class="Apple-style-span" style="color: white; font-size: small;"&gt;&lt;/span&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;span style="color: white;"&gt;Fourier taught us that any possible waveform can be synthesized from a sum of sine waves, so my rough and ready demo offers four separate sound channels that have independent frequency and amplitude sliders that sum together to create the sound.&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;o:p&gt;&lt;span style="color: white;"&gt;&lt;/span&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;span style="color: white;"&gt;It’s not exactly MVC, but in my demo each &lt;b style="mso-bidi-font-weight: normal;"&gt;&lt;i style="mso-bidi-font-style: normal;"&gt;ChannelEditor&lt;/i&gt;&lt;/b&gt; class is responsible for calculating its own value for any given position. The main class, &lt;b style="mso-bidi-font-weight: normal;"&gt;&lt;i style="mso-bidi-font-style: normal;"&gt;FlexMonkeySynth&lt;/i&gt;&lt;/b&gt;, sums each of the four values and supplies that to the event handler.&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;o:p&gt;&lt;span style="color: white;"&gt;&lt;/span&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;a href="http://flexmonkey.co.uk/FlexMonkeySynth/FlexMonkeySynth.html"&gt;&lt;span style="color: #ccccff;"&gt;Have a play&lt;/span&gt;&lt;/a&gt;&lt;span style="color: white;"&gt; – the top slider for each channel controls the frequency and the lower controls the amplitude. The radio buttons allow you to select between a square and a sine wave. Of course, the &lt;/span&gt;&lt;a href="http://flexmonkey.co.uk/FlexMonkeySynth/srcview/index.html"&gt;&lt;span style="color: #ccccff;"&gt;source code is enabled&lt;/span&gt;&lt;/a&gt;&lt;span style="color: #ccccff;"&gt;.&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;o:p&gt;&lt;span style="color: white;"&gt;&lt;/span&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;span style="color: white;"&gt;The skin comes from &lt;/span&gt;&lt;a href="http://bkflex.wordpress.com/"&gt;&lt;span style="color: white;"&gt;Bhavin Padhiyar&lt;/span&gt;&lt;/a&gt;&lt;span style="color: white;"&gt; and is available on &lt;/span&gt;&lt;a href="http://scalenine.com/themes/machine/Machine.html#"&gt;&lt;span style="color: #ffccff;"&gt;http://scalenine.com/themes/machine/Machine.html#&lt;/span&gt;&lt;/a&gt;&lt;span style="color: white;"&gt;.&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;o:p&gt;&lt;span style="color: white;"&gt;&lt;/span&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/17393483-5335012913331025204?l=flexmonkey.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://flexmonkey.blogspot.com/feeds/5335012913331025204/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=17393483&amp;postID=5335012913331025204' title='5 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/17393483/posts/default/5335012913331025204'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/17393483/posts/default/5335012913331025204'/><link rel='alternate' type='text/html' href='http://flexmonkey.blogspot.com/2008/12/born-to-synthesise-sound-synthesis-in.html' title='Born to Synthesise – Sound Synthesis in Flash Player 10'/><author><name>Simon Gladman</name><uri>http://www.blogger.com/profile/17449788450837731883</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='28' height='32' src='http://4.bp.blogspot.com/_FGrZThm5JBo/TQ8ZMdgNEUI/AAAAAAAACy4/WGeOchj5VWk/S220/simon_venice.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_FGrZThm5JBo/SUtaIOiE9yI/AAAAAAAAAdU/CVd-kt3gUVA/s72-c/synth.PNG' height='72' width='72'/><thr:total>5</thr:total></entry><entry><id>tag:blogger.com,1999:blog-17393483.post-6958922089626776447</id><published>2008-12-17T01:15:00.000-08:00</published><updated>2008-12-17T01:30:16.875-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='PixelBender'/><category scheme='http://www.blogger.com/atom/ns#' term='node based interface'/><category scheme='http://www.blogger.com/atom/ns#' term='Flex'/><title type='text'>Pixel Bender Blender - Now Supports Array Inputs</title><content type='html'>&lt;a href="http://flexmonkey.co.uk/shaderEditor_dec_17/NodeRenderer.html"&gt;&lt;img id="BLOGGER_PHOTO_ID_5280685371273373170" style="DISPLAY: block; MARGIN: 0px auto 10px; WIDTH: 400px; CURSOR: hand; HEIGHT: 320px; TEXT-ALIGN: center" alt="" src="http://1.bp.blogspot.com/_FGrZThm5JBo/SUjDXe1Z5fI/AAAAAAAAAcw/ICfRHdmNz2k/s400/PixelBenderBlender_3.png" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;div&gt;My &lt;a href="http://flexmonkey.co.uk/shaderEditor_dec_17/NodeRenderer.html"&gt;Flex and Pixel Bender node-based image editor &lt;/a&gt;moves onwards and upwards. &lt;/div&gt;&lt;div&gt; &lt;/div&gt;&lt;div&gt;&lt;br&gt;I now have a new input widget that generates any number of numeric steppers to allow users to input float&lt;em&gt;x&lt;/em&gt; and int&lt;em&gt;x&lt;/em&gt; types. This has allowed me to plug in a few more shaders, such as ripple blocks, that use these types.&lt;/div&gt;&lt;div&gt;  &lt;/div&gt;&lt;div&gt; &lt;/div&gt;&lt;div&gt;&lt;br&gt;I also wrote an extension to the node renderer canvas to allow drag scrolling - complete with a little grippy hand, and popped in a fade effect when creating new shader editors.&lt;/div&gt;&lt;div&gt;  &lt;/div&gt;&lt;div&gt; &lt;/div&gt;&lt;div&gt;&lt;br&gt;Enjoy!&lt;/div&gt;&lt;div&gt; &lt;/div&gt;&lt;div&gt; &lt;/div&gt;&lt;div&gt;&lt;br&gt;simon gladman&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/17393483-6958922089626776447?l=flexmonkey.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://flexmonkey.blogspot.com/feeds/6958922089626776447/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=17393483&amp;postID=6958922089626776447' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/17393483/posts/default/6958922089626776447'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/17393483/posts/default/6958922089626776447'/><link rel='alternate' type='text/html' href='http://flexmonkey.blogspot.com/2008/12/pixel-bender-blender-now-supports-array.html' title='Pixel Bender Blender - Now Supports Array Inputs'/><author><name>Simon Gladman</name><uri>http://www.blogger.com/profile/17449788450837731883</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='28' height='32' src='http://4.bp.blogspot.com/_FGrZThm5JBo/TQ8ZMdgNEUI/AAAAAAAACy4/WGeOchj5VWk/S220/simon_venice.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_FGrZThm5JBo/SUjDXe1Z5fI/AAAAAAAAAcw/ICfRHdmNz2k/s72-c/PixelBenderBlender_3.png' height='72' width='72'/><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-17393483.post-7216520615014753285</id><published>2008-12-15T00:21:00.000-08:00</published><updated>2008-12-15T00:39:45.222-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='PixelBender'/><category scheme='http://www.blogger.com/atom/ns#' term='node based interface'/><category scheme='http://www.blogger.com/atom/ns#' term='Flex'/><title type='text'>Pixel Bender Blender - Working Prototype</title><content type='html'>&lt;a href="http://flexmonkey.co.uk/shaderEditor_dec_15/NodeRenderer.html"&gt;&lt;img id="BLOGGER_PHOTO_ID_5279929326350760882" style="DISPLAY: block; MARGIN: 0px auto 10px; WIDTH: 400px; CURSOR: hand; HEIGHT: 320px; TEXT-ALIGN: center" alt="" src="http://1.bp.blogspot.com/_FGrZThm5JBo/SUYTv4BN-7I/AAAAAAAAAco/7WKGUZ14z38/s400/PixelBenderBlender_2.png" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;div&gt;I had a great weekend working on my Pixel Bender Blender application. The &lt;span class="blsp-spelling-corrected" id="SPELLING_ERROR_0"&gt;fundaments&lt;/span&gt; of the user interface are working - you can add (by clicking a node type in the left hand toolbar) and delete &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_1"&gt;shader&lt;/span&gt; nodes, and by dragging from the output of one into the input of another, you can create relationships.&lt;/div&gt;&lt;div&gt; &lt;/div&gt;&lt;div&gt; &lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;The next things on my list are to use &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_2"&gt;FP&lt;/span&gt;10's file access features to allow uploading of images (right now, I've embedded three sample images to play with) and to support the &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_3"&gt;PixelBender&lt;/span&gt; float&lt;em&gt;x &lt;/em&gt;type - where the variable is an array of &lt;em&gt;x&lt;/em&gt; float values.&lt;/div&gt;&lt;div&gt; &lt;/div&gt;&lt;div&gt; &lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;I'm a big fan of &lt;a href="http://en.wikipedia.org/wiki/Gill_Sans"&gt;Gill Sans&lt;/a&gt; - one of the world's most beautiful fonts, and using this as the application font gives it a nice &lt;span class="blsp-spelling-corrected" id="SPELLING_ERROR_4"&gt;authoritative&lt;/span&gt; yet arty feel.&lt;/div&gt;&lt;div&gt; &lt;/div&gt;&lt;div&gt; &lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;&lt;a href="http://flexmonkey.co.uk/shaderEditor_dec_15/NodeRenderer.html"&gt;The prototype is available here&lt;/a&gt;.&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/17393483-7216520615014753285?l=flexmonkey.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://flexmonkey.blogspot.com/feeds/7216520615014753285/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=17393483&amp;postID=7216520615014753285' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/17393483/posts/default/7216520615014753285'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/17393483/posts/default/7216520615014753285'/><link rel='alternate' type='text/html' href='http://flexmonkey.blogspot.com/2008/12/pixel-bender-blender-working-prototype.html' title='Pixel Bender Blender - Working Prototype'/><author><name>Simon Gladman</name><uri>http://www.blogger.com/profile/17449788450837731883</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='28' height='32' src='http://4.bp.blogspot.com/_FGrZThm5JBo/TQ8ZMdgNEUI/AAAAAAAACy4/WGeOchj5VWk/S220/simon_venice.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_FGrZThm5JBo/SUYTv4BN-7I/AAAAAAAAAco/7WKGUZ14z38/s72-c/PixelBenderBlender_2.png' height='72' width='72'/><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-17393483.post-3868084688618014542</id><published>2008-12-11T10:14:00.000-08:00</published><updated>2008-12-11T10:32:06.348-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='PixelBender'/><category scheme='http://www.blogger.com/atom/ns#' term='node based interface'/><category scheme='http://www.blogger.com/atom/ns#' term='Flex'/><title type='text'>Pixel Bender Blender - Proof of Concept</title><content type='html'>&lt;a href="http://flexmonkey.co.uk/shaderEditor_dec_11/NodeRenderer.html"&gt;&lt;img id="BLOGGER_PHOTO_ID_5278597700545933682" style="DISPLAY: block; MARGIN: 0px auto 10px; WIDTH: 400px; CURSOR: hand; HEIGHT: 235px; TEXT-ALIGN: center" alt="" src="http://3.bp.blogspot.com/_FGrZThm5JBo/SUFYpDU78XI/AAAAAAAAAcg/_68iYOxu9_Y/s400/PixelBenderBlender.png" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;After a few hours of work, I managed to plug in my Pixel Bender experiments into my node based user interface. &lt;a href="http://flexmonkey.co.uk/shaderEditor_dec_11/NodeRenderer.html"&gt;Here is the proof of concept &lt;/a&gt;- nowhere near finished, but a very exciting milestone.&lt;br /&gt;&lt;br /&gt;Give it a go: you can set the &lt;em&gt;dimension&lt;/em&gt; parameter on the Pixelate node to something like 20. Then set the Twirl's &lt;em&gt;radius&lt;/em&gt; to 100. Finally, the Crossfade node can be switched between 0 and 1 to fade between the output of the Pixelate and the output of the Twirl.&lt;br /&gt;&lt;br /&gt;Of course, there's a million miles to go, but I couldn't resist posting this first proof of concept for your enjoyment.&lt;br /&gt;&lt;br /&gt;simon gladman&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/17393483-3868084688618014542?l=flexmonkey.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://flexmonkey.blogspot.com/feeds/3868084688618014542/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=17393483&amp;postID=3868084688618014542' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/17393483/posts/default/3868084688618014542'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/17393483/posts/default/3868084688618014542'/><link rel='alternate' type='text/html' href='http://flexmonkey.blogspot.com/2008/12/pixel-bender-blender-proof-of-concept.html' title='Pixel Bender Blender - Proof of Concept'/><author><name>Simon Gladman</name><uri>http://www.blogger.com/profile/17449788450837731883</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='28' height='32' src='http://4.bp.blogspot.com/_FGrZThm5JBo/TQ8ZMdgNEUI/AAAAAAAACy4/WGeOchj5VWk/S220/simon_venice.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_FGrZThm5JBo/SUFYpDU78XI/AAAAAAAAAcg/_68iYOxu9_Y/s72-c/PixelBenderBlender.png' height='72' width='72'/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-17393483.post-7962178260005473922</id><published>2008-12-06T23:28:00.001-08:00</published><updated>2008-12-07T07:45:14.592-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ShaderInput'/><category scheme='http://www.blogger.com/atom/ns#' term='ActionScript'/><category scheme='http://www.blogger.com/atom/ns#' term='PixelBender'/><category scheme='http://www.blogger.com/atom/ns#' term='ShaderJob'/><category scheme='http://www.blogger.com/atom/ns#' term='Mate'/><category scheme='http://www.blogger.com/atom/ns#' term='Flex'/><title type='text'>Further Adventures With Pixel Bender</title><content type='html'>In my quest to create a node based image editor using PixelBender, I've been been tidying up my PixelBender classes in preparation for plugging them into my &lt;a href="http://flexmonkey.blogspot.com/2008/10/flex-node-based-calculator-now-renders.html"&gt;existing node based user interface&lt;/a&gt;. &lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;I'm spending a few weeks in a very sunny Cape Town working with our SA development team. Because spending the evening eating great sea food and drinking gin and tonics basking in the setting sun is ever so slightly more tempting that coding Flex in my hotel room, progress has been a little slow. However, I'm back home to London next week, and the cold will drive me back to eveing coding.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Anyway, I digress. The latest version of my PixelBender adventures are &lt;a href="http://flexmonkey.co.uk/shaderEditor_dec_7/gumbo.html"&gt;here&lt;/a&gt;. The ugly, prototype user interface is pretty much the same, but if you &lt;a href="http://flexmonkey.co.uk/shaderEditor_dec_7/srcview/index.html"&gt;view the source&lt;/a&gt;, you'll see plenty of changes under the hood.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;The creation and use of &lt;span class="Apple-style-span" style="font-style: italic;"&gt;ShaderNodes &lt;/span&gt;and &lt;span class="Apple-style-span" style="font-style: italic;"&gt;ShaderEditors &lt;/span&gt;is now far simpler. &lt;span class="Apple-style-span" style="font-style: italic;"&gt;gumbo.mxml&lt;/span&gt; - which is essentially my controller - creates a handful of &lt;span class="Apple-style-span" style="font-style: italic;"&gt;ShaderNodes&lt;/span&gt;, links them to the editor user interface components and a single change handler handles user input events.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;The&lt;span class="Apple-style-span" style="font-style: italic;"&gt; ShaderEditor &lt;/span&gt;class contains the dynamically created input widgets and the image of the input with that editor's node's output.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;The &lt;span class="Apple-style-span" style="font-style: italic;"&gt;ShaderNode&lt;/span&gt; class uses Flex's &lt;span class="Apple-style-span" style="font-style: italic;"&gt;BindingUtils &lt;/span&gt;class to keep an eye on its inputs. When an input changes, it executes itself, which in turn will change its output and the event bubbles through the linked nodes.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Now the code is getting a little more complex, my own DIY framework - or lack of, isn't really working. I've used Cairngorm in projects in the past, including my &lt;a href="http://www.flexmonkey.co.uk/WatchFaceBuilder/WatchFaceBuilder.html"&gt;horological CAD application&lt;/a&gt;. However, I'm always keen to try something new, so I'm going to port my code to &lt;a href="http://mate.asfusion.com/"&gt;Mate &lt;/a&gt;when before I put a fancy user interface on my code.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;simon gladman&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/17393483-7962178260005473922?l=flexmonkey.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://flexmonkey.blogspot.com/feeds/7962178260005473922/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=17393483&amp;postID=7962178260005473922' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/17393483/posts/default/7962178260005473922'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/17393483/posts/default/7962178260005473922'/><link rel='alternate' type='text/html' href='http://flexmonkey.blogspot.com/2008/12/further-adventures-with-pixel-bender.html' title='Further Adventures With Pixel Bender'/><author><name>Simon Gladman</name><uri>http://www.blogger.com/profile/17449788450837731883</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='28' height='32' src='http://4.bp.blogspot.com/_FGrZThm5JBo/TQ8ZMdgNEUI/AAAAAAAACy4/WGeOchj5VWk/S220/simon_venice.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-17393483.post-4979912268161828405</id><published>2008-11-28T06:21:00.000-08:00</published><updated>2008-11-28T06:38:54.429-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ActionScript'/><category scheme='http://www.blogger.com/atom/ns#' term='PixelBender'/><category scheme='http://www.blogger.com/atom/ns#' term='Flex'/><title type='text'>A PixelBender Editor Class</title><content type='html'>To extend my experiments with PixelBender, I created a new class to compliment my &lt;em&gt;ShaderNode&lt;/em&gt; class - &lt;em&gt;ShaderEditor&lt;/em&gt;. An instance of a &lt;em&gt;ShaderEditor &lt;/em&gt;class accepts a &lt;em&gt;ShaderNode&lt;/em&gt; and dispatches &lt;em&gt;ShaderEditorChangeEvents&lt;/em&gt;. It is the user interface component that allows a user to set the parameters of a PixelBender object.&lt;br /&gt;&lt;br /&gt;When the ShaderEditor's &lt;em&gt;shaderNode&lt;/em&gt; is set, I loop through the parameters and create input fields that happen to have the same names as those parameters. The input boxes dispatch &lt;em&gt;ShaderEditorChangeEvent&lt;/em&gt; events on each change.&lt;br /&gt;&lt;br /&gt;The &lt;em&gt;ShaderEditorChangeEvent &lt;/em&gt;contains the parameter name and the new value, and &lt;em&gt;ShaderNode&lt;/em&gt; now has a new method &lt;em&gt;setParameterByName(),&lt;/em&gt; so an event handler should look something like this:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;font-size:85%;"&gt;private function shaderChangeHandler(event:ShaderEditorChangeEvent):void&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;font-size:85%;"&gt;{&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;font-size:85%;"&gt;    ShaderEditor(event.target).shaderNode.setParameterByName(event.shaderParameterName, event.shaderParameterValue)&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;font-size:85%;"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;This demo is fugly and there is no validation, but it is a great proof of concept. It daisy chains a pixelate, smudge and twirl together - the twirl is proof that my editors can handle more than one parameter. &lt;a href="http://flexmonkey.co.uk/shaderEditor-release/gumbo.html"&gt;Here's the demo &lt;/a&gt;- with source code enabled.&lt;br /&gt;&lt;br /&gt;simon gladman&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/17393483-4979912268161828405?l=flexmonkey.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://flexmonkey.blogspot.com/feeds/4979912268161828405/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=17393483&amp;postID=4979912268161828405' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/17393483/posts/default/4979912268161828405'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/17393483/posts/default/4979912268161828405'/><link rel='alternate' type='text/html' href='http://flexmonkey.blogspot.com/2008/11/pixelbender-editor-class.html' title='A PixelBender Editor Class'/><author><name>Simon Gladman</name><uri>http://www.blogger.com/profile/17449788450837731883</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='28' height='32' src='http://4.bp.blogspot.com/_FGrZThm5JBo/TQ8ZMdgNEUI/AAAAAAAACy4/WGeOchj5VWk/S220/simon_venice.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-17393483.post-903067843221834367</id><published>2008-11-26T04:58:00.000-08:00</published><updated>2008-11-26T05:07:21.681-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ShaderInput'/><category scheme='http://www.blogger.com/atom/ns#' term='ActionScript'/><category scheme='http://www.blogger.com/atom/ns#' term='PixelBender'/><category scheme='http://www.blogger.com/atom/ns#' term='ShaderParameter'/><category scheme='http://www.blogger.com/atom/ns#' term='ShaderJob'/><category scheme='http://www.blogger.com/atom/ns#' term='Flex'/><title type='text'>Encapsulating and Abstracting PixelBender Shaders</title><content type='html'>Following on from yesterday's experiments with &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_0"&gt;ShaderJobs&lt;/span&gt;, I've created a new class that abstracts &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_1"&gt;PixelBender&lt;/span&gt; &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_2"&gt;shaders&lt;/span&gt; and allows easy access to their inputs, outputs and parameters. Although not finished yet, I thought I'd document my work in progress.&lt;br /&gt;&lt;br /&gt;My new class is called &lt;em&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_3"&gt;ShaderNode&lt;/span&gt;&lt;/em&gt;. It accepts an embedded .&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_4"&gt;pbj&lt;/span&gt; class in its constructor, like this:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;&lt;span style="font-size:85%;"&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_5"&gt;pixelateShaderNode&lt;/span&gt;=new &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_6"&gt;ShaderNode&lt;/span&gt;(&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_7"&gt;PixelateClass&lt;/span&gt;)&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;The class figures out how many inputs and parameters it has, and in &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_8"&gt;ActionScript&lt;/span&gt; you can set both using the input or parameter's index, for example:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;&lt;span style="font-size:85%;"&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_9"&gt;pixelateShaderNode&lt;/span&gt;.&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_10"&gt;setInput&lt;/span&gt;(0, &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_11"&gt;bitmapData&lt;/span&gt;)&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;&lt;span style="font-size:85%;"&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_12"&gt;pixelateShaderNode&lt;/span&gt;.&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_13"&gt;setParameter&lt;/span&gt;(0, 25)&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Like a &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_14"&gt;shader&lt;/span&gt; job, you can execute the &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_15"&gt;ShaderJob&lt;/span&gt; &lt;span class="blsp-spelling-corrected" id="SPELLING_ERROR_16"&gt;synchronously&lt;/span&gt; or asynchronously using the execute() method:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;font-size:85%;"&gt;pixelateShaderNode.execute(true)&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;And of course, the output of one node can act as the input to another, so PixelBender filters can be daisychained together:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;font-size:85%;"&gt;smudgerShaderNode.setInput(0, pixelateShaderNode.output)&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;So, &lt;a href="http://flexmonkey.co.uk/shaderNode-release/gumbo.html"&gt;here's a rough and ready work in progress&lt;/a&gt; of a pixelate filter 'feeding' a smudger filter. You can see the source image at the left, pixelated in the middle and smudged on the right. There's no validation on the input numeric steppers and, of course, source code is enabled.&lt;br /&gt;&lt;br /&gt;simon gladman&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/17393483-903067843221834367?l=flexmonkey.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://flexmonkey.blogspot.com/feeds/903067843221834367/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=17393483&amp;postID=903067843221834367' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/17393483/posts/default/903067843221834367'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/17393483/posts/default/903067843221834367'/><link rel='alternate' type='text/html' href='http://flexmonkey.blogspot.com/2008/11/encapsulating-and-abstracting.html' title='Encapsulating and Abstracting PixelBender Shaders'/><author><name>Simon Gladman</name><uri>http://www.blogger.com/profile/17449788450837731883</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='28' height='32' src='http://4.bp.blogspot.com/_FGrZThm5JBo/TQ8ZMdgNEUI/AAAAAAAACy4/WGeOchj5VWk/S220/simon_venice.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-17393483.post-8251952721222640379</id><published>2008-11-25T01:05:00.001-08:00</published><updated>2008-11-25T01:40:38.842-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ShaderInput'/><category scheme='http://www.blogger.com/atom/ns#' term='ActionScript'/><category scheme='http://www.blogger.com/atom/ns#' term='PixelBender'/><category scheme='http://www.blogger.com/atom/ns#' term='ShaderParameter'/><category scheme='http://www.blogger.com/atom/ns#' term='ShaderJob'/><category scheme='http://www.blogger.com/atom/ns#' term='Flex'/><title type='text'>Quick Tutorial on PixelBender ShaderJobs</title><content type='html'>&lt;span style="font-family:georgia;"&gt;I've been playing with &lt;em&gt;PixelBender&lt;/em&gt; filters on my journey to create a node based image editor in Flex (hmmm - although the clever people at Aviary have beaten me to it with their amazing &lt;/span&gt;&lt;a href="http://aviary.com/tools/peacock"&gt;&lt;span style="font-family:georgia;"&gt;Peakcock &lt;/span&gt;&lt;/a&gt;&lt;span style="font-family:georgia;"&gt;application).&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:georgia;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:georgia;"&gt;I wrestled with ShaderJobs for a while, and after some help from BrianRonan on the Adobe forums, managed to get them working last night. It's a little tricky, so here's a summary if you're having problems.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:georgia;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:georgia;"&gt;A ShaderJob needs a shader. In my example, I embed the shader using this syntax:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;font-size:85%;"&gt;[Embed(source="pixelate.pbj", mimeType="application/octet-stream")]&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;font-size:85%;"&gt;var PixelateClass:Class;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:Courier New;font-size:85%;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:georgia;"&gt;...and assign the embedded PixelBender to an instance of the Shader class like this:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;font-size:85%;"&gt;var shader:Shader=new Shader()&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;font-size:85%;"&gt;shader.byteCode=new PixelateClass()&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Now, using an existing image component with an embedded image, I extract its BitmapData:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;font-size:85%;"&gt;var bitmapData:BitmapData=new BitmapData(sourceImage.width, sourceImage.height) &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;font-size:85%;"&gt;var matrix:Matrix=new Matrix() &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;font-size:85%;"&gt;bitmapData.draw(sourceImage, matrix)&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Here's where I got stuck: the pixelate filter requires an input and a parameter - the input will be our bitmapdata from above and the parameter some arbitrary value.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;font-size:85%;"&gt;ShaderInput(shader.data.inputImage).input=bitmapData&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;font-size:85%;"&gt;ShaderParameter(shader.data.dimension).value=[10]&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Now we have a shader with inputs and parameters, I assign that shader to a ShaderJob, give the ShaderJob an event handler (I'm running this asynchronously, so the event handler fires once the PixelBender has completed), and start the job:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;font-size:85%;"&gt;var job:ShaderJob = new ShaderJob(shader); &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;font-size:85%;"&gt;job.addEventListener(ShaderEvent.COMPLETE, completeHandler); &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;font-size:85%;"&gt;var jobResult:BitmapData = new BitmapData(sourceImage.width, sourceImage.height); &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;font-size:85%;"&gt;job.target = jobResult; &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;font-size:85%;"&gt;job.start(false)&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Finally, the event handler adds a bitmap that uses the PixelBender's output's BitmapData and we can see our pixelated image:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;font-size:85%;"&gt;var bitmapData:BitmapData=shaderEvent.bitmapData&lt;br /&gt;targetWidget.addChild(new Bitmap(bitmapData))&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://flexmonkey.co.uk/gumbo-release/gumbo.html"&gt;Here's a very simple demo&lt;/a&gt; with source code enabled.&lt;br /&gt;&lt;br /&gt;simon gladman&lt;br /&gt;&lt;span style="font-family:Courier New;font-size:85%;"&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/17393483-8251952721222640379?l=flexmonkey.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://flexmonkey.blogspot.com/feeds/8251952721222640379/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=17393483&amp;postID=8251952721222640379' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/17393483/posts/default/8251952721222640379'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/17393483/posts/default/8251952721222640379'/><link rel='alternate' type='text/html' href='http://flexmonkey.blogspot.com/2008/11/quick-tutorial-on-pixelbender.html' title='Quick Tutorial on PixelBender ShaderJobs'/><author><name>Simon Gladman</name><uri>http://www.blogger.com/profile/17449788450837731883</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='28' height='32' src='http://4.bp.blogspot.com/_FGrZThm5JBo/TQ8ZMdgNEUI/AAAAAAAACy4/WGeOchj5VWk/S220/simon_venice.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-17393483.post-8141860235805227061</id><published>2008-10-13T00:40:00.000-07:00</published><updated>2008-10-13T01:53:54.645-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ActionScript'/><category scheme='http://www.blogger.com/atom/ns#' term='node based interface'/><category scheme='http://www.blogger.com/atom/ns#' term='calculator'/><category scheme='http://www.blogger.com/atom/ns#' term='Flex'/><title type='text'>Weekend Tinkering With Flex Node Based Calculator</title><content type='html'>&lt;a href="http://2.bp.blogspot.com/_FGrZThm5JBo/SPL7pk-PhpI/AAAAAAAAAVU/50k2Qjs9lGY/s1600-h/Calculator_v3.png"&gt;&lt;img id="BLOGGER_PHOTO_ID_5256540406812739218" style="DISPLAY: block; MARGIN: 0px auto 10px; CURSOR: hand; TEXT-ALIGN: center" alt="" src="http://2.bp.blogspot.com/_FGrZThm5JBo/SPL7pk-PhpI/AAAAAAAAAVU/50k2Qjs9lGY/s400/Calculator_v3.png" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;div&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;I spent some of the weekend tinkering with my node based calculator. Most of the time was spent re-factoring the code for performance improvements, but I did manage a few user interface tweaks:&lt;/div&gt;&lt;ul&gt;&lt;li&gt;Relationships can be assigned with a colour. By default a random colour is assigned, but by double clicking the &lt;em&gt;output box&lt;/em&gt; on a node, a new colour can be assigned.&lt;/li&gt;&lt;li&gt;Relationships can be deleted. Double click on an &lt;em&gt;input box&lt;/em&gt; to delete the relationships.&lt;/li&gt;&lt;li&gt;Nodes now have separate input boxes, so input relationships are easier to create and view.&lt;/li&gt;&lt;li&gt;Added a new node type - &lt;em&gt;tangent&lt;/em&gt;. Adding new node types takes about five minutes, so I should add a whole suite of them soon.&lt;/li&gt;&lt;li&gt;Adding and deleting nodes no longer re-renders to entire screen (d'oh!)&lt;/li&gt;&lt;li&gt;Relationships are created on the mouse-up event on the &lt;em&gt;input box&lt;/em&gt; rather than the mouse-over.&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;The calculator still defaults to drawing a circle and is &lt;a href="http://www.flexmonkey.co.uk/calc_v1/NodeRenderer.html"&gt;available here&lt;/a&gt;.&lt;/p&gt;&lt;p&gt;Simon Gladman&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/17393483-8141860235805227061?l=flexmonkey.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://flexmonkey.blogspot.com/feeds/8141860235805227061/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=17393483&amp;postID=8141860235805227061' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/17393483/posts/default/8141860235805227061'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/17393483/posts/default/8141860235805227061'/><link rel='alternate' type='text/html' href='http://flexmonkey.blogspot.com/2008/10/weekend-tinkering-with-flex-node-based.html' title='Weekend Tinkering With Flex Node Based Calculator'/><author><name>Simon Gladman</name><uri>http://www.blogger.com/profile/17449788450837731883</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='28' height='32' src='http://4.bp.blogspot.com/_FGrZThm5JBo/TQ8ZMdgNEUI/AAAAAAAACy4/WGeOchj5VWk/S220/simon_venice.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_FGrZThm5JBo/SPL7pk-PhpI/AAAAAAAAAVU/50k2Qjs9lGY/s72-c/Calculator_v3.png' height='72' width='72'/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-17393483.post-5445062987382892084</id><published>2008-10-09T10:02:00.000-07:00</published><updated>2008-10-09T12:57:47.943-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='graphs'/><category scheme='http://www.blogger.com/atom/ns#' term='ActionScript'/><category scheme='http://www.blogger.com/atom/ns#' term='node based interface'/><category scheme='http://www.blogger.com/atom/ns#' term='Flex'/><title type='text'>Flex Node Based Calculator Now Renders Graphs</title><content type='html'>&lt;a href="http://www.flexmonkey.co.uk/calc_v1/NodeRenderer.html"&gt;&lt;img id="BLOGGER_PHOTO_ID_5255200866878168898" style="DISPLAY: block; MARGIN: 0px auto 10px; CURSOR: hand; TEXT-ALIGN: center" alt="" src="http://2.bp.blogspot.com/_FGrZThm5JBo/SO45WF2ZH0I/AAAAAAAAAU0/rOevenmHpyo/s400/Calculator_v2.png" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;div&gt;I've added a graph widget to my node based calculator to render graphs.&lt;br&gt;&lt;br&gt; &lt;/div&gt;&lt;div&gt; &lt;/div&gt;&lt;div&gt; &lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;Number nodes now have a &lt;span style="font-style:italic;"&gt;constant &lt;/span&gt;property - if they are not &lt;span style="font-style:italic;"&gt;constant&lt;/span&gt;, they will increment when the run button is pressed. In this example, a single number acts as the input for sine and cosine nodes which in turn are multiplied and then act as inputs into a graph node.&lt;br&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt; &lt;/div&gt;&lt;div&gt; &lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;Pressing the run button will start drawing the circle as the first number increments.&lt;br&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;This code is still work in progress, there are bugs when nodes are deleted (which is now fixed), and I need to allow users to delete relationships without having to delete nodes, but I was so chuffed with the graphing, I had to deploy this latest build.&lt;br&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt; &lt;/div&gt;&lt;div&gt; &lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;&lt;a href="http://www.flexmonkey.co.uk/calc_v1/NodeRenderer.html"&gt;The latest version is available here.&lt;/a&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/17393483-5445062987382892084?l=flexmonkey.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://flexmonkey.blogspot.com/feeds/5445062987382892084/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=17393483&amp;postID=5445062987382892084' title='6 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/17393483/posts/default/5445062987382892084'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/17393483/posts/default/5445062987382892084'/><link rel='alternate' type='text/html' href='http://flexmonkey.blogspot.com/2008/10/flex-node-based-calculator-now-renders.html' title='Flex Node Based Calculator Now Renders Graphs'/><author><name>Simon Gladman</name><uri>http://www.blogger.com/profile/17449788450837731883</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='28' height='32' src='http://4.bp.blogspot.com/_FGrZThm5JBo/TQ8ZMdgNEUI/AAAAAAAACy4/WGeOchj5VWk/S220/simon_venice.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_FGrZThm5JBo/SO45WF2ZH0I/AAAAAAAAAU0/rOevenmHpyo/s72-c/Calculator_v2.png' height='72' width='72'/><thr:total>6</thr:total></entry><entry><id>tag:blogger.com,1999:blog-17393483.post-2616096328358454284</id><published>2008-10-07T07:46:00.000-07:00</published><updated>2008-10-07T09:07:25.746-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ActionScript'/><category scheme='http://www.blogger.com/atom/ns#' term='node based interface'/><category scheme='http://www.blogger.com/atom/ns#' term='Flex'/><title type='text'>Visual Node Based Calculator in Flex</title><content type='html'>&lt;a href="http://3.bp.blogspot.com/_FGrZThm5JBo/SOuEfiMPOEI/AAAAAAAAAUs/2c_Z2p5-O6M/s1600-h/Calculator.png"&gt;&lt;img id="BLOGGER_PHOTO_ID_5254439067546761282" style="DISPLAY: block; MARGIN: 0px auto 10px; CURSOR: hand; TEXT-ALIGN: center" alt="" src="http://3.bp.blogspot.com/_FGrZThm5JBo/SOuEfiMPOEI/AAAAAAAAAUs/2c_Z2p5-O6M/s400/Calculator.png" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;div&gt;Before I start playing with Pixel Bender, I want to create an interface that mimics the node based interface used by applications like &lt;a href="http://www.sidefx.com/"&gt;Houdini&lt;/a&gt;, &lt;a href="http://www.apple.com/shake/"&gt;Shake&lt;/a&gt; and &lt;a href="http://www.eyeonline.com/Web/EyeonWeb/Products/fusion5/fusion5_interface.aspx"&gt;Digital Fusion&lt;/a&gt;. These interfaces are great for visualising the flow of an image through various filters and how outputs merge together to create new effects.&lt;br /&gt;&lt;br /&gt;Could I create such an interface in Flex - and where to start?&lt;br /&gt;&lt;br /&gt;Well, with &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_0"&gt;MVC&lt;/span&gt;, I can &lt;span class="blsp-spelling-corrected" id="SPELLING_ERROR_1"&gt;separate&lt;/span&gt; the funky user interface from the data and apply it to anything. So, over the weekend, I created a node based user interface and stuck it onto the most basic of applications: a simple calculator.&lt;br /&gt;&lt;br /&gt;I'm really pleased with my work in progress - it opens with an example sum (25+26)/2. You can add new numbers - editable nodes - and new operators using the bottom toolbar. Grab the output from one node (the box on the right) and drag it to the input on another node (the box on the left) to create a relationship.&lt;br /&gt;&lt;br /&gt;Nodes can be dragged around, and ActionScript's &lt;em&gt;curveTo()&lt;/em&gt; method does a pretty nice job of rendering the relationships.&lt;br /&gt;&lt;br /&gt;&lt;em&gt;Subtract&lt;/em&gt; and &lt;em&gt;divide&lt;/em&gt; nodes have a little 'flip order' button on the bottom right to flip the order of the arguments - also they only use the first two inputs, additional inputs are ignored. &lt;em&gt;Add&lt;/em&gt; and &lt;em&gt;subtract&lt;/em&gt; nodes can have loads of inputs and don't care about their order.&lt;br /&gt;&lt;br /&gt;I'm tempted to carry on with this calculator application - creating graph nodes is my next step. There's some error handling to be added - you can create circular relationships that blow up the flash player.&lt;br /&gt;&lt;br /&gt;Enjoy it - all feedback welcome:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="center"&gt;&lt;a href="http://www.flexmonkey.co.uk/calc_v1/NodeRenderer.html"&gt;&lt;strong&gt;Node Based Calculator&lt;/strong&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;PS: Thanks to &lt;a href="http://www.brandspankingnew.net/"&gt;brandspankingnew&lt;/a&gt; for the icons :)&lt;br /&gt;&lt;div&gt;&lt;br /&gt;Simon Gladman&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/17393483-2616096328358454284?l=flexmonkey.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://flexmonkey.blogspot.com/feeds/2616096328358454284/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=17393483&amp;postID=2616096328358454284' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/17393483/posts/default/2616096328358454284'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/17393483/posts/default/2616096328358454284'/><link rel='alternate' type='text/html' href='http://flexmonkey.blogspot.com/2008/10/visual-node-based-calculator-in-flex.html' title='Visual Node Based Calculator in Flex'/><author><name>Simon Gladman</name><uri>http://www.blogger.com/profile/17449788450837731883</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='28' height='32' src='http://4.bp.blogspot.com/_FGrZThm5JBo/TQ8ZMdgNEUI/AAAAAAAACy4/WGeOchj5VWk/S220/simon_venice.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_FGrZThm5JBo/SOuEfiMPOEI/AAAAAAAAAUs/2c_Z2p5-O6M/s72-c/Calculator.png' height='72' width='72'/><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-17393483.post-5080097524178192980</id><published>2008-09-26T01:14:00.000-07:00</published><updated>2008-09-26T01:34:55.815-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='perspective projection'/><category scheme='http://www.blogger.com/atom/ns#' term='perpsectiveProjection'/><category scheme='http://www.blogger.com/atom/ns#' term='gumbo'/><category scheme='http://www.blogger.com/atom/ns#' term='astro'/><title type='text'>Even Faster Perspective Projection</title><content type='html'>Of course, one of the exciting things about the upcoming &lt;a href="http://labs.adobe.com/technologies/flashplayer10/"&gt;Flash Player 10&lt;/a&gt; is its built in support for 3D.&lt;br /&gt;&lt;br /&gt;Adobe have published the Flash 10 API, and guess what, they have introduced a new &lt;a href="http://livedocs.adobe.com/flex/gumbo/langref/flash/geom/PerspectiveProjection.html"&gt;PerspectiveProjection class&lt;/a&gt; - which does all the work I blogged about recently, but does it properly :)&lt;br /&gt;&lt;br /&gt;The &lt;a href="http://opensource.adobe.com/wiki/display/flexsdk/Download+Flex+4"&gt;Gumbo SDK&lt;/a&gt; (Flex 4 which can compile for Flash Player 10) is already available - so I'm looking forward to a weekend of 3D particle systems and hardcore ActionScript!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/17393483-5080097524178192980?l=flexmonkey.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://flexmonkey.blogspot.com/feeds/5080097524178192980/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=17393483&amp;postID=5080097524178192980' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/17393483/posts/default/5080097524178192980'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/17393483/posts/default/5080097524178192980'/><link rel='alternate' type='text/html' href='http://flexmonkey.blogspot.com/2008/09/even-faster-perspectiveprojection.html' title='Even Faster Perspective Projection'/><author><name>Simon Gladman</name><uri>http://www.blogger.com/profile/17449788450837731883</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='28' height='32' src='http://4.bp.blogspot.com/_FGrZThm5JBo/TQ8ZMdgNEUI/AAAAAAAACy4/WGeOchj5VWk/S220/simon_venice.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-17393483.post-5367218730284153717</id><published>2008-09-24T07:18:00.000-07:00</published><updated>2008-09-24T09:42:48.098-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='particles'/><category scheme='http://www.blogger.com/atom/ns#' term='3D'/><category scheme='http://www.blogger.com/atom/ns#' term='perspective projection'/><category scheme='http://www.blogger.com/atom/ns#' term='ActionScript'/><category scheme='http://www.blogger.com/atom/ns#' term='ray plane intersection'/><title type='text'>Fast 3D to 2D Perspective Projection in Flex/ActionScript</title><content type='html'>I thought I'd try my hand a writing a 3D &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_0"&gt;renderer&lt;/span&gt; as part of a particle application I fancy creating.&lt;br /&gt;&lt;br /&gt;The first part of a 3D &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_1"&gt;renderer&lt;/span&gt; is to project 3D points (&lt;em&gt;x,y,z&lt;/em&gt;) onto a 2D plane (&lt;em&gt;u,v&lt;/em&gt;) - your screen. Typically, you'll define a line in 3D and find where it intersects your image plane. However, a search on Google for terms like '&lt;a href="http://www.siggraph.org/education/materials/HyperGraph/raytrace/rayplane_intersection.htm"&gt;Ray Plane Intersection&lt;/a&gt;' and '&lt;a href="http://www.cs.kuleuven.ac.be/cwis/research/graphics/INFOTEC/viewing-in-3d/node8.html"&gt;Perspective Projection&lt;/a&gt;' throw up some pretty hairy looking maths for a simple soul like me. Matrix transformations and dot products are outside of my comfort zone.&lt;br /&gt;&lt;br /&gt;However, I was using 2D line intersections for my &lt;a href="http://flexmonkey.blogspot.com/2008/09/batsense-visualising-echolocation-in.html"&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_2"&gt;BatSense&lt;/span&gt; &lt;/a&gt;project - surely if I view the scene orthographically from the top and left to see where my camera-particle line intersects the top and the side of the image plane, I can use those two simple intersections to calculate the &lt;em&gt;u,v&lt;/em&gt; coordinates - nothing fancier than 'O' level maths required (showing my age there).&lt;br /&gt;&lt;br /&gt;So, more stream of &lt;span class="blsp-spelling-corrected" id="SPELLING_ERROR_3"&gt;consciousness&lt;/span&gt; programming on the train and &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_4"&gt;bob's&lt;/span&gt; your uncle - my 'O' level grade 3D &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_5"&gt;renderer&lt;/span&gt;. This &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_6"&gt;pre&lt;/span&gt;-alpha demo isn't interactive - it's just a camera travelling along its Z-axis through a cloud of random particles (all rendered the same size).&lt;br /&gt;&lt;br /&gt;If you want the money shot, view the source and head to &lt;em&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_7"&gt;CameraView&lt;/span&gt;.&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_8"&gt;mxml&lt;/span&gt;&lt;/em&gt;. The &lt;em&gt;render()&lt;/em&gt; method loops over the particles and using two 2D intersections renders the particle field.&lt;br /&gt;&lt;br /&gt;The line intersection code comes from &lt;a href="http://keith-hair.net/blog/"&gt;Keith Hair's&lt;/a&gt; site - well worth a visit.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.flexmonkey.co.uk/particles-release/particles3D.html"&gt;Here's the WIP application&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/17393483-5367218730284153717?l=flexmonkey.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://flexmonkey.blogspot.com/feeds/5367218730284153717/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=17393483&amp;postID=5367218730284153717' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/17393483/posts/default/5367218730284153717'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/17393483/posts/default/5367218730284153717'/><link rel='alternate' type='text/html' href='http://flexmonkey.blogspot.com/2008/09/fast-3d-to-2d-perspective-projection-in.html' title='Fast 3D to 2D Perspective Projection in Flex/ActionScript'/><author><name>Simon Gladman</name><uri>http://www.blogger.com/profile/17449788450837731883</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='28' height='32' src='http://4.bp.blogspot.com/_FGrZThm5JBo/TQ8ZMdgNEUI/AAAAAAAACy4/WGeOchj5VWk/S220/simon_venice.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-17393483.post-7900330129017449677</id><published>2008-09-22T13:32:00.000-07:00</published><updated>2008-09-22T13:42:13.333-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='BatSense'/><title type='text'>BatSense - with rotation</title><content type='html'>I managed a quick half hour of stream-of-consciousness programming on the train home to rotate the little BatSense cubes. Happily I got the effect I wanted: single faces with a leading edge approaching the camera and a trailing edge moving away to get a blue-red graduation.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.flexmonkey.co.uk/batvision-release/BatVision.html"&gt;Same link as before...&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/17393483-7900330129017449677?l=flexmonkey.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://flexmonkey.blogspot.com/feeds/7900330129017449677/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=17393483&amp;postID=7900330129017449677' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/17393483/posts/default/7900330129017449677'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/17393483/posts/default/7900330129017449677'/><link rel='alternate' type='text/html' href='http://flexmonkey.blogspot.com/2008/09/batsense-with-rotation.html' title='BatSense - with rotation'/><author><name>Simon Gladman</name><uri>http://www.blogger.com/profile/17449788450837731883</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='28' height='32' src='http://4.bp.blogspot.com/_FGrZThm5JBo/TQ8ZMdgNEUI/AAAAAAAACy4/WGeOchj5VWk/S220/simon_venice.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-17393483.post-3285448313296841095</id><published>2008-09-22T04:02:00.000-07:00</published><updated>2008-09-22T13:31:49.761-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='3D'/><category scheme='http://www.blogger.com/atom/ns#' term='bats'/><category scheme='http://www.blogger.com/atom/ns#' term='ActionScript'/><category scheme='http://www.blogger.com/atom/ns#' term='BatSense'/><category scheme='http://www.blogger.com/atom/ns#' term='Flex'/><category scheme='http://www.blogger.com/atom/ns#' term='doppler'/><category scheme='http://www.blogger.com/atom/ns#' term='echolocation'/><title type='text'>BatSense! Visualising Echolocation in Flex (WIP)</title><content type='html'>I was sitting in the bath the other day wondering if I could visualise what a bat would perceive if it lived in a world of randomly moving boxes - well not quite, but I've thought about writing a little program to visualise echolocation for a while. &lt;div&gt;&lt;br /&gt;&lt;div&gt;Visualising echolocation in my simple mind has two aspects - red/blue shift for things moving away/towards the camera and a change in brightness depending on the distance between the camera and the object.&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;a href="http://www.flexmonkey.co.uk/batvision-release/BatVision.html"&gt;Here's the fruit of my labour from this weekend.&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;There are two tabs looking at the same data: &lt;/div&gt;&lt;br /&gt;&lt;div&gt;The plan view shows the camera (a circle) and the image plane (a line). Each randomly moving box shows its visible vertices - which are coloured depending on their movement relative to the camera and their distance - and a line between those vertices and their intersection on the image plane. The plan view was used for debugging, but is a good illustration of what's going on.&lt;/div&gt;&lt;br /&gt;&lt;div&gt;The camera view is my first ever 3d renderer (well 2.5d&lt;em&gt;ish&lt;/em&gt;). I've included the source code, so feel free to poke around. Considering I'm no mathematician, I'm quite pleased with it for a Sunday afternoon's work :)&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;The red/blue shift is undoubtedly wrong. I'm just upping the red/blue value of grey to indicate the Doppler shift. What I really need to do is use some colour temperature charts to get the correct colour as the light wavelength is streched or compressed.&lt;/div&gt;&lt;br /&gt;&lt;div&gt;This really is an early WIP. Two big things to do are to impliment some proper colour temperature stuff, so that the red/blue shift really works, and allow the cubes to rotate - I want a single plane to include both blue and red shift as one vertex moves away and one moves towards the camera.&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;div&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/17393483-3285448313296841095?l=flexmonkey.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://flexmonkey.blogspot.com/feeds/3285448313296841095/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=17393483&amp;postID=3285448313296841095' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/17393483/posts/default/3285448313296841095'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/17393483/posts/default/3285448313296841095'/><link rel='alternate' type='text/html' href='http://flexmonkey.blogspot.com/2008/09/batsense-visualising-echolocation-in.html' title='BatSense! Visualising Echolocation in Flex (WIP)'/><author><name>Simon Gladman</name><uri>http://www.blogger.com/profile/17449788450837731883</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='28' height='32' src='http://4.bp.blogspot.com/_FGrZThm5JBo/TQ8ZMdgNEUI/AAAAAAAACy4/WGeOchj5VWk/S220/simon_venice.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-17393483.post-1151511796254109640</id><published>2008-08-26T03:53:00.000-07:00</published><updated>2008-08-26T03:56:08.711-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='FlexCamp'/><category scheme='http://www.blogger.com/atom/ns#' term='CFDevCon'/><title type='text'>CFDevCon update</title><content type='html'>Sadly CFDevCon has been cancelled.&lt;br /&gt;&lt;br /&gt;Happily, I'll still be speaking at &lt;a href="http://www.flexcamp.co.uk/"&gt;FlexCamp&lt;/a&gt; on Thursday.&lt;br /&gt;&lt;br /&gt;Simon.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/17393483-1151511796254109640?l=flexmonkey.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://flexmonkey.blogspot.com/feeds/1151511796254109640/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=17393483&amp;postID=1151511796254109640' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/17393483/posts/default/1151511796254109640'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/17393483/posts/default/1151511796254109640'/><link rel='alternate' type='text/html' href='http://flexmonkey.blogspot.com/2008/08/cfdevcon-update.html' title='CFDevCon update'/><author><name>Simon Gladman</name><uri>http://www.blogger.com/profile/17449788450837731883</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='28' height='32' src='http://4.bp.blogspot.com/_FGrZThm5JBo/TQ8ZMdgNEUI/AAAAAAAACy4/WGeOchj5VWk/S220/simon_venice.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-17393483.post-6950617717876226188</id><published>2008-08-21T04:02:00.000-07:00</published><updated>2008-08-21T04:15:29.137-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='FlexCamp'/><title type='text'>FlexCamp - Adventures in Public Speaking</title><content type='html'>&lt;a href="http://www.flexcamp.co.uk/"&gt;FlexCamp&lt;/a&gt; is a free - as in beer - Flex event being held in London on August 28. It has some great speakers, including representatives of &lt;a href="http://www.adobe.com/"&gt;Adobe&lt;/a&gt;, &lt;a href="http://www.tribalddb.com/"&gt;Tribal &lt;/a&gt;and &lt;a href="http://www.emakmafu.com/"&gt;Emak Mafu&lt;/a&gt;. There's also some great prizes (including tickets to &lt;a href="http://max.adobe.com/eu/experience/#?s=0&amp;amp;p=0"&gt;Adobe Max&lt;/a&gt;) to be won and beer and pizza.&lt;br /&gt;&lt;br /&gt;I've also agreed to MC the event - it will be my first time speaking to what may be over 300 people. Looks like my weekend will be spent with my nose in &lt;a href="http://www.amazon.co.uk/Public-Speaking-Presentations-Dummies/dp/0470034726/ref=sr_1_1?ie=UTF8&amp;amp;s=books&amp;amp;qid=1219316922&amp;amp;sr=8-1"&gt;this book&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;Thanks to Chester of the &lt;a href="http://ria.meetup.com/7/"&gt;London Flex User Group&lt;/a&gt; and &lt;a href="http://www.emakmafu.com/"&gt;Emak Mafu&lt;/a&gt; for the opportunity. &lt;a href="http://ria.meetup.com/7/calendar/8491887/"&gt;Don't forget to register for the day&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;See you next Thursday!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/17393483-6950617717876226188?l=flexmonkey.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://flexmonkey.blogspot.com/feeds/6950617717876226188/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=17393483&amp;postID=6950617717876226188' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/17393483/posts/default/6950617717876226188'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/17393483/posts/default/6950617717876226188'/><link rel='alternate' type='text/html' href='http://flexmonkey.blogspot.com/2008/08/flexcamp-adventures-in-public-speaking.html' title='FlexCamp - Adventures in Public Speaking'/><author><name>Simon Gladman</name><uri>http://www.blogger.com/profile/17449788450837731883</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='28' height='32' src='http://4.bp.blogspot.com/_FGrZThm5JBo/TQ8ZMdgNEUI/AAAAAAAACy4/WGeOchj5VWk/S220/simon_venice.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-17393483.post-4003864526862982340</id><published>2008-06-29T04:21:00.000-07:00</published><updated>2008-06-29T04:36:43.269-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='CFDevCon'/><title type='text'>CFDevCon</title><content type='html'>After almost a month of no blogging and hardly any Flexing (I've been relaxing at the beautiful &lt;a href="http://www.layanaresort.com/index.php"&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_0"&gt;Layana&lt;/span&gt; &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_1"&gt;Resport&lt;/span&gt; and Spa &lt;/a&gt;and I'm now looking after Tag's office in sunny &lt;a href="http://www.capetown.gov.za/en/Pages/default.aspx"&gt;Cape Town&lt;/a&gt; for a few weeks), I need to get back up to speed. I've been invited to talk at this year's &lt;a href="http://www.cfdevcon.com/"&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_2"&gt;CFDevCon&lt;/span&gt;&lt;/a&gt; in Brighton later this year.&lt;br /&gt;&lt;br /&gt;I'll be doing a talk on Alec Cove's amazing physics engine - &lt;a href="http://www.cove.org/ape/"&gt;APE&lt;/a&gt;. I've done two projects in APE - a &lt;a href="http://www.flexmonkey.co.uk/ape_test/apetest.html"&gt;physics playground&lt;/a&gt; and &lt;a href="http://www.flexmonkey.co.uk/spaceballs/spaceballs.html"&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_3"&gt;SpaceBalls&lt;/span&gt;&lt;/a&gt;, my &lt;span class="blsp-spelling-corrected" id="SPELLING_ERROR_4"&gt;homage&lt;/span&gt; to &lt;a href="http://en.wikipedia.org/wiki/Asteroids_%28arcade_game%29"&gt;Asteroids&lt;/a&gt;. I'm not sure how either of these projects will revolutionise &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_5"&gt;RIAs&lt;/span&gt;, but I'm quite excited by &lt;a href="http://bumptop.com/"&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_6"&gt;BumpTop&lt;/span&gt;&lt;/a&gt; - so over the next few weeks I may try to create a Flex based window manager  that incorporates some physics and present that.&lt;br /&gt;&lt;br /&gt;Simon&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/17393483-4003864526862982340?l=flexmonkey.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://flexmonkey.blogspot.com/feeds/4003864526862982340/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=17393483&amp;postID=4003864526862982340' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/17393483/posts/default/4003864526862982340'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/17393483/posts/default/4003864526862982340'/><link rel='alternate' type='text/html' href='http://flexmonkey.blogspot.com/2008/06/cfdevcon.html' title='CFDevCon'/><author><name>Simon Gladman</name><uri>http://www.blogger.com/profile/17449788450837731883</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='28' height='32' src='http://4.bp.blogspot.com/_FGrZThm5JBo/TQ8ZMdgNEUI/AAAAAAAACy4/WGeOchj5VWk/S220/simon_venice.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-17393483.post-4519933557694797405</id><published>2008-05-16T06:34:00.000-07:00</published><updated>2008-05-16T06:44:00.534-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='video player'/><category scheme='http://www.blogger.com/atom/ns#' term='ActionScript'/><category scheme='http://www.blogger.com/atom/ns#' term='gesture recognition'/><category scheme='http://www.blogger.com/atom/ns#' term='Flex'/><title type='text'>Video Control through Mouse Gesture Recognition</title><content type='html'>&lt;div align="left"&gt;&lt;a href="http://flexmonkey.blogspot.com/2008/04/clockwise-or-anti-clockwise.html"&gt;I recently wrote about detecting mouse direction&lt;/a&gt; to control my &lt;a href="http://www.flexmonkey.co.uk/spaceballs/spaceballs.html"&gt;SpaceBalls&lt;/a&gt; game. The technique was rubbish for controlling space ships, but turns out to be a nice method for jogging through video.&lt;br /&gt;&lt;br /&gt;Here's an example of a rough and ready bitmap sequence video player that's driven by mouse gestures:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.flexmonkey.co.uk/MediaPlayerRelease/MediaPlayer.html"&gt;&lt;strong&gt;Mouse Gesture Video Player&lt;/strong&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;Hold the mouse down and rotate clockwise or anti-clockwise to forward or rewind the video - just like using the jog dial on a video machine.&lt;br /&gt;&lt;br /&gt;This works better in Firefox that IE - the reason being that under Firefox, the image control successfully fires an HTTP Status Event, so the progress bar gives you an idea of how many frames are loaded.&lt;br /&gt;&lt;br /&gt;Either way, you'll need to be patient, there's 23MB of still frames being loaded!&lt;br /&gt;&lt;br /&gt;Right click to view source.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/17393483-4519933557694797405?l=flexmonkey.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://flexmonkey.blogspot.com/feeds/4519933557694797405/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=17393483&amp;postID=4519933557694797405' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/17393483/posts/default/4519933557694797405'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/17393483/posts/default/4519933557694797405'/><link rel='alternate' type='text/html' href='http://flexmonkey.blogspot.com/2008/05/video-control-through-mouse-gesture.html' title='Video Control through Mouse Gesture Recognition'/><author><name>Simon Gladman</name><uri>http://www.blogger.com/profile/17449788450837731883</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='28' height='32' src='http://4.bp.blogspot.com/_FGrZThm5JBo/TQ8ZMdgNEUI/AAAAAAAACy4/WGeOchj5VWk/S220/simon_venice.jpg'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-17393483.post-5605559087850747046</id><published>2008-05-09T04:28:00.000-07:00</published><updated>2011-02-18T23:32:19.329-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='GroupingField'/><category scheme='http://www.blogger.com/atom/ns#' term='GroupingCollection'/><category scheme='http://www.blogger.com/atom/ns#' term='DataGrid'/><category scheme='http://www.blogger.com/atom/ns#' term='ActionScript'/><category scheme='http://www.blogger.com/atom/ns#' term='AdvancedDataGrid'/><category scheme='http://www.blogger.com/atom/ns#' term='AdvancedDataGridColumn'/><category scheme='http://www.blogger.com/atom/ns#' term='Flex'/><title type='text'>Dynamic Grouping on the Flex AdvancedDataGrid</title><content type='html'>The &lt;em&gt;AdvancedDataGrid&lt;/em&gt; is a beautiful thing with multiple layers of grouped heirarchy and fast aggregagate functions (like &lt;em&gt;SUM&lt;/em&gt;). In fact, I've been playing with aggregate functions in AIR's SQL Lite versus the &lt;em&gt;AdvancedDataGrid&lt;/em&gt; and with big record sets (around 10,000 rows), the &lt;em&gt;AdvancedDataGrid&lt;/em&gt; wins!&lt;br /&gt;&lt;br /&gt;This morning, I wrote a neat little demo that allows users to select different data providers and then generates the required &lt;em&gt;AdvancedDataGridColumns&lt;/em&gt;. More than that, the column list is displayed in a list and the user can multiple select (i.e. control click) from that list to apply grouping.&lt;br /&gt;&lt;br /&gt;So, rather than binding the data grid to the provider, I've written a little function that looks at the 0th row and generates an &lt;em&gt;AdvancedDataGridColumn &lt;/em&gt;for each column:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;span style="font-size:85%;"&gt;            private function dataProviderChangeHandler():void&lt;br /&gt;{&lt;br /&gt;var datagridColumn:AdvancedDataGridColumn&lt;br /&gt;columnsArrayCollection=new ArrayCollection()&lt;br /&gt;&lt;br /&gt;for (var column:String in ArrayCollection(comboBox.selectedItem.dataProvider).getItemAt(0))&lt;br /&gt;{&lt;br /&gt;datagridColumn=new AdvancedDataGridColumn()&lt;br /&gt;datagridColumn.dataField=column.toString()&lt;br /&gt;columnsArrayCollection.addItem(datagridColumn)&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;advancedDataGrid.columns=columnsArrayCollection.toArray()&lt;br /&gt;}&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;When the user clicks on the columns list on the left of the data grid, I apply grouping based on the selection. This is done by creating a new data provider for the data grid which is of the type &lt;em&gt;GroupingCollection&lt;/em&gt; - as I step through the selection, I create a new &lt;em&gt;GroupingField&lt;/em&gt; and push it onto a &lt;em&gt;Grouping&lt;/em&gt; fields array which becomes the provider's grouping.&lt;br /&gt;&lt;br /&gt;This is probably easier to illustrate than explain:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;private function updateGrouping():void&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;var groupingCollection:GroupingCollection=new GroupingCollection()&lt;br /&gt;var grouping:Grouping=new Grouping()&lt;br /&gt;var groupingField:GroupingField&lt;br /&gt;&lt;br /&gt;grouping.fields=new Array()&lt;br /&gt;&lt;br /&gt;for each(var advancedDataGridColumn:Object in groupFieldsList.selectedItems)&lt;br /&gt;{&lt;br /&gt;groupingField=new GroupingField(AdvancedDataGridColumn(advancedDataGridColumn).dataField)&lt;br /&gt;&lt;br /&gt;groupingCollection.source=ArrayCollection(comboBox.selectedItem.dataProvider)&lt;br /&gt;grouping.fields.push(groupingField)&lt;br /&gt;groupingCollection.grouping=grouping&lt;br /&gt;}               &lt;br /&gt;groupingCollection.refresh()&lt;br /&gt;advancedDataGrid.dataProvider=groupingCollection&lt;br /&gt;}&lt;br /&gt;&lt;/span&gt;&lt;/pre&gt;&lt;div align="center"&gt;&lt;br /&gt;&lt;br /&gt;The final result can be seen here (source code view enabled):&lt;br /&gt;&lt;br /&gt;&lt;a href="http://flexmonkey.co.uk/AdvancedDataGridDemo/AdvancedDataGridDemo.html"&gt;AdvancedDataGrid Grouping Demo&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;The source code is available here: &lt;br /&gt;&lt;a href="http://flexmonkey.co.uk/AdvancedDataGridDemo/srcview/index.html"&gt;Source Code&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/17393483-5605559087850747046?l=flexmonkey.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://flexmonkey.blogspot.com/feeds/5605559087850747046/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=17393483&amp;postID=5605559087850747046' title='23 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/17393483/posts/default/5605559087850747046'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/17393483/posts/default/5605559087850747046'/><link rel='alternate' type='text/html' href='http://flexmonkey.blogspot.com/2008/05/dynamic-grouping-on-flex.html' title='Dynamic Grouping on the Flex AdvancedDataGrid'/><author><name>Simon Gladman</name><uri>http://www.blogger.com/profile/17449788450837731883</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='28' height='32' src='http://4.bp.blogspot.com/_FGrZThm5JBo/TQ8ZMdgNEUI/AAAAAAAACy4/WGeOchj5VWk/S220/simon_venice.jpg'/></author><thr:total>23</thr:total></entry><entry><id>tag:blogger.com,1999:blog-17393483.post-5411090444531241304</id><published>2008-04-28T23:53:00.000-07:00</published><updated>2008-04-29T00:10:45.820-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='TabNavigator'/><category scheme='http://www.blogger.com/atom/ns#' term='ActionScript'/><category scheme='http://www.blogger.com/atom/ns#' term='Flex'/><title type='text'>Creating an 'Add New Tab' button to the Flex TabNavigator</title><content type='html'>&lt;a href="http://2.bp.blogspot.com/_FGrZThm5JBo/SBbGjMUZ3OI/AAAAAAAAAIg/cRFR1Dw-RyQ/s1600-h/newtab.jpg"&gt;&lt;img id="BLOGGER_PHOTO_ID_5194557528122973410" style="DISPLAY: block; MARGIN: 0px auto 10px; CURSOR: hand; TEXT-ALIGN: center" alt="" src="http://2.bp.blogspot.com/_FGrZThm5JBo/SBbGjMUZ3OI/AAAAAAAAAIg/cRFR1Dw-RyQ/s400/newtab.jpg" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;div&gt;If you want to create and position an add new tab button to the Flex &lt;em&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_0"&gt;TabNavigator&lt;/span&gt; &lt;/em&gt;control that mimics Internet Explorer, you can &lt;span class="blsp-spelling-corrected" id="SPELLING_ERROR_1"&gt;interrogate&lt;/span&gt; the tab &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_2"&gt;control's&lt;/span&gt; children to find the &lt;em&gt;x&lt;/em&gt; position of the last child and add its width to calculate the &lt;em&gt;x&lt;/em&gt; position of your add new button.&lt;/div&gt;&lt;div&gt; &lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;I use the &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_3"&gt;updateComplete&lt;/span&gt; event to invoke a method that repositions the button:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;span style="font-family:courier new;font-size:85%;"&gt;&lt;blockquote&gt;&lt;span style="font-family:courier new;font-size:85%;"&gt;&amp;LT;mx:TabNavigator width="100%"&lt;br /&gt;height="100%" id="tabNavigator" creationComplete="positionAddNewTabButton()"&lt;br /&gt;updateComplete="positionAddNewTabButton()"&gt;&lt;/span&gt;&lt;span style="font-family:courier new;font-size:85%;"&gt;&lt;?xml:namespace prefix = mx /&gt;&lt;mx:tabnavigator id="tabNavigator" updatecomplete="positionAddNewTabButton()" height="100%" width="100%"&gt; &lt;/mx:tabnavigator&gt;&lt;/span&gt;&lt;/blockquote&gt;&lt;/span&gt;&lt;span style="font-family:courier new;font-size:85%;"&gt;&lt;mx:tabnavigator id="tabNavigator" updatecomplete="positionAddNewTabButton()" height="100%" width="100%"&gt;&lt;br /&gt;&lt;span style="font-family:georgia;font-size:100%;"&gt;And &lt;em&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_4"&gt;positionAddNewTabButton&lt;/span&gt;()&lt;/em&gt; looks like this: &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;/span&gt;&lt;/mx:tabnavigator&gt;&lt;span style="font-family:courier new;font-size:85%;"&gt;&lt;blockquote&gt;&lt;span style="font-family:courier new;font-size:85%;"&gt;public function &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_5"&gt;positionAddNewTabButton&lt;/span&gt;():void&lt;br /&gt;{&lt;br /&gt;var i:int=&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_6"&gt;tabNavigator&lt;/span&gt;.&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_7"&gt;numChildren&lt;/span&gt;-1;&lt;br /&gt;addNewTabButton.x=tabNavigator.getTabAt(i).x +&lt;br /&gt;(tabNavigator.getTabAt(i).width) + 10&lt;br /&gt;addNewTabButton.y=tabNavigator.getTabAt(i).y +&lt;br /&gt;(tabNavigator.getTabAt(i).height/2) - 1&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:courier new;font-size:85%;"&gt;} &lt;/span&gt;&lt;/blockquote&gt;&lt;/span&gt;&lt;br /&gt;&lt;p&gt;The magic number '10' fixes the space between the final tab and &lt;em&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_8"&gt;addNewTabButton&lt;/span&gt; (&lt;/em&gt;which is the button itself). &lt;em&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_9"&gt;tabNavigator&lt;/span&gt;&lt;/em&gt; is my &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_10"&gt;TabNavigator&lt;/span&gt;.&lt;/p&gt;&lt;br /&gt;&lt;mx:tabnavigator id="tabNavigator" updatecomplete="positionAddNewTabButton()" height="100%" width="100%"&gt;&lt;/mx:tabnavigator&gt;&lt;br /&gt;&lt;mx:tabnavigator id="tabNavigator" updatecomplete="positionAddNewTabButton()" height="100%" width="100%"&gt;&lt;/mx:tabnavigator&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/17393483-5411090444531241304?l=flexmonkey.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://flexmonkey.blogspot.com/feeds/5411090444531241304/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=17393483&amp;postID=5411090444531241304' title='5 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/17393483/posts/default/5411090444531241304'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/17393483/posts/default/5411090444531241304'/><link rel='alternate' type='text/html' href='http://flexmonkey.blogspot.com/2008/04/creating-add-new-tab-button-to-flex.html' title='Creating an &apos;Add New Tab&apos; button to the Flex TabNavigator'/><author><name>Simon Gladman</name><uri>http://www.blogger.com/profile/17449788450837731883</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='28' height='32' src='http://4.bp.blogspot.com/_FGrZThm5JBo/TQ8ZMdgNEUI/AAAAAAAACy4/WGeOchj5VWk/S220/simon_venice.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_FGrZThm5JBo/SBbGjMUZ3OI/AAAAAAAAAIg/cRFR1Dw-RyQ/s72-c/newtab.jpg' height='72' width='72'/><thr:total>5</thr:total></entry><entry><id>tag:blogger.com,1999:blog-17393483.post-7316894468445695977</id><published>2008-04-22T09:12:00.000-07:00</published><updated>2008-04-22T09:30:53.559-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ActionScript'/><category scheme='http://www.blogger.com/atom/ns#' term='Flex'/><category scheme='http://www.blogger.com/atom/ns#' term='APE'/><category scheme='http://www.blogger.com/atom/ns#' term='Physics'/><title type='text'>Collision Detection in APE</title><content type='html'>I've seen a few questions in APE forums about handling collision detection. APE invokes a &lt;em&gt;resolveCollision()&lt;/em&gt; method on particles involved in collsion and if you override that method by extending the particle class, you can add your own collision detection code.&lt;br /&gt;&lt;br /&gt;Here's the source for my bullet class:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;&lt;span style="font-size:60%;"&gt; &lt;br /&gt;package org.cove.ape &lt;br /&gt;{&lt;br /&gt; import classes.PointParticleManager; &lt;br /&gt; public class Bullet extends CircleParticle &lt;br /&gt; {&lt;br /&gt;  public function Bullet(x:Number, y:Number, radius:Number, fixed:Boolean=false, mass:Number=1, elasticity:Number=0.3, friction:Number=0) &lt;br /&gt;  {&lt;br /&gt;   super(x, y, radius, fixed, mass, elasticity, friction); &lt;br /&gt;   super.setStyle(1,0x00FF00) &lt;br /&gt;  }&lt;br /&gt;  &lt;br /&gt;  internal override function resolveCollision(mtd:Vector, vel:Vector, n:Vector, d:Number, o:int, p:AbstractParticle):void &lt;br /&gt;  { &lt;br /&gt;   for(var i:int=0; i&lt;10; i++) &lt;br /&gt;   {&lt;br /&gt;    PointParticleManager.addParticle(&lt;br /&gt;    this.px,this.py, new Vector(Math.random()*2 - 1, Math.random()*2 - 1)) &lt;br /&gt;   }&lt;br /&gt;   SpaceBalls.defaultApeGroup.removeParticle(this) &lt;br /&gt;  }&lt;br /&gt; }&lt;br /&gt;}&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;This code destroys bullets on impact. If you want the collision to work properly, you'll need to invoke &lt;em&gt;super.resolveCollision()&lt;/em&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/17393483-7316894468445695977?l=flexmonkey.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://flexmonkey.blogspot.com/feeds/7316894468445695977/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=17393483&amp;postID=7316894468445695977' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/17393483/posts/default/7316894468445695977'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/17393483/posts/default/7316894468445695977'/><link rel='alternate' type='text/html' href='http://flexmonkey.blogspot.com/2008/04/collision-detection-in-ape.html' title='Collision Detection in APE'/><author><name>Simon Gladman</name><uri>http://www.blogger.com/profile/17449788450837731883</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='28' height='32' src='http://4.bp.blogspot.com/_FGrZThm5JBo/TQ8ZMdgNEUI/AAAAAAAACy4/WGeOchj5VWk/S220/simon_venice.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-17393483.post-380437104138344961</id><published>2008-04-16T00:53:00.000-07:00</published><updated>2011-10-19T12:04:11.159-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ActionScript'/><category scheme='http://www.blogger.com/atom/ns#' term='Flex'/><category scheme='http://www.blogger.com/atom/ns#' term='Arcade Game'/><category scheme='http://www.blogger.com/atom/ns#' term='Asteroids'/><category scheme='http://www.blogger.com/atom/ns#' term='APE'/><category scheme='http://www.blogger.com/atom/ns#' term='Physics'/><title type='text'>SpaceBalls - Work In Progress</title><content type='html'>I've had a lot of fun working on my &lt;em&gt;Asteroids&lt;/em&gt; homage, &lt;a href="http://www.flexmonkey.co.uk/spaceBalls/SpaceBalls.html"&gt;Space Balls&lt;/a&gt;. Since the last release, I've added space ship collisions that damage hull integrity commensurate with the impact velocity. Once your space ship reaches zero hull integrity, it's curtains!&lt;br /&gt;&lt;br /&gt;I played with interaction over the weekend, my first experiment was to recognize &lt;a href="http://flexmonkey.blogspot.com/2008/04/clockwise-or-anti-clockwise.html"&gt;mouse circular motion&lt;/a&gt;. Nice idea - but pretty grim to use. The space ship now points towards the mouse pointer and the space bar fires the thrust. Clicking the mouse button fires your cannons.&lt;br /&gt;&lt;br /&gt;Finally, turn the volume up - there's some funky sound effects to annoy anybody and everybody within ear distance.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/17393483-380437104138344961?l=flexmonkey.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://flexmonkey.blogspot.com/feeds/380437104138344961/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=17393483&amp;postID=380437104138344961' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/17393483/posts/default/380437104138344961'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/17393483/posts/default/380437104138344961'/><link rel='alternate' type='text/html' href='http://flexmonkey.blogspot.com/2008/04/spaceballs-work-in-progress.html' title='SpaceBalls - Work In Progress'/><author><name>Simon Gladman</name><uri>http://www.blogger.com/profile/17449788450837731883</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='28' height='32' src='http://4.bp.blogspot.com/_FGrZThm5JBo/TQ8ZMdgNEUI/AAAAAAAACy4/WGeOchj5VWk/S220/simon_venice.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-17393483.post-7398329738610378354</id><published>2008-04-12T01:17:00.000-07:00</published><updated>2008-04-12T02:13:53.627-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='user interaction'/><category scheme='http://www.blogger.com/atom/ns#' term='ActionScript'/><category scheme='http://www.blogger.com/atom/ns#' term='gesture recognition'/><category scheme='http://www.blogger.com/atom/ns#' term='Flex'/><category scheme='http://www.blogger.com/atom/ns#' term='HCI'/><title type='text'>Clockwise or Anti-clockwise?</title><content type='html'>Sadly, Actionscript 3 doesn't support the Key object any more, and I can't figure out a way to handle multiple simultaneous key presses in Flex. The user input on my &lt;a href="http://flexmonkey.co.uk/spaceBalls/boxattax.html"&gt;SpaceBalls&lt;/a&gt; games needs improving, so last night I started thinking about mouse input options.&lt;br /&gt;&lt;br /&gt;What I need is the ability to understand mouse moves in either a clockwise or anti-clockwise direction around an arbitrary point. A quick whizz round the internet lead to some quite complicated gesture recognition libraries, but these seemed a little overkill for my requirements.&lt;br /&gt;&lt;br /&gt;Here's my simple solution for understanding clockwise or anti-clockwise mouse moves: basically, figure out the current angle relative to the average mouse position during the gesture. If that angle is less than the previous mouse position, we're moving anti-clockwise and if it's greater, we're moving clockwise.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://flexmonkey.co.uk/mousegesture/mousegesture.html"&gt;MouseGesture Work In Progress Demo&lt;/a&gt; (right click to view source)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/17393483-7398329738610378354?l=flexmonkey.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://flexmonkey.blogspot.com/feeds/7398329738610378354/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=17393483&amp;postID=7398329738610378354' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/17393483/posts/default/7398329738610378354'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/17393483/posts/default/7398329738610378354'/><link rel='alternate' type='text/html' href='http://flexmonkey.blogspot.com/2008/04/clockwise-or-anti-clockwise.html' title='Clockwise or Anti-clockwise?'/><author><name>Simon Gladman</name><uri>http://www.blogger.com/profile/17449788450837731883</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='28' height='32' src='http://4.bp.blogspot.com/_FGrZThm5JBo/TQ8ZMdgNEUI/AAAAAAAACy4/WGeOchj5VWk/S220/simon_venice.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-17393483.post-8805762390537011659</id><published>2008-04-10T00:21:00.000-07:00</published><updated>2011-10-26T22:29:05.337-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ActionScript'/><category scheme='http://www.blogger.com/atom/ns#' term='Flex'/><category scheme='http://www.blogger.com/atom/ns#' term='APE'/><category scheme='http://www.blogger.com/atom/ns#' term='Physics'/><title type='text'>Flex/APE Mini Tutorial &amp; Playground</title><content type='html'>This was my first play with APE (ActionScript Physics Engine). I've seen a few requests for APE/Flex tutorials, so I've opened up the source code and knocked up a quick introduction. One thing to note is that most of this has been written on the train in half hour blocks. The resulting structure of the code is pretty grim - not the Cairngorm beauty I would hope to write.&lt;br /&gt;&lt;br /&gt;The main difference between this release and previous versions is the addition of particle emitters. These have minimum and maximum angles for releasing particles and emitter speed. Emitters, like blocks, can’t currently be selected from the canvas – they need to be selected from their list to be edited.&lt;br /&gt;&lt;br /&gt;Anyway, here's APE in four paragraphs...&lt;br /&gt;&lt;br /&gt;&lt;em&gt;init()&lt;/em&gt; - this method is called after the application's creationComplete event. It initializes the APE Engine with, in this case, as delta time value of 1/4. Low delta time values offer slower, but more accurate simulations, while higher values offer faster, but less accurate simulations.&lt;br /&gt;&lt;br /&gt;The next steps are to specify which UIComponent will host the simulation by setting the APE Engine's container property, set default gravity with the&lt;em&gt; addMasslessForce()&lt;/em&gt; method (remember that gravity affects all objects identically hence massless force) and add a default group. In this simulation, all my particles are added to this group.&lt;br /&gt;&lt;br /&gt;I want to fire the &lt;em&gt;step()&lt;/em&gt; method each time the Flash Player enters a frame and I do this by creating an event handler that invokes my &lt;em&gt;run() &lt;/em&gt;method each time the ENTER_FRAME event fires.&lt;br /&gt;&lt;br /&gt;&lt;em&gt;run()&lt;/em&gt; - for APE, we only need to invoke two methods on the APE Engine - &lt;em&gt;step()&lt;/em&gt; which does the maths and &lt;em&gt;paint()&lt;/em&gt; which redraws the simulation on screen. I also loop over my array collection of particle emitters and have them add circle particles to the simulation based on their properties.&lt;br /&gt;&lt;br /&gt;Adding particles to the simulation: this is done in two places - in the &lt;em&gt;run()&lt;/em&gt; method and after the user stops drawing in the &lt;em&gt;endDrawRectangle()&lt;/em&gt; method. Although there's a lot of fluff in these two functions, but the real guts is essentially creating a new particle (either CircleParticle or RectangleParticle) and adding it to the group.&lt;br /&gt;&lt;br /&gt;Have fun – here’s the application:&lt;br /&gt;&lt;br /&gt;&lt;div align="center"&gt;&lt;a href="http://www.flexmonkey.co.uk/APE_Test/ApeTest.html"&gt;APE Physics Playground&lt;/a&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/17393483-8805762390537011659?l=flexmonkey.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://flexmonkey.blogspot.com/feeds/8805762390537011659/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=17393483&amp;postID=8805762390537011659' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/17393483/posts/default/8805762390537011659'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/17393483/posts/default/8805762390537011659'/><link rel='alternate' type='text/html' href='http://flexmonkey.blogspot.com/2008/04/flexape-mini-tutorial-playground.html' title='Flex/APE Mini Tutorial &amp; Playground'/><author><name>Simon Gladman</name><uri>http://www.blogger.com/profile/17449788450837731883</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='28' height='32' src='http://4.bp.blogspot.com/_FGrZThm5JBo/TQ8ZMdgNEUI/AAAAAAAACy4/WGeOchj5VWk/S220/simon_venice.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-17393483.post-288570575447700698</id><published>2008-04-09T02:49:00.001-07:00</published><updated>2011-10-19T12:05:07.661-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ActionScript'/><category scheme='http://www.blogger.com/atom/ns#' term='Flex'/><category scheme='http://www.blogger.com/atom/ns#' term='Arcade Game'/><category scheme='http://www.blogger.com/atom/ns#' term='Asteroids'/><category scheme='http://www.blogger.com/atom/ns#' term='APE'/><category scheme='http://www.blogger.com/atom/ns#' term='Physics'/><title type='text'>SpaceBalls - Asteroids meets Flex meets APE</title><content type='html'>What better way to spend a snowy Sunday in Kingston upon Thames that rebuild that old Arcade classic, &lt;em&gt;Asteroids&lt;/em&gt;, in Flex using &lt;a href="http://www.cove.org/ape/"&gt;APE physics&lt;/a&gt;? Nothing. So that's what I did...&lt;br /&gt;&lt;br /&gt;&lt;div align="center"&gt;&lt;a href="http://www.flexmonkey.co.uk/spaceBalls/SpaceBalls.html"&gt;Space Balls&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;APE wheels are collision enabled particles that understand angular velocity and traction which make perfect circular 'asteroids'. I had to extend the APE particles and override the &lt;em&gt;resolveCollision&lt;/em&gt; method so I could handle collisions - now bullets vanish after impact and the asteroids blow up or split after 10 hits.&lt;br /&gt;&lt;br /&gt;I wrote a little particle system to handle the rocket thrust and impacts - but all the bullets and asteroids are handled by the APE engine.&lt;br /&gt;&lt;br /&gt;There's a load to do - but completing this in one Sunday is an excellent demo of what a joy it is to code in ActionScript and APE.&lt;br /&gt;&lt;br /&gt;Once again - &lt;a href="http://www.cove.org/ape/"&gt;APE &lt;/a&gt;is awesome. If you want to play with 2D physics in Flex, you need it!&lt;br /&gt;&lt;br /&gt;PS: Be sure to set the focus on the background after dismissing the dialog (i.e. click on it). The key events I'm handling only cope with one key press at a time, so you can't shoot while rotating.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/17393483-288570575447700698?l=flexmonkey.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://flexmonkey.blogspot.com/feeds/288570575447700698/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=17393483&amp;postID=288570575447700698' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/17393483/posts/default/288570575447700698'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/17393483/posts/default/288570575447700698'/><link rel='alternate' type='text/html' href='http://flexmonkey.blogspot.com/2008/04/spaceballs-asteroids-meets-ape.html' title='SpaceBalls - Asteroids meets Flex meets APE'/><author><name>Simon Gladman</name><uri>http://www.blogger.com/profile/17449788450837731883</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='28' height='32' src='http://4.bp.blogspot.com/_FGrZThm5JBo/TQ8ZMdgNEUI/AAAAAAAACy4/WGeOchj5VWk/S220/simon_venice.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-17393483.post-4680331750311804023</id><published>2008-04-02T00:25:00.000-07:00</published><updated>2011-10-26T22:30:31.058-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ActionScript'/><category scheme='http://www.blogger.com/atom/ns#' term='Flex'/><category scheme='http://www.blogger.com/atom/ns#' term='APE'/><category scheme='http://www.blogger.com/atom/ns#' term='Physics'/><title type='text'>Further APE Adventures</title><content type='html'>I've continued to play with APE and extended my original demo to allow editing of fixed blocks. The interface allows you to move and rotate the blocks and, more excitingly, change the friction and elasticity of them too. Select blocks from the list on the left. &lt;br /&gt;&lt;br /&gt;Setting the &lt;em&gt;fillStyle &lt;/em&gt;didn't update, so I superimpose a Flex box to show current selection. Flex boxes, however, have their pivot point at 0,0 and APE rectangles have their pivot point at the centrer, so I created a new class, &lt;em&gt;selectionOverlayWidget&lt;/em&gt;, to give me control over the pivot point.&lt;br /&gt;&lt;br /&gt;I impliemented particle culling so that circles that fall off the edge of the screen are removed from the simulation to keep performance high.&lt;br /&gt;&lt;br /&gt;Here you go: &lt;a href="http://www.flexmonkey.co.uk/APE_Test/ApeTest.html"&gt;http://www.flexmonkey.co.uk/APE_Test/ApeTest.html&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/17393483-4680331750311804023?l=flexmonkey.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://flexmonkey.blogspot.com/feeds/4680331750311804023/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=17393483&amp;postID=4680331750311804023' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/17393483/posts/default/4680331750311804023'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/17393483/posts/default/4680331750311804023'/><link rel='alternate' type='text/html' href='http://flexmonkey.blogspot.com/2008/04/further-ape-adventures.html' title='Further APE Adventures'/><author><name>Simon Gladman</name><uri>http://www.blogger.com/profile/17449788450837731883</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='28' height='32' src='http://4.bp.blogspot.com/_FGrZThm5JBo/TQ8ZMdgNEUI/AAAAAAAACy4/WGeOchj5VWk/S220/simon_venice.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-17393483.post-9215097111454319021</id><published>2008-03-30T07:42:00.000-07:00</published><updated>2011-10-26T22:30:45.083-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ActionScript'/><category scheme='http://www.blogger.com/atom/ns#' term='Flex'/><category scheme='http://www.blogger.com/atom/ns#' term='APE'/><category scheme='http://www.blogger.com/atom/ns#' term='Physics'/><title type='text'>Going APE in Flex</title><content type='html'>Although it is only in alpha, &lt;a href="http://www.cove.org/ape/index.htm"&gt;APE&lt;/a&gt; - the &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_0"&gt;ActionScript&lt;/span&gt; Physics Engine - is amazing. I knocked up a little demo in Flex which you can see here: &lt;br /&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;a href="http://www.flexmonkey.co.uk/APE_Test/ApeTest.html"&gt;http://www.flexmonkey.co.uk/APE_Test/ApeTest.html&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Draw on the canvas to create immovable blocks and click to create moving circle particles. Originally, I thought there was a bug registering the immovable blocks, but my code was creating rectangles with a negative length. Although these rendered fine, the physics didn't work. I coded round that this morning on the train and voila - perfect particles!&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Right click for the source code - it's only a few lines of code from me, basically all I had to code was code for the user interaction.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Anyway, APE seems to be the way to rip off &lt;a href="http://bumptop.com/"&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_1"&gt;BumpTop&lt;/span&gt;&lt;/a&gt; in Flex, or code that air hockey game I've been meaning to write.&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/17393483-9215097111454319021?l=flexmonkey.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://flexmonkey.blogspot.com/feeds/9215097111454319021/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=17393483&amp;postID=9215097111454319021' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/17393483/posts/default/9215097111454319021'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/17393483/posts/default/9215097111454319021'/><link rel='alternate' type='text/html' href='http://flexmonkey.blogspot.com/2008/03/going-ape-in-flex.html' title='Going APE in Flex'/><author><name>Simon Gladman</name><uri>http://www.blogger.com/profile/17449788450837731883</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='28' height='32' src='http://4.bp.blogspot.com/_FGrZThm5JBo/TQ8ZMdgNEUI/AAAAAAAACy4/WGeOchj5VWk/S220/simon_venice.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-17393483.post-5299707689384036849</id><published>2008-03-28T01:42:00.000-07:00</published><updated>2008-03-28T01:50:27.829-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='3D'/><category scheme='http://www.blogger.com/atom/ns#' term='Sandy'/><category scheme='http://www.blogger.com/atom/ns#' term='flashsandy'/><category scheme='http://www.blogger.com/atom/ns#' term='Flex'/><title type='text'>Multiple Scenes in Sandy</title><content type='html'>I was using a Sandy scene as an item renderer in a list control (to allow a user to select from a list of 3D swatches) last night and couldn't figure out why only the first item was rendering. If you ever use multiple Sandy scene objects, you'll experience the same problem: each scene needs a unique name. Inside my list object, I assigned each scene with a unique identifier and everything magically appeared:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;font-size:85%;"&gt;var scene:Scene3D = new Scene3D(&lt;strong&gt;UIDUtil.createUID()&lt;/strong&gt;, this );&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/17393483-5299707689384036849?l=flexmonkey.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://flexmonkey.blogspot.com/feeds/5299707689384036849/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=17393483&amp;postID=5299707689384036849' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/17393483/posts/default/5299707689384036849'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/17393483/posts/default/5299707689384036849'/><link rel='alternate' type='text/html' href='http://flexmonkey.blogspot.com/2008/03/multiple-scenes-in-sandy.html' title='Multiple Scenes in Sandy'/><author><name>Simon Gladman</name><uri>http://www.blogger.com/profile/17449788450837731883</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='28' height='32' src='http://4.bp.blogspot.com/_FGrZThm5JBo/TQ8ZMdgNEUI/AAAAAAAACy4/WGeOchj5VWk/S220/simon_venice.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-17393483.post-5696286631485859623</id><published>2008-03-26T07:26:00.000-07:00</published><updated>2008-03-26T09:01:32.512-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='BitmapData'/><category scheme='http://www.blogger.com/atom/ns#' term='Flex'/><category scheme='http://www.blogger.com/atom/ns#' term='Image'/><title type='text'>Getting BitmapData from an external image</title><content type='html'>Part of wrestling with wooden boxes has been to apply a bitmap to a material. Both 3D libraries use &lt;em&gt;BitmapData&lt;/em&gt; - a class that gives you access to each pixel. So how do we extract this data from non-embedded images?&lt;br /&gt;&lt;br /&gt;Easy - apply the image to an instance of an &lt;em&gt;Image&lt;/em&gt; class, wait for it to complete, then extract the data from the completed &lt;em&gt;Image&lt;/em&gt;.&lt;br /&gt;&lt;br /&gt;Here's an example&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt; &lt;span style="font-size:85%;"&gt; private function assignMaterial():void&lt;br /&gt;  {&lt;br /&gt;   if(creationCompleted &amp;amp;&amp;amp; this.woodTexture != 'null')&lt;br /&gt;   {&lt;br /&gt;    var image:Image=new Image()&lt;br /&gt;    image.x=-500&lt;br /&gt;    image.y=-500&lt;br /&gt;    this.addChild(image)&lt;br /&gt;    image.source=(String(this.woodTexture))&lt;br /&gt;    image.addEventListener(FlexEvent.UPDATE_COMPLETE, imageLoadedHandler)&lt;br /&gt;   }&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;[...]&lt;br /&gt;&lt;br /&gt;  private function imageLoadedHandler(event:Event):void&lt;br /&gt;  {&lt;br /&gt;   var image:Image=Image(event.target)&lt;br /&gt; &lt;br /&gt;   if(image.width &gt; 0)&lt;br /&gt;   {&lt;br /&gt;    var bitmapData:BitmapData&lt;br /&gt;    bitmapData=new BitmapData(image.width,image.height)&lt;br /&gt;    var matrix:Matrix = new Matrix()&lt;br /&gt;    bitmapData.draw(image,matrix)&lt;br /&gt;    var woodMaterial:WhiteShadingBitmapMaterial= new WhiteShadingBitmapMaterial(bitmapData)&lt;br /&gt;    this.removeChild(image)&lt;br /&gt;&lt;br /&gt;   } &lt;br /&gt;  }&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;I'm using the bitmap data to assign to an Away3D WhiteShadingBitmapMaterial - you may have different requirements...&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/17393483-5696286631485859623?l=flexmonkey.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://flexmonkey.blogspot.com/feeds/5696286631485859623/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=17393483&amp;postID=5696286631485859623' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/17393483/posts/default/5696286631485859623'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/17393483/posts/default/5696286631485859623'/><link rel='alternate' type='text/html' href='http://flexmonkey.blogspot.com/2008/03/getting-bitmapdata-from-external-image.html' title='Getting BitmapData from an external image'/><author><name>Simon Gladman</name><uri>http://www.blogger.com/profile/17449788450837731883</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='28' height='32' src='http://4.bp.blogspot.com/_FGrZThm5JBo/TQ8ZMdgNEUI/AAAAAAAACy4/WGeOchj5VWk/S220/simon_venice.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-17393483.post-7237200631951098622</id><published>2008-03-26T05:46:00.000-07:00</published><updated>2008-03-31T05:40:29.371-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='3D'/><category scheme='http://www.blogger.com/atom/ns#' term='Sandy'/><category scheme='http://www.blogger.com/atom/ns#' term='flashsandy'/><category scheme='http://www.blogger.com/atom/ns#' term='Away3D'/><category scheme='http://www.blogger.com/atom/ns#' term='Flex'/><title type='text'>Away3D versus Sandy3D</title><content type='html'>After wrestling with &lt;a href="http://www.flexmonkey.co.uk/BoxBuilder/BoxBuilder.html"&gt;Away3D&lt;/a&gt; for a few weeks, and wishing for a better class of shader, I started playing with Sandy last night. Their Phong material is excellent for rendering flat surfaces, and my first attempt to build a box does look significantly different to my Away3D results:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://flexmonkey.co.uk/sandy/Sandytest.html"&gt;http://flexmonkey.co.uk/sandy/Sandytest.html&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;It also appears to handle intersecting and close meshes much better than Away3D. There are some little z-ordering issues, but it's time to port my old application to Sandy - just a shame that the API's are a million miles apart!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/17393483-7237200631951098622?l=flexmonkey.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://flexmonkey.blogspot.com/feeds/7237200631951098622/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=17393483&amp;postID=7237200631951098622' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/17393483/posts/default/7237200631951098622'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/17393483/posts/default/7237200631951098622'/><link rel='alternate' type='text/html' href='http://flexmonkey.blogspot.com/2008/03/away3d-versus-sandy3d.html' title='Away3D versus Sandy3D'/><author><name>Simon Gladman</name><uri>http://www.blogger.com/profile/17449788450837731883</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='28' height='32' src='http://4.bp.blogspot.com/_FGrZThm5JBo/TQ8ZMdgNEUI/AAAAAAAACy4/WGeOchj5VWk/S220/simon_venice.jpg'/></author><thr:total>4</thr:total></entry></feed>
