<?xml version="1.0" encoding="iso-8859-1"?>
<rss version="2.0">
  <channel>
    <title>Gareth Shapiro London Based Flex/AS3 Freelance Web Developer</title>
    <link>http://www.garethshapiro.com/</link>
    <description>Specialising in the technical aspects of AS3, Flex , Flash and Air. Gareth Shapiro, based in London, provides Consultancy, Production and Training services to UK clients.</description>
    <language>en-us</language>           
    <generator>Nucleus CMS v3.24</generator>
    <copyright>©</copyright>             
    <category>Weblog</category>
    <docs>http://backend.userland.com/rss</docs>
    <image>
      <url>http://www.garethshapiro.com//nucleus/nucleus2.gif</url>
      <title>Gareth Shapiro London Based Flex/AS3 Freelance Web Developer</title>
      <link>http://www.garethshapiro.com/</link>
    </image>
    <item>
 <title>BlackBerry : Flex Marketing Application</title>
 <link>http://www.garethshapiro.com/index.php?itemid=28</link>
<descriptionnnn><![CDATA[<div class='item_list_rightbox'><a href="http://www.garethshapiro.com/media/1/20091113-blackberry_logo.png">BlackBerry Logo</a></div>Like many companies BlackBerry have undertaken sophisticated analysis of the types of people that buy their products and also identified some that don't yet but are likely candidates for the future.  This is of course invaluable information to those responsible for developing marketing campaigns and strategies.  It is the way that BlackBerry has gone about distributing the information internally that is different.<b>Internal Application</b><br />
<br />
Working alongside the team at <a href='http://www.brushfiredesign.net' target='_blank'>Brushfire Design</a> a Flex based standalone application was developed to deliver this research data.  I am bound by an NDA so am limited in what I can say about it (and no screenshots - sorry).  What I will say is using <i>PureMVC</i> the dynamic rich experience that people usually expect of <i>Flex</i> and <i>Flash</i> was leveraged to allow marketing executives to explore the data sections in turn and also compare two sections in a grid format.  <br />
<br />
Much more exciting than your ordinary spreadsheet of facts.  This application delivers the same information in a compelling and exciting way expected by professionals marketing cutting edge technology products, both from within a browser and from the desktop.]]></descriptionnnn>
 <category>Work</category>
<comments>http://www.garethshapiro.com/index.php?itemid=28</comments>
 <pubDate>Sun, 7 Feb 2010 22:29:57 +0000</pubDate>
</item><item>
 <title>The Economist : World In 2010 Flash Infographic</title>
 <link>http://www.garethshapiro.com/index.php?itemid=29</link>
<descriptionnnn><![CDATA[<div class='item_list_rightbox'><a href="http://www.garethshapiro.com/media/1/20090206-economist_logo.png"></a></div>Isn't it great when digital work lasts longer than 5 min?  I recently updated a piece I did exactly a <a href='http://www.garethshapiro.com/item/the-economist-world-in-2009-flash-infographic' target='_blank'>year ago</a> for The Economist's annual World In project.<b>Two for the price of one.  Almost!</b><br />
<br />
In exactly the same format as last year there are two Flash pieces; <i>Countries</i> and <i>Industries</i>.  The structure of the information and assets inside each of the Flash files was also identical and so we were able to use the PHP Code Igniter data capture tool once again and after an afternoon of mainly proof reading everything was updated for 2010 and ready to go.<br />
<br />
<a href="http://www.garethshapiro.com/media/1/20091217-economist_world_in_2010.png">Economist The World In 2010 screen shot</a>]]></descriptionnnn>
 <category>Work</category>
<comments>http://www.garethshapiro.com/index.php?itemid=29</comments>
 <pubDate>Thu, 17 Dec 2009 08:39:18 +0000</pubDate>
</item><item>
 <title>Underwired : Flash Optimisation</title>
 <link>http://www.garethshapiro.com/index.php?itemid=30</link>
