Adobe Flex, Tools

Announcing “Project FlaXe”, a vision for the future of Flex

David Arno is in the same position as the lot of us working with Flex, its obvious that things will change in the years to come and one of the likely changes will be the much anticipated move to the Open Web Standards Technology Stack. However, this doesn’t change the fact that Flex will remain a superior application technology for years to come…

He has announced his idea and vision, Project FlaXe, and it goes something like this…

This set me thinking: could the community create a way of migrating existing Flex solutions away from the Flash player? The fact that the SDK will be handed over to an open source foundation offers a way of achieving this: compile Flex solutions to targets other than the Flash player. One way of doing this would be to take the mxmlc compiler code (which is part of the Flex SDK and thus maybe open for community modification too) and add a new backend to it that outputs JavaScript for example. A more exciting possibility though is haXe. Since its launch in 2006, AS3 has changed very little and so has become a somewhat outdated and stagnant language. As Adobe have shown no interest in evolving the language, Nicolas Cannasse developed a replacement for it: haXe. haXe is a more up-to-date, powerful and all-round-better language than AS3. In addition, it can be compiled to the Flash player, JavaScript, the command line and versions to output to Java, C# and iOS are being worked on. However haXe does have one weakness: the only interoperability between it and AS3 lies with the Flash player target, by using SWCs.

So I’m proposing “Project FlaXe” to address that and to turn haXe into a first-class Flex programming language.

Check out his blogpost…
http://www.davidarno.org/2011/11/14/announcing-project-flaxe-a-vision-for-the-future-of-flex/

Adobe Flex

Could Flex be compiled to JavaScript ?

One of the initial thoughts popping to mind about Flex following the latest transpiration of events is to simply output the ActionScript and Flex to JavaScript, HTML and CSS…

Great idea, everybody wins, its not impossible aand Adobe could have chosen to pursue this vision, but the obvious lack of adding to the revenuestream by such and initiative would have made little sense…
So, upon open-sourcing it Adobe could very well give birth to such a project since they have promised to keep contributing to Flex even after they have given it away… however in lack of such indications, the community is stepping up and starting such initiatives far and wide across the Fle community.

This is certainly something which could ease the future transition from Flash Platform to the Open Web Technology Stack and therefore something that would be very welcomed…

Cros-compiling this way is seen before and would certainly be possible and yours truly is determined to get involved at the slightest opportunity you could contribute constructively or morally… both are needed on the projects to aspire from the community over the coming months…

Stay tuned for concrete info…

Adobe, Adobe Flex

Quick Pointers about Flex (and Flash Platform)

A lot of confusion has arose triggered by the recent announcements by Adobe… among one was that they would hand over Flex SDK to Spoon and leave updates and maintenance to the community, in this case including the way it has been done, imho. means the very rapid departure of Flex as a viable application platform.

Even in the upcoming 4.6 release, its far from feature complete to make it a viable mobile platform (Native Extensions is a half-baked poor solution to lack of resources to implement what should be part of the platform) and general performance remains ludicrous despite the effort put in to improve it in addition to the UI control which should be the force of Flex is far from complete.

Adobe Flex’s ultimate force was as an enterprise platform, however Adobe has in the past week announced that they are replacing Flex as the recommended enterprise application platform with HTML, please read Deepa’s blog post describing the change in focus of Adobe Flex…
http://blogs.adobe.com/flex/2011/11/your-questions-about-flex.html

The fact that the Flash Runtime is lost on mobile in general with the last weeks announcement to discontinue Flash for Mobile and the fact that it will not be running in Windows new Metro browser system makes it a no brainer that Flash Platform is going down as well, now its just a count down which we eventually dont know how long will take before Flash will disappear as a platform… the proposition that Flash Platform should survive as a casual gaming platform is difficult to have any sincere faith in, but perhaps time will show that there is a market to support it as a gaming platform, however as a RIA platform Flex and Flash Player Runtime is now officially not viable anymore anymore than ActiveX and Java Applets are…

Soon we will see Adobe taking all their hard earned knowledge and experience building Flex and putting into something equally useful, but based on the Web Standards stack and not a closed source proprietary platform such as Flash Player…

This is good news, it will make applications and experiences build using Adobe technologies generally better software system citizens by using the same technologies as the other members of arena, and now Adobe can focus on providing tooling and framework and not focus on maintaining a runtime as well…

We are already seeing some of the directions the tooling will take us, you only have to look at Adobe Edge, PhoneGap, jQuery Mobile possibly Adobe Muse (if you want to be aMused) to see that they are already way ahead on this and soon ready to release the first tools to facilitate making the initial experiences and small app’s using Web Standards Stack in replacement of Flex and Flash Player…

