Flash Platform, Open Source

OpenSource AVM… Re-Introducing GNASH

In the middle of 2008 I first time wrote about what I then thought was a cool but remotely stupefying OpenSource project… Gnash !

Gnash is the GNU SWF movie player, which can be run standalone on the desktop or an embedded device, as well as as a plugin for several browsers.

Gnash is capable of reading up to SWF v9 files and opcodes, but primarily supports SWF v7, with better SWF v8 and v9 support under heavy development. Since the 0.8.2 release, Gnash includes initial parser support for SWF v8 and v9. Not all ActionScript 2 classes are implemented yet, but all of the most heavily used ones are. Many ActionScript 2 classes are partially implemented; there is support for all of the commonly used methods of each class.

Gnash has implemented about 80% of ActionScript v2.0, and has begun implementing ActionScript v3.0. Gnash supports the majority of Flash opcodes up to SWF v9, and a wide sampling of ActionScript classes for SWF v8.

Obviously Gnash is also very far from providing a serious alternative as AVM machine tor widespread use, its basic use case now would be embedded on a chip, however the advent of readily available Android kind of defeats this purpose now, doesn’t it ?

Anyways, check out the main developers website…
http://www.gnashdev.org/

ActionScript 3.0, Adobe Flex

Save Image As… now as a separate tag

James Ward created a clever way of adding a “Save Image As…” feature to an image in Flex.


SaveImageAs

However clever, in my case I really wanted to avoid having to subclass the Image class specifically, so I created an MXML tag which would take the Image instance as an argument instead.

The source code looks like this…

package org.hello.saveimageas
{
	import flash.events.ContextMenuEvent;
	import flash.net.FileReference;
	import flash.ui.ContextMenu;
	import flash.ui.ContextMenuItem;
	import flash.utils.ByteArray;

	import mx.controls.Image;
	import mx.core.IMXMLObject;

	public class SaveImageAs implements IMXMLObject
	{
		private var _target:Image;
		private var _label:String = "Save Image As...";

		public function SaveImageAs()
		{
			super();
		}

		public function initialized(document:Object, id:String):void
		{
			// empty for now
		}

		protected function saveImageAs( event:ContextMenuEvent ) : void
		{
			var tba:ByteArray = new ByteArray();
			this.target.content.loaderInfo.bytes.readBytes(tba, 0, ( this.target.content.loaderInfo.bytes.length - 17 ) );
			tba.position = 49;

			var ba:ByteArray = new ByteArray();
			while (tba.bytesAvailable)
			{
				ba.writeByte(tba.readUnsignedByte());
			}

			var fr:FileReference = new FileReference();
			fr.save( ba, this.target.source.toString() );
		}

		[Bindable]
		public function get target() : Image
		{
			return this._target;
		}

		public function set target( value:Image ) : void
		{
			this._target = value;

			if( this.target != null )
			{
				var targetContextMenu:ContextMenu = this.target.contextMenu != null ? this.target.contextMenu : new ContextMenu();
				targetContextMenu.hideBuiltInItems();

				var item:ContextMenuItem = new ContextMenuItem( this.label );
				targetContextMenu.customItems.push(item);

				item.addEventListener( ContextMenuEvent.MENU_ITEM_SELECT, saveImageAs );

				this.target.contextMenu = targetContextMenu;
			}
		}

		[Bindable]
		public function get label() : String
		{
			return this._label;
		}

		public function set label( value:String ) : void
		{
			this._label = value;
		}
	}
}

A basic usage of it could look something like this…

 
<s>

	

	
		
	

</s>

Be sure to check out the original implementation by James Ward… it might suite your needs better…
http://www.jamesward.com/blog/2009/07/09/flex-example-right-click-save-image-as/

Thomas Burleson has already cornered this approach – as “Flex Behavior Injection”… check it out…
http://www.gridlinked.info/flex-behavior-injection/

The above modification to James Wards’ original contribution has been added to the “unsponsored” framework from where you can obtain it via SVN…
http://code.google.com/p/unsponsored/

ActionScript 3.0