<descriptionnnn><![CDATA[<div class='item_list_rightbox'><a href="http://www.garethshapiro.com/media/1/20091127-underwired_logo.png">Underwired Logo</a></div>Underwired are a <a href='http://www.underwired.com' target='blank'>London based ECRM strategy and execution agency</a>.  <br />
<br />
Recently they produced their first Flash site but being <a href='http://www.ecrm.co.uk/' target='blank'>specialists in digital relationship marketing, retention and email marketing</a> and not Actionscript, it was not running as well as it should.  I restructured their site so that it would load quickly while maintaining the clever HTML/Javascript/PHP code they had written to maintain some search engine readable HTML on each page.<a href="http://www.garethshapiro.com/media/1/20091127-underwired_team.jpg">ECRM Website Screenshot</a><br />
<br />
Felix Velarde, Underwired's Managing Director had this to say about it.<br />
<br />
<div class="itemcomment id0"><br />
The site's always been a favourite of journalists, partly because it was Elaine's first piece of Flash and that reflected well on our general standards, and partly because it reflects Underwired's personality. But it was slow. Gareth made it work in the way it was intended to - he's brought the site, literally, up to speed. Fantastic work, done quickly and without fuss - thank you!<br />
</div><br />
<br />
<b>Flash Designer vs Actionscript Developer - Round 1</b><br />
<br />
This situation came about through something I have seen a few times so it is worth noting down.  <i>Graphic Designers</i> and <i>Animators</i> are often drawn to Flash because of the excellent results you can achieve with it.  You can see the great character achieved on this site as a great example.  <br />
<br />
A problem often arises when a site is not set up correctly at the beginning of the project, our brothers and sisters with the creative flair are not always the most structured people.  A great approach is to let a developer set it up; establish the architecture, how things are grouped together, what loads into what and other details far too boring for any self respecting designer to think about.  This will help make the site run and load in the quickest possible time and will increase your chance of being able to change and extend the site at a later stage. ]]></descriptionnnn>
 <category>Work</category>
<comments>http://www.garethshapiro.com/index.php?itemid=30</comments>
 <pubDate>Mon, 30 Nov 2009 11:54:30 +0000</pubDate>
</item><item>
 <title>Body Shop : Flash Shopping Cart</title>
 <link>http://www.garethshapiro.com/index.php?itemid=27</link>
<descriptionnnn><![CDATA[<div class='item_list_rightbox'><a href="http://www.garethshapiro.com/media/1/20091117-body_shop_square_logo_black.png">The Body Shop</a></div>Christmas seems to come around so quickly.  One minute you are enjoying long summer days in the park and the next thing you know you are building Flash based shopping cart applications for Christmas promotions.  Where does the time go?<b>Flash E-commerce</b><br />
<br />
I spent a few days at <a href='http://www.duke-interactive.com/#/en-BG/home-page.html' target='blank'>Duke Interactive</a> recently helping the team there put together a shopping cart for The Body Shop's Christmas Gift Finder.<br />
<br />
<a href="http://www.garethshapiro.com/media/1/20091113-body_shop_e_commerce_1.jpg">Body Shop E-commerce</a><br />
<br />
The application had already been created using <i>PureMVC</i>, which I am a big fan of so I was able to get going really quickly.  My task was to build the cart functionality and all the usual suspects were present; adding items, deleting items, cart totals etc.  There are two versions of the product database driving the application one, for the US market and one for Europe.  Once a customer was ready to move to the check out we collected all of the shopping cart details and seamlessly passed the data to the already established e-commerce system used by The Body Shop.<br />
<br />
<a href="http://www.garethshapiro.com/media/1/20091113-body_shop_e_commerce_2.jpg">Body Shop E-commerce</a><br />
<br />
I really enjoyed my short time working at <a href='http://www.duke-interactive.com/#/en-BG/home-page.html' target='blank'>Duke Interactive, who have done some great digital work for people like Nissan, Levis and PlayStation</a>.  Everyone was super friendly and I felt very welcome there right from the start.<br />
<br />
<br />
<br />
<br />
<br />
]]></descriptionnnn>
 <category>Work</category>