We are still far from having the strength of ActionScript and the Flex Framework, not to mention Flash Builder and the SDK itself, however it will come and we will be even better positioned for creating great experiences and apps for our markets than we were with Flex and the Flash Player runtime…

Following a comment to the post, I wanted to add this except from my response as its essential for the understanding of my point here (and to address the things I on purpose didn’t address in this post):

The current state of affairs is exactly that as described, Flex is no longer a recommended platform and there is no alternative available (yet) that can equalize it… thats it, in a nutshell.
However, making the decision to change focus and resources to be allocated on HTML instead of Flash and Flex is a good and sound decision, regardless how the decision may have been communicated and left us people working with Flex where the rubber meets the road hanging to dry.
The message itself and how you deliver the message is two separate things, the message is good and clear, the delivery was not exactly up to par which is causing the confusion now and the uproar in the community.
Therefore, my suggestion is that we discuss these two aspects separately from each other. In my post I was not trying to discuss the way this new change of focus and technical strategy was conveyed to the public and the community, but instead only focus on the decision itself and what it means in the long run for us working with Flex.

I agree, we are stuck right now with a very delicate situation because of this and because many people and even people close to Adobe were not made aware of this information until the public did… there are some pretty horrid stories going on backstage right about about how some people were left hanging to try on stage while presenting Flash Technologies, where people in the audience were following on Twitter how the storm hit following the Flash Mobile announcement, something the Adobe Rep on stage wasn’t informed about, and therefore were made to look like an ass on stage in front of 250+ people.

Lets keep pragmatic and keep emotions aside when discussing constructively what technological decisions have been made and what it means to us in the community, then we can always discuss the approach used afterwards when the dust has settled…

Adobe, Adobe Flex, Tools

FlashBuilder 4.5 released… One of the biggest releases in Flex history

Now it’s here, finally available in the public.
The team have been working very hard on making this release happen, and it’s big…

Hurry up and grab the trial from here:
http://adobe.ly/mIDbeo

Once you have downloaded and installed the trial, head over to the new amended developer site here:
http://www.adobe.com/devnet/flash-builder.html

And then, if you like me is excited about this release and wants to share the great news with fellow developers, share the great news by posting the widget build by Adobe Platform Evangelist and resident rockstar: Serge Jespers.
http://adobeevangelists.com/fb45widget/

This is awesome news !! Check it out, it will change how you think of RIA and mobile application development…

Adobe Flex

Changing Diabetes Barometer is now an Adobe MAX Semifinalist

After winning two awards last year for our “MyHome – Your Intelligent Home” and the “Nasdaq Market Replay”, it was with great interest we here at Hello Group were awaiting the email from Adobe telling us if our very cool application – “Changing Diabetes Barometer” had made it to the next level in the prestigious Adobe MAX Awards.

Today the email came, informing us that it had made it to the Semifinals… a great accomplishment thinking about some of the troubles the project had been undergoing from its inception to its transition into production, and then even some after that (as it most often is the case, I suppose).

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

2009-09-02_1009

The system was build in Adobe Flex 3 with an architecture based on PureMVC MultiCore with a backend in .NET running a MS SQL Server 2005 and a WebORB tying it all together.

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, Adobe Flex

MATE CacheSetter.. a quick and dirty introduction

One of the newer classes in the MATE Flex Framework yet to be documented is the CacheSetter.
It’s nothing overly fancy, but it does exactly what it promises… it allows you to set the Cache from an ActionTag.

Let’s examine the code below… it’s a standard MATE EventMap with a couple of eventhandlers which offers to exit an AIR application when the User clicks anywhere on it… the applications for such a feature might be quite limited, but that’s what I could think of at 4:40 AM in Bangkok after almost 2 hours of being teleconferencing with the Flex Team sitting in California and it proves the point with the CacheSetter close to a minimal implementation.

NativeSystemEventMap.mxml




	
		
	

	

		
			
		

		
			
		

	


For the sake of completion, I will also bring the code to the AIR application itself…


<s>

	
		
	

</s>

One of the more interesting and intricate details (and eventually why this exercise is interesting), is to see that it uses the Class reference as the cacheKey and that you eventually would be able to use any class or hashable object and chain as the cacheKey. If the cacheKey is NOT set explicitly it will default to use the class type of the Generator attribute, but if you are working with MATE the Cache class is one of the classes it makes the most sense to take an extra look at…

CacheSetter (Source)
http://code.google.com/p/mate-framework/source/browse/trunk/src/com/asfusion/mate/actions/CacheSetter.as

Cache (Source)
http://code.google.com/p/mate-framework/source/browse/trunk/src/com/asfusion/mate/core/Cache.as

Cache (Documentation
http://mate.asfusion.com/api_docs/com/asfusion/mate/core/Cache.html