<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>We Love... &#187; AS3</title>
	<atom:link href="http://www.welove72.com/blog/tag/as3/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.welove72.com/blog</link>
	<description>this is the lighter side of we love... opinions, news, fun stuff, our friends and partners. enjoy, comment and spread the love...</description>
	<lastBuildDate>Wed, 01 Feb 2012 11:13:10 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.4</generator>
		<item>
		<title>Flash geek post on getDefinitionByName</title>
		<link>http://www.welove72.com/blog/2010/03/flash-geek-post-on-getdefinitionbyname/</link>
		<comments>http://www.welove72.com/blog/2010/03/flash-geek-post-on-getdefinitionbyname/#comments</comments>
		<pubDate>Mon, 15 Mar 2010 14:52:23 +0000</pubDate>
		<dc:creator>Joe Blog</dc:creator>
				<category><![CDATA[We Love... Innovation]]></category>
		<category><![CDATA[We Love... Technology]]></category>
		<category><![CDATA[AS3]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[getDefinitionByName]]></category>

		<guid isPermaLink="false">http://www.welove72.com/blog/?p=2857</guid>
		<description><![CDATA[Found this little gem of a util whilst working on an extendable list view data grid in AS3. Saved most of my hair from being pulled out too. So what is getDefinitionByName and what can it do: Situation You have a display object that you have exported from your Flash library. Let&#8217;s call it StarIcon.&#160;<a href="http://www.welove72.com/blog/2010/03/flash-geek-post-on-getdefinitionbyname/">Read more</a>]]></description>
			<content:encoded><![CDATA[<p>Found this little gem of a util whilst working on an extendable list view data grid in AS3. Saved most of my hair from being pulled out too. So what is getDefinitionByName and what can it do:<br />
<a href="http://www.welove72.com/blog/wp-content/uploads/2010/03/code.jpg"><img class="alignnone size-medium wp-image-2911" src="http://www.welove72.com/blog/wp-content/uploads/2010/03/code-300x189.jpg" alt="" width="300" height="189" /></a><br />
<span id="more-2857"></span><br />
<strong>Situation</strong><br />
You have a display object that you have exported from your Flash library. Let&#8217;s call it StarIcon. You want to use this in a class that displays multiple instances of icons that specify when creating a instance of that class. In this situation, my class (ratingClass) will show the starIcon as a rating system. So we could have loads of these stars being created when using this class.</p>
<p><strong>The problem</strong><br />
When you create an instance of the ratingClass you can setup a new StarIcon in its constructor. Then use that StarIcon as many times as you need. This compiles fine, but then on running your little rating app you find that only one StarIcon is showing. What&#8217;s up with that!?</p>
<p><strong>The Cause</strong><br />
When you created the instance of ratingClass, you passed that StarIcon with it. That was just one new instance of the StarIcon. So your ratingClass is just referencing the StarIcon and that&#8217;s why there is only one.</p>
<p><strong>Workarounds</strong><br />
For each item you want to rate, you could create a new array of new StarIcons when creating a new constructor. That could be 5 new StarIcons for each item, which seems a waste as you may only use 2 icons.</p>
<p>Or</p>
<p>Get your ratings class to load new StarIcons as and when it needs. So you are effectively hardcoding a display object into your class. This means you lose some extendibility of your class.</p>
<p><strong>Solution</strong><br />
Ok, I took a long time getting to the point of this blog, but we are here now.<br />
getDefinitionByName allows you to specify a class name in a string and then create new instances of that class.<br />
For example, in our rating system I pass a string of the StarIcon class (var my_icon:String = &#8220;StarIcon&#8221;) during my ratingClass constructor. When I need to display a new StarIcon, I create a new Class definition using getDefinitionByName(my_icon) as Class. Now I have my definition, I can use it to create an instance of my StarIcon (var icon:Sprite = (new icondef() ) as Sprite;<br />
Add the icon to the display stack and you can now create as many icons as you need. Below is the full code example:</p>
<p><code>//*** Main document class **<br />
public class Films extends Sprite<br />
{<br />
public function Films():void<br />
{<br />
// declare a new rating of a film (Film name, rating icon, films rating out of 5)<br />
var rating:Rating = new Rating("A few good men", StarIcon, 1)<br />
addChild(rating);<br />
}<br />
}</code></p>
<p>// *** Rating Class ***</p>
<p>import flash.utils.getDefinitionByName;</p>
<p>public class Rating extends Sprite<br />
{<br />
public function Rating(fileName:String, theIcon:String, itsRating:Number):void<br />
{<br />
// There would be a lot of code here to setup the film name and position it correctly. But for this example<br />
// we just need the icon code</p>
<p>// First we need to create our definition class, which will hold our icon<br />
var ratingIcon:Class = getDefinitionByName(theIcon) as Class;<br />
// Thats it, one line of code &#8211; really easy. Next we use the ratingIcon to create an instance of an icon we<br />
// can use<br />
var myIcon:Sprite = ( new ratingIcon() ) as Sprite;<br />
// Because ratingIcon is just class we need to specify the instance as a sprite.<br />
// Now we have an icon we can use. So let add it to the display stack<br />
addChild(myIcon);<br />
// Done! Since this system would require as many icons as the film is rated, you would need to put the<br />
// code in a loop and store your icons in an array.<br />
}<br />
}</p>
<p>This saves a lot of time creating new instances of an icon and passing it to a class constructor. Saved me pulling my hair out too!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.welove72.com/blog/2010/03/flash-geek-post-on-getdefinitionbyname/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Front-End Developers Wanted Again&#8230;</title>
		<link>http://www.welove72.com/blog/2009/11/front-end-developers-wanted-again/</link>
		<comments>http://www.welove72.com/blog/2009/11/front-end-developers-wanted-again/#comments</comments>
		<pubDate>Fri, 27 Nov 2009 15:25:50 +0000</pubDate>
		<dc:creator>the_hoskinator</dc:creator>
				<category><![CDATA[We Love... News]]></category>
		<category><![CDATA[We Love... Talent]]></category>
		<category><![CDATA[actionscript]]></category>
		<category><![CDATA[AS3]]></category>
		<category><![CDATA[bzr]]></category>
		<category><![CDATA[Creative]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[developers]]></category>
		<category><![CDATA[Digital]]></category>
		<category><![CDATA[end]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[front]]></category>
		<category><![CDATA[git.]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[job]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[svn]]></category>
		<category><![CDATA[talent]]></category>

		<guid isPermaLink="false">http://www.welove72.com/blog/?p=1745</guid>
		<description><![CDATA[We are on the hunt for Front End Developers again! We Love is a fresh take on what a creative design agency can be. Small but focused, driven and creative we design and produce unique digital solutions for a diverse range of international clients. We feel that the people that work for We Love are&#160;<a href="http://www.welove72.com/blog/2009/11/front-end-developers-wanted-again/">Read more</a>]]></description>
			<content:encoded><![CDATA[<p><strong>We are on the hunt for Front End Developers again!</strong></p>
<p>We Love is a fresh take on what a creative design agency can be. Small but focused, driven and creative we design and produce unique digital solutions for a diverse range of international clients. We feel that the people that work for We Love are its most important assets. In fact, they are the DNA of the company.</p>
<p><strong>Skill sets and Personality:</strong> You should ooze talent, have vision and can code the ass off Kylie. You know your way around flash and can animate better than the Warner Brothers, ActionScript better than Cyborg, as well as being willing to prove yourself in a growing, fast paced industry.</p>
<p>We won&#8217;t tie you down to PureMVC or any other framework &#8211; good OO design principles and high code standards are all that&#8217;s required. AS3, PHP/Python and a good knowledge of HTML/CSS a must &#8211; anything else will be a bonus and knowledge of the Gaia flash framework is favourable.</p>
<p>You use BZR/SVN/GIT regularly and have experience with issue tracking apps like Trac. You are someone who is mature enough to understand a brief, and can take direction as well as contribute and show initiative.</p>
<p>You must have a couple of years experience behind you and be Mac happy and PC proud.</p>
<p><strong>Benefits</strong>: We Love offer an excellent benefits package which includes performance based bonuses and personal development budgets as well as the opportunity to grow and learn whilst working on leading edge and exciting creative projects.</p>
<p><strong>Salary</strong>: Competitive Salary</p>
<p><strong>Location:</strong> A beautiful Manor House in Maidstone, Kent, near mainline train stations.</p>
<p>If you think We Love is the place for you then email <a href="mailto: gavin@welove72.com">gavin@welove72.com</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.welove72.com/blog/2009/11/front-end-developers-wanted-again/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Loading classes from an external swf using ApplicationDomain</title>
		<link>http://www.welove72.com/blog/2009/07/loading-classes-from-an-external-swf-using-applicationdomain/</link>
		<comments>http://www.welove72.com/blog/2009/07/loading-classes-from-an-external-swf-using-applicationdomain/#comments</comments>
		<pubDate>Tue, 28 Jul 2009 17:46:46 +0000</pubDate>
		<dc:creator>villaaston</dc:creator>
				<category><![CDATA[We Love... Technology]]></category>
		<category><![CDATA[AS3]]></category>
		<category><![CDATA[as3 application domain]]></category>
		<category><![CDATA[external swf]]></category>
		<category><![CDATA[load classes from external swf]]></category>

		<guid isPermaLink="false">http://www.welove72.com/blog/?p=1250</guid>
		<description><![CDATA[Loading classes from external swfs can be very useful, especially as the size complexity of Flash and Flex applications are increasing. Including all the various tweening, 3D and util libraries can result in a very large swf file. Flash player 8.5 and above features a nifty API to dynamically load swfs and their classes at&#160;<a href="http://www.welove72.com/blog/2009/07/loading-classes-from-an-external-swf-using-applicationdomain/">Read more</a>]]></description>
			<content:encoded><![CDATA[<p>Loading classes from external swfs can be very useful, especially as the size complexity of Flash and Flex applications are increasing. Including all the various tweening, 3D and util libraries can result in a very large swf file. Flash player 8.5 and above features a nifty API to dynamically load swfs and their classes at runtime, using the Loader and ApplicationDomain classes.</p>
<pre>package com.welove72 {

     import flash.display.Sprite;

     public class Tracer extends Sprite {
          public function Tracer():void { }
          public function traceThis(strMessage:String):void {
               trace(strMessage);
          }
     }
}</pre>
<p>First, we create a simple class that includes a method traceThis to trace a message to the console. Add the code above to a new actionscript file called â€œTracer.asâ€ and save in the folder com/welove72. Create a new FLA and set the above class as the document class, â€œcom.welove72.Tracerâ€. Save the file as Tracer.fla and hit Ctrl+Enter to create an swf.</p>
<pre>package {
     import flash.display.Loader;
     import flash.net.URLRequest;
     import flash.events.Event;
     import flash.display.LoaderInfo;
     import flash.display.MovieClip;
	import flash.system.ApplicationDomain;
	import flash.system.LoaderContext;

     public class Main extends MovieClip {
          public function Main():void {
               var loader:Loader = new Loader();
			   var ldrContext:LoaderContext = new LoaderContext(false,
ApplicationDomain.currentDomain);
               loader.contentLoaderInfo.addEventListener(Event.COMPLETE, onComplete);
               loader.load(new URLRequest('Tracer.swf'), ldrContext);
          }
          private function onComplete(evt:Event):void {
               var tracerClass:Class = ApplicationDomain.currentDomain.getDefinition
("com.welove72.Tracer") as Class;
               var myTracer:* = new tracerClass();
               myTracer.traceThis('Loaded a class!');
          }
     }
}</pre>
<p>Add the code above to a new actionscript file called â€œMain.asâ€. Create another fla in the same location and save as Main.fla. Set Main as the document class, test the fla and you should see a message from the loaded Tracer class!</p>
<p><strong>This tip and others from We Love are in the latest issue of <a href="http://www.webdesignermag.co.uk/" target="_blank">Web Designer Magazine</a> in the article &#8220;55 Pro Flash Tips&#8221;! Look out for Gavin Clark.</strong></p>
]]></content:encoded>
			<wfw:commentRss>http://www.welove72.com/blog/2009/07/loading-classes-from-an-external-swf-using-applicationdomain/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>F/E Developer and a Snr Designer wanted to join us</title>
		<link>http://www.welove72.com/blog/2009/07/fe-developer-and-a-snr-designer-wanted-to-join-us/</link>
		<comments>http://www.welove72.com/blog/2009/07/fe-developer-and-a-snr-designer-wanted-to-join-us/#comments</comments>
		<pubDate>Thu, 23 Jul 2009 12:40:15 +0000</pubDate>
		<dc:creator>d_noodle</dc:creator>
				<category><![CDATA[We Love... News]]></category>
		<category><![CDATA[We Love... Talent]]></category>
		<category><![CDATA[ajax]]></category>
		<category><![CDATA[AS3]]></category>
		<category><![CDATA[creative agency]]></category>
		<category><![CDATA[digital designer]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Front End Developer]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[Jobs Open]]></category>
		<category><![CDATA[Kent]]></category>
		<category><![CDATA[New opportunities at We Love]]></category>
		<category><![CDATA[recruitment]]></category>

		<guid isPermaLink="false">http://www.welove72.com/blog/?p=1260</guid>
		<description><![CDATA[We are now looking for a couple of talents to join our family at the fast growing and creatively focused agency &#8211; We Love. Based in Maidstone, in a Manor House overlooking the river Medway, we strive to put the love back into the creative process &#8211; developing ideas that work through the line for&#160;<a href="http://www.welove72.com/blog/2009/07/fe-developer-and-a-snr-designer-wanted-to-join-us/">Read more</a>]]></description>
			<content:encoded><![CDATA[<p>We are now looking for a couple of talents to join our family at the fast growing and creatively focused agency &#8211; We Love.</p>
<p>Based in Maidstone, in a Manor House overlooking the river Medway, we strive to put the love back into the creative process &#8211; developing ideas that work through the line for a varied mix of clients and getting shortlisted for and winning recognition awards for our efforts.</p>
<p>We are looking for talented individuals who are top of their game, who want the ownership of a project, who want to prove what they are capable of&#8230;</p>
<p>So if you are bored of being over managed, bored of banging out a million banners for a single client, bored of being told what to do by an excel sheet each day and have something to prove in this industry of ours then apply to:</p>
<p>work@welove72.com.</p>
<p>We are currently looking for:</p>
<p>Snr Digital Designer with agency experience with a good spread of work. Someone who can understand a brief, with good business acumen, concept and generate ideas which push the boundaries. An individual who knows when a design is perfectly balanced and right for the market, understand the interaction, see the animation and speak about everything with authority. And can own a project right start to finish.</p>
<p>Front End Developer with a few years under their belt. Can AS3 the ass off Kylie, HTML like a loon and AJAX it with the best of them. A talent who understand the importance of pixel perfectness in a build, Who can suggest, direct and manage a build, making it his own. Someone who is proud of creating beautiful code.</p>
<p>If you are one of these people and are looking to step it up then apply. If you know of people in your network please spread this mail&#8230;</p>
<p>Many thanks<br />
Mark</p>
]]></content:encoded>
			<wfw:commentRss>http://www.welove72.com/blog/2009/07/fe-developer-and-a-snr-designer-wanted-to-join-us/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Track flash events in google analytics</title>
		<link>http://www.welove72.com/blog/2009/07/track-flash-events-in-google-analytics/</link>
		<comments>http://www.welove72.com/blog/2009/07/track-flash-events-in-google-analytics/#comments</comments>
		<pubDate>Wed, 22 Jul 2009 22:59:53 +0000</pubDate>
		<dc:creator>villaaston</dc:creator>
				<category><![CDATA[We Love... Technology]]></category>
		<category><![CDATA[AS3]]></category>
		<category><![CDATA[flash analytics]]></category>
		<category><![CDATA[google analytics]]></category>
		<category><![CDATA[stats]]></category>

		<guid isPermaLink="false">http://www.welove72.com/blog/?p=1245</guid>
		<description><![CDATA[This relatively easy method is especially useful as it does not require your file to be included in a HTML page, as many other techniques do. Download the AnalyticsLibrary component here: http://code.google.com/p/gaforflash/downloads/list and follow the instructions in the readme.txt file to install the Flash component. Create a new flash file called Tracker.fla and an actioscript&#160;<a href="http://www.welove72.com/blog/2009/07/track-flash-events-in-google-analytics/">Read more</a>]]></description>
			<content:encoded><![CDATA[<p>This relatively easy method is especially useful as it does not require your file to be included in a HTML page, as many other techniques do.</p>
<p>Download the AnalyticsLibrary component here: <a href="http://code.google.com/p/gaforflash/downloads/lis" target="_blank">http://code.google.com/p/gaforflash/downloads/list</a> and follow the instructions in the readme.txt file to install the Flash component.</p>
<p>Create a new flash file called Tracker.fla and an actioscript file called Tracker.as. When installed correctly you can drag the  AnalyticsLibrary component from the components panel into your fla&#8217;s library. Add the following code to your Analytics.as file.</p>
<pre>package {

Â Â Â  import com.google.analytics.AnalyticsTracker;
Â Â Â  import com.google.analytics.GATracker;
Â Â Â  import flash.display.MovieClip;

Â Â Â  public class Tracker extends MovieClip {

Â Â Â  Â Â Â  private var tracker:AnalyticsTracker;

Â Â Â  Â Â Â  public function Tracker():void
Â Â Â  Â Â Â  {
Â Â Â  Â Â Â  Â Â Â  tracker = new GATracker( this, "UA-111-222", "AS3", true );
Â Â Â  Â Â Â  Â Â Â  tracker.trackPageview("/initial-load");
Â Â Â  Â Â Â  }
Â Â Â  }
}</pre>
<p>First import the two analytics libraries we will be using, AnalyticsTracker and GATracker. Then we create a new instance of the AnalyticsTracker, which needs four paramaters:</p>
<ul>
<li>The current display object (â€œthisâ€)</li>
<li>Your analytics account ID (â€œUA-111-222â€)</li>
<li>The tracking mode, either Bridge or AS3.</li>
<li>The debug mode. This defines whether helpful messages will be displayed for errors. You should set this to true when testing and false when your application is live.</li>
</ul>
<p>Finally, the trackPageview method creates a new page view on your google analytics account. This method can of course be placed inside a button click method or similar. To test, enter Tracker as the document class on Tracker.fla and press Ctrl+Enter to test the movie. See the results below:</p>
<p><a href="http://www.welove72.com/blog/wp-content/uploads/2009/07/results.jpg"><img class="aligncenter size-full wp-image-1246" src="http://www.welove72.com/blog/wp-content/uploads/2009/07/results.jpg" alt="" width="491" height="101" /></a></p>
<p>If anyone needs it I can also upload the source!</p>
<p>Happy tracking</p>
<p><strong>This tip and others from We Love are in the latest issue of <a href="http://www.webdesignermag.co.uk/" target="_blank">Web Designer Magazine</a> in the article &#8220;55 Pro Flash Tips&#8221;! Look out for Gavin Clark.</strong></p>
]]></content:encoded>
			<wfw:commentRss>http://www.welove72.com/blog/2009/07/track-flash-events-in-google-analytics/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Freelance Flash Developer needed</title>
		<link>http://www.welove72.com/blog/2009/05/flash-developer-needed/</link>
		<comments>http://www.welove72.com/blog/2009/05/flash-developer-needed/#comments</comments>
		<pubDate>Fri, 22 May 2009 12:57:55 +0000</pubDate>
		<dc:creator>d_noodle</dc:creator>
				<category><![CDATA[We Love... Talent]]></category>
		<category><![CDATA[AS3]]></category>
		<category><![CDATA[Flash developer]]></category>
		<category><![CDATA[Flash Guru]]></category>
		<category><![CDATA[Papervision]]></category>

		<guid isPermaLink="false">http://www.welove72.com/blog/?p=912</guid>
		<description><![CDATA[We are looking for a Flash Guru. Please apply if&#8230; you are a Flash and Actionscript 3 developer/animator with recent (v2) Papervision 3D experience. Have knowledge of the Gaia flash framework would be favourable (though it&#8217;s easy to pick up). Good OO principles, though we won&#8217;t tie you down to PureMVC or anything like that&#160;<a href="http://www.welove72.com/blog/2009/05/flash-developer-needed/">Read more</a>]]></description>
			<content:encoded><![CDATA[<p>We are looking for a Flash Guru. Please apply if&#8230;</p>
<p>you are a Flash and Actionscript 3 developer/animator with recent (v2) Papervision 3D experience. Have knowledge of the Gaia flash framework would be favourable (though it&#8217;s easy to pick up). Good OO principles, though we won&#8217;t tie you down to PureMVC or anything like that &#8211; whatever you do, you do it beyond well. You use bzr/svn/git regularly and have the seniority to take the lead if required.</p>
<p>Dates: 10 day booking starting from the 3rd &#8211; 4th June 2009</p>
<p><strong>Examples of recent work will be required. </strong></p>
<p>This is a fast moving project in a &#8216;lively&#8217; environment based in our office in Maidstone, Kent.</p>
<p>Email your CV and examples to work-at-welove72.com</p>
]]></content:encoded>
			<wfw:commentRss>http://www.welove72.com/blog/2009/05/flash-developer-needed/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