<comments>http://www.garethshapiro.com/index.php?itemid=27</comments>
 <pubDate>Mon, 16 Nov 2009 15:43:48 +0000</pubDate>
</item><item>
 <title>Flash on the Beach 2009</title>
 <link>http://www.garethshapiro.com/index.php?itemid=26</link>
<descriptionnnn><![CDATA[<div class='item_list_rightbox'><a href="http://www.garethshapiro.com/media/1/20090924-fotbbrighton09.gif">Flash on the Beach 2009</a></div>The first part of this week was spent in Brighton attending the 2009 edition of <a href='http://www.flashonthebeach.com/' target='blank'>Flash on the Beach</a>.  I had heard good things about it and I was not disappointed.  I have come away feeling injected with inspiration, something that had been replaced by fatigue after some demanding deadlines recently.  This is filed under 'Work'.  I am not sure it should be, it was way too much fun.<a href="http://www.garethshapiro.com/media/1/20090924-fotb_roof_blue.jpg"></a><br />
<br />
<b>Code vs Design vs Inspire</b><br />
<br />
There were two main things I came away with this year.  I seemed to spend more time listening to inspiration talks from people doing slightly different things to me, sometimes not even Flash.  This made me think about the people in the web industry in general.  Usually this comes down to 'are you a developer?' or 'are you a designer?' type conversation but what I was experiencing here was ideas, images and concepts that were appealling to both sets of folk.  This has left me with a great sense of warmth towards the people in the web.  The nerds are really cool and the cool designer types are really nerdy about things like type faces.  We all love a good adventure or a wonderfully communicated story.  Our heroes are people you can walk up to and talk to and every hour or so I had a new hero to add to the list.<br />
<br />
<b>Nature</b><br />
<br />
The second thing I came away with was everything we are trying to do has been done before.  Even before there was digital, people were messing with big blocks of  colour, injecting a sense of movement into their art and skewing text so it fitted into 3D landscapes.  Even if it we are not intentionally not trying to copy something many of the ideas explored in modern art in the last century have already covered many things that you see on the web.  Perhaps this fits in with the fact the Flash can still not do some of the things Director could years ago?  Then again, tools aren't ideas.  Tools are tools.<br />
<br />
Perhaps it was for this reason that I came away with so many images of nature in my head.  There were many of them presented to us, on big screens or as part of an idea, over the 3 days.  Molecular shapes of water, 3D modeling of sound with sand, balls, even fire so that it ended up looking just like the shapes in the water.  Spiral maps of prime numbers that looked like geometry found in ancient tiling art.  The people talking to us, those at the top of their game, seemed to share this inspiration found in faces, horizons, the weather and the joy of playing.<br />
<br />
<b>Links</b><br />
<br />
Here is a list of people that I saw at the conference and their work or the club houses they hang out in online.<br />
<br />
<ul><br />
<li>Kieth Peters<br/><a href='http://wickedpissahgames.com' target='_blank'>Programming Games</a></li><br />
<li>Chuck Freedman<br/><a href='http://www.getmicrophone.com/' target='_blank'>Capturing Voices</a></li><br />
<li>Mike Jones<br/><a href='http://blog.flashgen.com/' target='_blank'>Flex Spark Components</a></li><br />
<li>Dr Woo Hoo<br/><a href='http://blog.drwoohoo.com/' target='_blank'>Digital Artist</a></li><br />
<li>Hillman Curtis<br/><a href='http://www.hillmancurtis.com/' target='_blank'>Telling Stories</a></li><br />
<li>Joel Gethin Lewis<br/><a href='http://www.joelgethinlewis.com/' target='_blank'>Installed Digital Interactivity / Open Source / Open Frameworks</a><br/><i>Very inspirational</i></li><br />
<li>Grant Skinner<br/><a href='http://gskinner.com/talks/quick/' target='blank'>Optimising Actionscript</a><br/><i> Very useful</i></li><br />
<li>Joa Ebert<br/><a href='http://www.joa-ebert.com/' target='_blank'>Compilers / Machine Code</a><br/><i>What can I say?  What can anyone say?  Joa is is talking and everyone is listening</i></li><br />
<li>Jer Thorp<br/><a href='http://www.blprnt.com/' target='blank'>Data Visualisation / Infographics / Processing / Newspaper APIs</a></li><br />
<li>Joel Baumann<br/><a href='http://www.tomato.co.uk/' target='blank'>Numbers in Art</a></li><br />
<li>Contrast<br/><a href='http://www.contrast.ie/' target='blank'>Unconventional Web Applications</a></li><br />
<li>Craig Swann<br/><a href='http://www.crashmedia.com/' target='blank'>Adventures</a><br/><i>Another very inspirational talk</i></li><br />
<li>Mario Kingemann<br/><a href='http://www.quasimondo.com' target='_blank'>Maths / Patterns</a></li><br />
<li>Colin Moock<br/><a href='http://unionplatform.com/intro.html' target='blank'>Muli-user Experiences / Mobile<a/><br/><i>What a wonderful experience it is to thank someone who has helped you so much</i></li><br />
<li>Andy McDonald<br/><a href='http://www.catdigital.co.uk/' target='blank'>Textile Design with Flash / Illustrator & Photoshop</a></li><br />
<li>Jared Ficklin<br/><a href='http://www.frogdesign.com' target='blank'>Visualisation in Nature & Code</a></li><br />
<li>Joshua Davis<br/><a href='http://www.joshuadavis.com/' target='blank'>Inspiration / Process</a><br/></li><br />
</ul> ]]></descriptionnnn>
 <category>Work</category>
