ActionScript 3.0, Flash Platform, HTML5

Introducing FlashJS… another promising mediator between Flash and HTML5

FlashJS was born at the crossroad of HTML / CSS and beautiful Flash objective model that is known by many interactive developers and fits great for game development.

This library allows to develop HTML5 games and applications in the way that is similar to ordinary AS3 development. FlashJS was designed to show maximum perfomance for HTML/CSS platforms.

Check it out…
http://www.flashjs.com/

Advertisements
ActionScript 3.0, Flash Platform

A new Starling is born… time to start pushing those pixels around…

Starling was born today… I have to admit, when I first learned about it during an evening of fun in Los Angeles, I wasn’t all that sure what it would mean for me… however as time has passed since, I realize that we are all in need of developers being able to push pixels around in an ever increasing speed, with higher accuracy and most critically, with increasingly higher fidelity…

…Starling gives us a whole new spectrum of possibilities when building resource demanding user experiences on the e.g. handhelds… instead of repeating what Daniel Sperl already wrote better than I can do on his own blog, I will merely encourage you to check out his blog and his latest blog post on the release of the first production version of Starling….

ActionScript 3.0, Adobe, AIR, Flash Platform, Flex, JavaScript, Open Source, Tools

Adobe’s view of Flex and its commitments to Flex in the future

Its no secret that Adobe has been going through a turbulent patch the recent months while they have been implementing their new adaptive strategy to an unruly future.

Its included layoffs and new hirings, internal repositioning and new layouts of their many divisions within services and products and they have taken a deep look at the business in terms products and offerings in the process of optimizing their market profile…

Its been painful, not only to see beloved team members leave Adobe but also to see that this major company refurbishing has not really been successfully communicated to both community, but also to users of the software and companies using services based on Adobe partners… even investors has been confused by the lack of diligence in the communication, however, its increasingly behind us as the new changes are settling in and the changes to the teams is stabilizing…

One of the massively controversial changes was the dealing with the future vision for Flex and the Flash Platform… I will not go into details with what has transpired over the past months, its well documented on every blog and site relevant to the community and product ecosystem and its not with a great pleasure I’m looking back on the past months… so let’s leave it behind and instead focus on the most recent statement from Adobe on their vision for Flex…

Now, there is not a lot new statements under the sun, however in contrast to the scrambling messages and divergent directions we have been seeing until now, its nice to see that Adobe has taken a deep breath and made a firm statement which would be difficult to misinterpret either positively or negatively…

If you are in a hurry and not interested in reading the entire writeup, I’m sharing with you the conclusion in a nutshell which confirms some of the more positive statements we have seen over the past months…

Adobe believes that Flex is the best solution for enterprise and data-centric application development today and is moving Flex into a community-driven open source project to ensure the continued development and success of Flex for years to come. We are currently in the process of contributing the core Flex SDK, automation libraries, AIR SDK binaries, and documentation to the Apache Flex Project. We will also be contributing Falcon, Falcon JS, Mustella, and BlazeDS.

In addition to these contributions, Adobe is providing a team of full-time Flex SDK engineers who will contribute to and support the Apache Flex Project. These Adobe engineers will work directly with the highly skilled Flex developer community to maintain, support, and evolve the Flex SDK. We remain committed to enabling the success of all existing and new Flex projects.

Thank you Adobe, for setting the record straight and for sharing with us your intentions and vision for Flex… its a privilege to be on the team…

ActionScript 3.0, Flex, JavaScript, Tools

Introducing Jangaroo…

Jangaroo is an Open Source project building developer tools that adopt the power of ActionScript 3 to create high-quality JavaScript frameworks and applications.

There are two main use cases when you might want to use Jangaroo tools:

  • JavaScript programming in the large – Adopt ActionScript 3 language features like packages, classes and inheritance, interfaces, private members, and many more to create even large-scale client-side Web code, where you otherwise would have used JavaScript directly. This approach is extremely helpful when creating frameworks with explicit public APIs, but also for larger applications that use such frameworks.
  • Running ActionScript 3 code directly in the browser – You are implementing a Web project that must not rely on plugins and/or requires close integration into an HTML Web site, possibly already using some JavaScript framework. You want to reuse or build upon existing ActionScript 3 code (utility classes, frameworks like FlexUnit, custom code) as well as JavaScript APIs and code.

This obviously is a very useful approach and if the end-result actually is useable, it would give us the very best of both worlds… especially since Jangaroo maintains edit-ability in the source between productions… very very useful in deed.

I will be taking Jangaroo for a spin at first given opportunity considering the magnitude of the benefits if the approach were made to work.
A really nice little “feature” is that Jangaroo keeps the generated code close to the source, even keeping line numbers to allow source-level debugging… pretty kewl !

Check it out…
http://www.jangaroo.net/home/

…and thanks to Kevin Newman for the heads-up, be sure to check out his blog…
http://www.unfocus.com/

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

A fun way to open a native window in AIR with MATE

Sometimes when coding it happens that you stumble on something which just strikes you as funny (sometimes for apparently no reason whatsoever).
One such experience happened today when I was coding an AIR client with MATE and I had to open a new NativeWindow.
It should be noted that I for this implementation am experimenting with ridding myself of using Managers (no other motivation than curiosity about will come out in terms of code design and architecture).

Well, the thing that amused me was to use a PropertySetter. This is due to the fact that you have to set the “visible” property in order to actually show the window. However, you also have to pass an object of the type “NativeWindowInitOptions” to the constructor.

The code eventually can be written like this…


<s>

	<s />

	
		
	

</s>