Google Wave… likely now not waporware, and now with an AS API

Google Wave will now suddenly not become waporware… I never thought it would, however lots or credible people have spoken about the chance that Google Wave would either never see the day of light or if then, only for a short time.

Google Wave Logo

If you want to get started with utilizing the Google Wave API’s and like I am currently, mostly building systems based on ActionScript and Flex, you don’t need to start implementing your own delegate API Google’s API, a couple of guys from the Google Developer Community has created a simple ActionScript implementation already.

Check it out…
http://code.google.com/p/wave-as-client/

A couple of notes…
* it uses ExternalInterface to call the actual JavaScript implementation (so no new communication logic)
* its released on the Apache License
* its very recent and active (last commit at the time of this post was 28 hrs ago)

ActionScript 3.0

ActionScript API for Adobe Wave Service

While I was experimenting with the new Adobe Wave Service from Adobe… I decided to take some of the experimental code and create a reusable library.
It has a basic implementation handling authentication as well as broadcasting notifications.

2009-07-09_0612

I have named the project “asadobewave” which roughly stands for ActionScript Adobe Wave and I have made it available via the Google Code under the Mozilla license.

Check it out…
http://code.google.com/p/asadobewave/

It has been moved to here…
http://code.google.com/p/as3wavelib/

ActionScript 3.0

Introducing Axiis… Open Source Data Visualization

Up to this point there has been only four more or less serious alternatives when it came to employing advanced Data Visualization in your Flex Apps, but not with Axiis another alternative has emerged.

Up to ths point we could either…

  1. Use the data visualization library native to the Flex SDK.
  2. Use Ilog Elixir.
  3. Use on of the the more or less unserious smaller contributions available out there typically limited to a single visualization.
  4. Write it ourselves.

Axiis, the 5. option now available, is an open source data visualization framework designed for beginner and expert developers alike.
Whether you are building elegant charts for executive briefings or exploring the boundaries of advanced data visualization research, Axiis has something for you.
Axiis provides both pre-built visualization components as well as abstract layout patterns and rendering classes that allow you to create your own unique visualizations.
Axiis is built upon the Degrafa graphics framework and Adobe Flex 3…

2009-06-09_1052

Check it out…
http://www.axiis.org/

…thx to the always well informed Paw Suddergaard for initially pointing me to this great contribution to the preferred library of open source projects…

ActionScript 3.0, Adobe Flex, Tools

FC / FB Workflow Optimizer… sources available

I have made the sources available for the Workflow Optimizer… its a crude implementation but it does the job.
It uses Flex, AIR, as3preferenceslib, as3corelib and the Mate Flex Framework.

Don’t hesitate to comment on the ideas or concepts.. but don’t comment the code: it’s not written with any other priority than functionality…

Check it out…
http://code.google.com/p/workflowoptimizer/

Uncategorized

Free Beer…. first open source beer

FREE BEER is a beer which is free in the sense of freedom, not in the sense of free beer.

The project, originally conceived by Copenhagen-based artist collective Superflex and students at the Copenhagen IT University, applies modern free software / open source methods to a traditional real-world product – namely the alcoholic beverage loved and enjoyed globally, and commonly known as beer.

FREE BEER is based on classic ale brewing traditions, but with addded Guaraná for a natural energy boost. The recipe and branding elements of FREE BEER is published under a Creative Commons (Attribution-ShareAlike 2.5) license, which means that anyone can use the recipe to brew their own FREE BEER or create a derivative of the recipe. Anyone is free to earn money from FREE BEER, but they must publish the recipe under the same license and credit the original work. All design and branding elements are available to beer brewers, and can be modified to suit, provided changes are published under the same license (“Attribution & Share Alike”)

FREE BEER is based on Vores Øl v. 1.
FREE BEER v 3.0 is currently under revision by Skands Brewery.

Check it out…
http://www.freebeer.org/

And if you are into Beer and Flash Platform programming, don’t hesitate to check out my previous post about Flash On Tap which takes place in Boston in the end of May…
https://blog.petermolgaard.com/2008/12/06/flash-on-tap-2009/