<comments>http://www.garethshapiro.com/index.php?itemid=26</comments>
 <pubDate>Thu, 24 Sep 2009 18:18:09 +0000</pubDate>
</item><item>
 <title>University of Kent : Industrial Panel 2009</title>
 <link>http://www.garethshapiro.com/index.php?itemid=25</link>
<descriptionnnn><![CDATA[<div class='item_list_rightbox'><a href="http://www.garethshapiro.com/media/1/20090920-university_of_kent_logo.gif">University of Kent logo</a></div>When Actionscript 3 first arrived on the scene I was asked to introduce the technology to a lecturer at the University of Kent so that it could be incorporated into their syllabus.  At the end of the two days I was asked if I wanted to be a member of the School of Engineering and Digital Arts Multimedia, Technology & Design Industrial Panel, and I signed up immediately.  <div style='float: left; width 153px; padding: 3px; border: 1px dotted #CCCCCC; margin-right: 10px'><a href="http://www.garethshapiro.com/media/1/20090920-kent_uni_campus_small.jpg">University of Kent campus</a></div><b>Plans for 2010</b><br />
<br />
Panel members come from a wide range of new media business interests in Kent and London and meet once a year to provide some commercial perspective on the direction of the <a href='http://www.eda.kent.ac.uk/undergraduate/ug_multimedia.aspx' target='_blank'>Bsc in Multimedia Technology and Design Course</a>.  This year we learnt of the plans to invigorate this course which incorporates design , technology and software engineering.  The faculty have been putting a lot of thought into how the two worlds of developers and designers can both be explored by students who might not quite know where their strength lies when they first begin studying.  <br />
<br />
The university is keen to increase the engagement with us and we discussed members giving lectures, master classes and mentoring students on the course.  Quite exciting and it seems a worthwhile activity to be putting something back into an industry which I love so much.  Also the train ride down to Cantebury is great on a bright day.<br />
<br />
<b>Interaction Lab</b><br />
<br />
We also learnt about the department's ideas on establishing an Interaction Lab which could provide services to web companies in the South East.  The response was very favorable from those attending and I am really looking forward to seeing the lab in one of my future visits.<br />
<br class='clear_both'/><b>Knowledge Transfer Partnerships</b><br />
<br />
The department is a big fan of Knowledge Transfer Partnerships and we were presented with the outline to what seems a very decent way for companies to subsidise projects, while providing invaluable work experience to students looking for that sometimes elusive first rung on the ladder.  If you have a project that could so with some extra hands, and help with funding you could do worse than learning more about <a href='http://www.ktponline.org.uk/' target='_blank'>Knowledge Transfer Partnerships (KTP)</a>.<br />
<br />
]]></descriptionnnn>
 <category>Work</category>
