Archive for November, 2006

ServiceCapture

This looks like a really handy tool for keeping a close (and detailed) eye on all your HTTP traffic. It deserializes SOAP, JSON, AMFPHP and other Flash Remoting traffic to a tree based format.

ServiceCapture for Windows and OS X.

A better implementation of FlashVars

[slug]DataTypedFlashVars[/slug]Patrick Mineault has an interesting approach to using flashVars and getting data typed objects passed into Flash.

A sane approach to FlashVars

Tate Modern Slides

I went down to the tate modern today, and spent quite a few hours playing on the slides, they are brilliant!

For more info, visit the Tate Modern site

SWFObject add-on: Size limiting for full window flash

[slug]swfforcesize[/slug]Here's another add-on for SWFObject. This one allows you to create a full-window flash movie, but when the browser window is set below the specified size, the div containing the flash is kept at the minimum size and horizontal/vertical scrollbars are displayed.

Again it's easy to implement, you have to make a few small changes to the HTML/CSS/JavaScript
Read more

Tamarin Project

The Actionscript Virtual Machine 2 (AVM2) is going open-source with Mozilla and Adobe joining forces. Tamarin will be a model for JavaScript 2.0 and ActionScript 3.0 and any other language that is fully ECMAScript 4 compliant. It's aim is to create a more unified scripting interface for RIAs in future, it should also enable much more 'native' language bridging, i.e. passing properly datatyped objects between JavaScript, ActionScript and JScript.

http://www.mozilla.org/projects/tamarin/

SWFObject add-on: MouseWheel on Mac OS

I've had the mouse wheel working in flash on OS X for a while, and after seeing the SWFAddress add-on for deconcept's SWFObject embedding system, I thought I'd add mousewheel functionality to SWFObject, rather than using my own "frankenstein" embedding system.

It's straight forward to implement. Download SWFMacMouseWheel here.


Read more

FDT Template

Ever built a class that extends MovieClip, which has no assets in it at compile time? But you still feel you have to place a blank MovieClip in the Flash library bound to this class?

I got sick of doing this each time I create a new MovieClip extending class, so I've taken the FDT template 'create' which normally inserts a static method for attaching your class, but relies on that blank movie and made it work without it. This method also allows you to pass Arguments directly to the constructor function, which you cannot normally do when using attachMovie etc.

An example class looks as follows:

Actionscript:
  1. class Example extends MovieClip {
  2.  
  3.     function Example( arg1:String, arg2:Object )
  4.     {
  5.         // do something with the arguments...
  6.     }
  7.  
  8.     public static function create( container:MovieClip, name:String, depth:Number, init:Object, args:Array ):Example
  9.     {
  10.         var mc:MovieClip = container.createEmptyMovieClip( name, depth );
  11.         if( init ) for( var i:String in init ) mc[ i ] = init[ i ];
  12.         mc.__proto__ = Example.prototype;
  13.         Function( Example ).apply( mc, args );
  14.         return Example( mc );
  15.     }
  16. }

To implement that class, you would do

Actionscript:
  1. var initObject:Object = { _x: 100, _y: 200 };
  2. var constructorArgs:Array = [ 'a string', { value:'a property', value2:'another property' } ];
  3. var myExample:Example = Example.create( this, 'example_mc', getNextHighestDepth(), initObject,  constructorArgs );

To install this template, download this XML file, open Eclipse, go to preferences > FDT > Editors > Templates, select Import... and select the unzipped XML file.

There are other methods for achieving the same effect, Peter's one is a great example.

Flash Player Version Switcher

Alessandro Crugnola (Sephiroth) has put together this FireFox extension for switching player version on firefox. This is really useful for testing Express Install functionality and seeing how old players handle newer content.

Mac OS X / Windows Versions

Open Source Library

I'm currently putting together a library for release under a GPL license. It will include animation management classes, a core kernel and threading engine to remove the reliance on onEnterFrame events, and a debugging tool.

This lib is aimed at Flash Developers who predominantly work on animation intensive sites, rather than application development.

XML Cache class

This is a class that I wrote quite a while back. It works just like Flash's XML Class, but if you try and load the same file / URL again, it will use the XML data stored in memory rather than reconnecting to the server.

Example:

Actionscript:
  1. import com.pixelbreaker.utils.XMLCache;
  2.  
  3. myXML = new XMLCache();
  4. myXML.load( 'anXMLfile.xml' ); // will load the file in
  5.  
  6. myXML2 = new XMLCache();
  7. myXML2.load( 'anXMLfile.xml' ); // will use previously loaded data.

The idea is simple, the XMLCache class extends XML, and has a static object called xmlCache, whenever an XML file is loaded, it's stored in the static object with the name exactly representative of the full filename/path passed to the load() method, then whenever it's called again, the data is pulled from the static object. Easy peasy!

Download it here.