« back to blog Posts Tagged ‘AS3’

Flash geek post on getDefinitionByName

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:

Read the rest of this entry »

Front-End Developers Wanted Again…

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 its most important assets. In fact, they are the DNA of the company.

Skill sets and Personality: 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.

We won’t tie you down to PureMVC or any other framework – good OO design principles and high code standards are all that’s required. AS3, PHP/Python and a good knowledge of HTML/CSS a must – anything else will be a bonus and knowledge of the Gaia flash framework is favourable.

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.

You must have a couple of years experience behind you and be Mac happy and PC proud.

Benefits: 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.

Salary: Competitive Salary

Location: A beautiful Manor House in Maidstone, Kent, near mainline train stations.

If you think We Love is the place for you then email gavin@welove72.com

Loading classes from an external swf using ApplicationDomain

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.

package com.welove72 {

     import flash.display.Sprite;

     public class Tracer extends Sprite {
          public function Tracer():void { }
          public function traceThis(strMessage:String):void {
               trace(strMessage);
          }
     }
}

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.

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!');
          }
     }
}

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!

This tip and others from We Love are in the latest issue of Web Designer Magazine in the article “55 Pro Flash Tips”! Look out for Gavin Clark.

F/E Developer and a Snr Designer wanted to join us

We are now looking for a couple of talents to join our family at the fast growing and creatively focused agency – We Love.

Based in Maidstone, in a Manor House overlooking the river Medway, we strive to put the love back into the creative process – developing ideas that work through the line for a varied mix of clients and getting shortlisted for and winning recognition awards for our efforts.

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…

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:

work@welove72.com.

We are currently looking for:

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.

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.

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…

Many thanks
Mark

Track flash events in google analytics

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 file called Tracker.as. When installed correctly you can drag the  AnalyticsLibrary component from the components panel into your fla’s library. Add the following code to your Analytics.as file.

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");
        }
    }
}

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:

  • The current display object (“this”)
  • Your analytics account ID (“UA-111-222”)
  • The tracking mode, either Bridge or AS3.
  • 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.

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:

If anyone needs it I can also upload the source!

Happy tracking

This tip and others from We Love are in the latest issue of Web Designer Magazine in the article “55 Pro Flash Tips”! Look out for Gavin Clark.

Freelance Flash Developer needed

We are looking for a Flash Guru. Please apply if…

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’s easy to pick up). Good OO principles, though we won’t tie you down to PureMVC or anything like that – whatever you do, you do it beyond well. You use bzr/svn/git regularly and have the seniority to take the lead if required.

Dates: 10 day booking starting from the 3rd – 4th June 2009

Examples of recent work will be required.

This is a fast moving project in a ‘lively’ environment based in our office in Maidstone, Kent.

Email your CV and examples to work-at-welove72.com