<comments>http://www.garethshapiro.com/index.php?itemid=25</comments>
 <pubDate>Sun, 20 Sep 2009 17:08:15 +0000</pubDate>
</item><item>
 <title>The Economist : Interactive Flex Chart</title>
 <link>http://www.garethshapiro.com/index.php?itemid=24</link>
<descriptionnnn><![CDATA[<div class='item_list_rightbox'><a href="http://www.garethshapiro.com/media/1/20090206-economist_logo.png"></a></div>If you have been following the posts on this blog you will know about a ”proof of concept” prototype I built for The Economist earlier in the year.  This post is about the refinement of that work into online interactive content now <a href='http://www.economist.com/houseprices' target='blank'>published on The Economist website<a/>.<div style="text-align: center"><a href="http://www.garethshapiro.com/media/economist/hpi_2/hpi_3.gif"></a></div><br />
<b>User Interface Design</b><br />
<br />
Aesthetically the main challenge for graphic designers at The Economist was creating an interface that fitted into a small space and the refinements from the prototype achieved that quite well.  A feature that enhanced the usability immeasurably is the inclusion of the ability of the user to preview how data would appear on the chart by rolling over a country.  Should the user then decide to add this country to the chart this is achieved with a single click.<br />
<br />
<div style="text-align: center"><a href="http://www.garethshapiro.com/media/economist/hpi_2/hpi_4.gif"></a></div><br />
<b>Flex 3 Components</b><br />
<br />
Using this approach instead of two columns of country names helped save a great deal of space.  The previewing did bring with it a set of challenges though, isn't it always the case?  On the horizontal bar chart, a scroll bar is employed so that as many countries as the user wishes can be compared.  Typically issues that should be trivial, such as ensuring the scroll bar remains completely scrolled down, took more effort than it should have done.  I hope Flex 4 scrollbars are an improvement on the Flex 3 variety as it is such an often employed interface component.<br />
<br />
<div style="text-align: center"><a href="http://www.garethshapiro.com/media/economist/hpi_2/hpi_5.gif"></a></div><br />
<b>Flex Data Visualisation Library</b><br />
<br />
Again I decided on using <a href='http://flare.prefuse.org/' target='blank'>Flare, an AS3 visualisation library</a> used in many online infographic projects, although I did experiment with <a href='http://www.axiis.org/' target='blank'>Axiis</a> in between stages 1 and 2 to see if any benefits could be gained.  Ultimately Flare, while still in Alpha amazingly enough, is feature rich and the library seems more mature than its short life-span belies.  Axiis, based on Degrafa, may grow to eclipse it though as it is the brain child of <a href='http://www.twgonzalez.com/blog/' target='blank'>Tom Gonzalez</a> and <a href='http://michaelvandaniker.com/blog/' target='blank'>Michael VanDaniker</a> who are no strangers to the world of data visualisation.  Watch that space! <br />
<br />
Back to the project at hand though.  Something to consider when using Flare is that it seems to be just as capable of producing visualisations based on “forced directed” or “radial” layouts, for example, as it does straight forward line and bar charts.  As such some customisations were needed to achieve details such as scales that suit economic data that haven't been considered in this general purpose library.<br />
<br />
This is certainly not the last time I will be using Flare with Flex and PureMVC, everyday more and more information with a story to tell becomes available to us after all. <br />
<br />
Watch this space!]]></descriptionnnn>
 <category>Work</category>
<comments>http://www.garethshapiro.com/index.php?itemid=24</comments>
 <pubDate>Thu, 17 Sep 2009 18:03:28 +0000</pubDate>
</item><item>
 <title>Luxury Fashion Brand : Flash Website</title>
 <link>http://www.garethshapiro.com/index.php?itemid=23</link>
<descriptionnnn><![CDATA[<div class='item_list_rightbox'><a href="http://www.garethshapiro.com/media/1/20090720-fashion.jpg"></a></div>Due to business details behind this website I am unable to say for exactly which luxury fashion brand this work was for.  It's a shame really because they are well known in UK and Europe for their dresses, suits, sunglasses and especially men and woman's perfume ranges.  <br />
<br />
On the plus side I had an amazing time working on this website with some really cool people.  The Project Manager, Amell Benzerfa, on the job agreed to say some words about my work that I can share with you here....<div class="itemcomment id0"><br />
Gareth was hired as a freelance experienced Flash AS3 developer to work on a website for a very demanding luxury fashion brand. He was able to come into the project and tackle the job efficiently and deliver to the required high standards. He was also a great communicator who was able to clearly express complex technical issues and give timely and accurate feedback and he acted as a great mentor to the Flash team. I certainly enjoyed working with him as did the client and the rest of the team. I definitely recommend him highly and would welcome the opportunity to work with him again.<br />
</div><br />
<br />
Kinds words and I can assure you that the feeling is mutual.  Amell runs a great team of Actionscript and Python developers at <a href='http://www.tangentone.com/' target='blank'>Tangent One</a> who do great work.  They have a number of high profile multilingual websites in their portfolio including <a href='http://www.borders.co.uk' target='blank'>Borders</a>, <a href='http://www.purpleronnie.com/' target='_blank'>Purple Ronnie</a> and rather shy fashion houses.  <br />
<br />
I am confident we shall combine forces again in the not too distant future.<br />
<br />
<br />
]]></descriptionnnn>
 <category>Work</category>
<comments>http://www.garethshapiro.com/index.php?itemid=23</comments>
 <pubDate>Mon, 20 Jul 2009 14:43:01 +0000</pubDate>
</item><item>
 <title>The Economist : Interactive Flex Data</title>
 <link>http://www.garethshapiro.com/index.php?itemid=22</link>
<descriptionnnn><![CDATA[<div class='item_list_rightbox'><a href="http://www.garethshapiro.com/media/1/20090206-economist_logo.png"></a></div>The Economist put forward the idea that an interactive chart to display some of their data over different time spans would be a great piece of content for their website.  What better technology is there for web based interactive charting than Flex? Especially when there are brilliant third party libraries of code developed to achieve just that, such as <a href="http://flare.prefuse.org/">Flare</a>.<div style="text-align: center"><a href="http://www.garethshapiro.com/media/economist/hpi/hpi_1.gif"></a></div><br />
This project has been divided into two stages and the first “proof of concept” stage is what this post is about.  One of the great things about working with this client is their data is in great shape.  There were none of the endless days of working with Excel to get a decent, coherent data set together that seems to plague many data driven web projects.  I was able to get the data normalised and imported into a MySQL database in no time.<br />
<br />
As with many of my recent projects I chose PureMVC as the Flex framework.  I am really refining my processing using PureMVC these days. Common production details such as different paths on the development and final servers and also bulk loading of assets are handled easily.<br />
<br />
The real challenge with this project came in using the Flare library. As a tool for plotting graphical representation of information it is fantastic although with a limited amount of documentation available it takes a little bit of determination to get results.  I must admit that perhaps AS3 developers have been spoilt by Adobe with their excellent language references and everything else is judged against it.<br />
<br />
Once the piece was ready to deploy I wrote a small amount of PHP to export the database as an XML file.  A small change was needed on the PureMVC model so that the new data source could deliver the same information to the application and the job was done.<br />
<br />
<div style="text-align: center"><a href="http://www.garethshapiro.com/media/economist/hpi/hpi_2.gif"></a></div>]]></descriptionnnn>
 <category>Work</category>
<comments>http://www.garethshapiro.com/index.php?itemid=22</comments>
 <pubDate>Wed, 29 Apr 2009 11:46:43 +0000</pubDate>
</item><item>
 <title>Flash Actionscript 3 : ViewBuffer</title>
 <link>http://www.garethshapiro.com/index.php?itemid=21</link>
<descriptionnnn><![CDATA[<div class='item_list_rightbox'><a href="http://www.garethshapiro.com/media/1/adobe_flash.png"></a></div>At the end of 2008 I worked on a Flash project for The Economist called 'The World in 2009'.    There was a graphic designer who was responsible for producing a world map vector and I wired it all up.  <br />
<br />
As you can imagine this artwork was intricate.  Each country had a border and a background colour that were separate objects, some text fields for labels, and as you would expect also grouped into continents.  The designer was using Adobe Illustrator to create the vector shapes and importing these into Flash and sending me the .fla<br />
<br />
The process was not very smooth.  There were changes to the artwork of course, Illustrator does not create MovieClips in the same way that you would manually and also when dealing with such an complex piece, old fashioned user error creeps in.<b>The Solution, ViewBuffer</b><br />
<br />
<a href="http://www.garethshapiro.com/media/downloads/ViewBuffer.as.zip">Download</a><br />
<br />
This made life a little difficult for me while developing the Actionscript 3 code.  The artwork was divided into regions so the files were easier to work with for the designer.  I would load each one using a Loader() class and attach it to the Display List.  I could reference the various objects, outlines / text fields / background colour clips,  inside them like so : <br />
<br />
<a href="http://www.garethshapiro.com/media/viewbuffer/as3_viewbuffer_1.png">Get a reference to a MovieClip inside a loaded SWF (The hard way)!!</a><br />
<br />
It is easy to see why this is not a good situation to be in.  One change to the structure and my paths would stop working.  There were also further complications with instance names which caused the same problem.  This is similar to how paths are constructed in Actionscript 2, with dot notation, so what is the best way of doing the same thing in Actionscript 3?<br />
<br />
The bottom line is I do not want to be hamstrung by changes either by the Art Director or the Graphic Designer on the project.  Changes are always going to happen and I looked to find a solution that simply accommodated them.  One of the greatest things about AS3 is the Display List structure.  The way that Display Objects are children of DisplayObjectContainers means that  we can automatically examine this structure, or part of it, and record each of the items in an Array.<br />
<br />
The ViewBuffer takes care of the path and presents the items to us in a straight forward list.  <br />
<br />
I will assume you know how to import packages into your AS3 projects so won't go into that in detail.  Obviously you need this line at the top of the code : <br />
<br />
<a href="http://www.garethshapiro.com/media/viewbuffer/as3_viewbuffer_2.png">Make sure you have access to the Class</a><br />
<br />
Once you have access to the ViewBuffer you need to make an instance of one : <br />
<br />
<a href="http://www.garethshapiro.com/media/viewbuffer/as3_viewbuffer_3.png">Create a new ViewBuffer</a><br />
<br />
Let's say that once again you have a Loader called europe_clip_loader and you have added to the the display list, your next step would be to to inspect it : <br />
<br />
<a href="http://www.garethshapiro.com/media/viewbuffer/as3_viewbuffer_4.png">&lt;br /&gt;
Inspect the top element of the Display List that we are interested in</a><br />
				<br />
In the above line of code the parameter is compulsory and it has to be a DisplayObjectContainer.  The reason I have called the DisplayObjectContainer you are inspecting a ViewComponent is that I am a massive fan of <a href="/tag/puremvc">PureMVC</a> and this is what they are called in that framework.  It seems to make sense because in Flex you would divide Views up into separate MXML files and they may not be on the Display List when you inspect them for the ViewBuffer.  Once you have inspected your ViewComponent you then use the instance name of the items in the ViewBuffer to get reference to them. <br />
<br />
<a href="http://www.garethshapiro.com/media/viewbuffer/as3_viewbuffer_5.png">Get a reference to a MovieClip inside a loaded SWF (The easy way)!!</a><br />
<br />
If this MovieClip gets moved around then no problem your code will still work.  If the instance name gets removed or changed then some more work is needed.  Perhaps the person creating the .fla file names the MovieClip incorrectly and calls it 'country_russia' (without the _mc) on the end.   <br />
<br />
<b>Taking a Look</b><br />
<br />
What you would do is first look at the buffer list to see the instance names of the items on there.  This is done like so : <br />
<br />
<a href="http://www.garethshapiro.com/media/viewbuffer/as3_viewbuffer_6.png">Output the ViewBuffer to the Output panel</a><br />
<br />
The first parameter of the showBufferList method is the function you want to use to display.  Here we are using the built in trace() method.  Do not put the brackets on, just the name of the function, just like an event handler.  The second parameter is optional and is a String.  This is the property of the item that you would like displayed.  The most useful is “name” but you may want to use “alpha” , “x” or “y” to tell you more details.  If you use one of the other properties then the name is also outputted to give you better results.<br />
<br />
I use a great debugging tool for Flash and Flex developing called <a href="http://code.google.com/p/flash-thunderbolt/" target='_blank'>Thunderbolt</a>.  This bit of code will output to Firebug, the web developer plug in for Firefox.  If you are using this technique you would show the details of the buffer list like so :<br />
<br />
<a href="http://www.garethshapiro.com/media/viewbuffer/as3_viewbuffer_7.png">&lt;br /&gt;
Output the ViewBuffer to Firebug</a><br />
<br />
Great but you may run into problems if after you have made up your ViewBuffer you remove or add an item and then try to reference it using getBufferListItemByName().  <br />
<br />
<b>Adding and Removing Items</b><br />
<br />
You can keep the ViewBuffer in synch by using addViewBufferItem() and removeViewBufferItem().<br />
<br />
These both work in exactly the same way  :<br />
<br />
<a href="http://www.garethshapiro.com/media/viewbuffer/as3_viewbuffer_8.png">Add a new item</a><br />
<br />
This will add item as a child of item_parent to both the Display List and the View Buffer.  Similarly with removing items : <br />
<br />
<a href="http://www.garethshapiro.com/media/viewbuffer/as3_viewbuffer_9.png">Remove an item</a><br />
<br />
This will remove item from both the Display List and the View Buffer.<br />
<br />
In both these examples item_parent needs to be a DisplayObjectContainer and item a DisplayObject.<br />
<br />
<b>Advanced Techniques</b><br />
<br />
This is quite a straight forward piece of code so there is only one Advanced Technique.  If you would like to exclude certain data types from the ViewBuffer you can specify these when you inspect the ViewComponent.  The second parameter of the ViewBuffer is an Array of Data Types to be excluded.<br />
<br />
<a href="http://www.garethshapiro.com/media/viewbuffer/as3_viewbuffer_10.png">Exclude StaticText and Shape Data Types from the ViewBuffer</a><br />
<br />
The reason for this is perhaps you are not interested in administering static items and you are trying make sure your swf performs as quickly as possible.  You may also be using a framework such as PureMVC where you have a different class for each View and you do not want global access to the items in other Views across all of the ViewBuffers in your application.<br />
<br />
I am sure this code can be improved, I have deliberately kept it from being too complicated.  If you do use it, or better yet, improve it please let me know and I'll incorporate the improvements for everyone.<br />
<br />
<a href="http://www.garethshapiro.com/media/downloads/ViewBuffer.as.zip">Download</a>]]></descriptionnnn>
 <category>Code</category>
<comments>http://www.garethshapiro.com/index.php?itemid=21</comments>
 <pubDate>Tue, 28 Apr 2009 11:56:42 +0000</pubDate>
</item>
  </channel>
</rss>