The Space For App Developers

Beyond Plain Old HTML Objects

Archive for the ‘Flex’ tag

Amethyst Visual Studio IDE for the Flash Platform – Released!

with 5 comments

This is really great news for all the Visual Studio fans that want to do Flash/Flex development with their favorite IDE. Amethyst IDE brings the really incredible feature set of Visual Studio to the Flash/Flex world. I really love how it handles component AS3 in a separate file. I wish something similar was available out of the box with Flash Builder! Really, really incredible!

Key Features of Amethyst Professional:

  • Powerful editor with code coloring (76 options) and code folding
  • Customizable code formatting
  • IntelliSense with code completion and auto-expanding snippets
  • Drag-and-drop Designer for Flex and AIR
  • Designer integrates with Property panels, Event panels and Layout toolbar
  • Multi-level undo/redo in editor and Designer
  • Fast ‘Cylon’ debugger with breakpoints and call stack
  • Step into/over/out in Debugger
  • Conditional breakpoints and break-on-hitcount
  • Expression evaluation in Immediate and Watch windows
  • Hover and drill-down debugging in editor and Watch windows
  • Debug multiple SWFs concurrently
  • Find All References/Go To Definition
  • Quick-find ToDo comments and User Tasks
  • Auto-generate getter/setter ‘property’ methods
  • Sophisticated refactoring with rename, move to package and refactoring previewer
  • Source control support (TeamServer etc.)
  • Import FLA to edit and debug Flash IDE projects
  • Convert existing Flex or Flash Builder projects

All that is available at $249.

Check out this video of the Amethyst IDE in action:

Written by Piotr Walczyszyn

September 3rd, 2010 at 12:54 pm

Posted in News,Releases

Tagged with ,

as3term – ActionScript3 Terminal released!

with 14 comments

Today I’m releasing to the world my new open source project called as3term, a simple terminal-like application that lets you compile and execute ActionScript code. It’s very handy when you want to check some AS3 constructs without launching your IDE and creating new project.

It was built with Flex/AIR 2.0 and it uses the NativeProcess API to launch mxmlc compiler, which is part of the Flex SDK. The primary reason that I have built it was that I needed a simple app that I could code in few hours and that would serve me as a test and a showcase for my other open source project called NativeApplicationUpdater. You can download the installers for different OSs from its Google Code site as well as source code from SVN. In the video below you can also see it in action:

Written by Piotr Walczyszyn

September 1st, 2010 at 10:18 am

Posted in Releases

Tagged with , ,

NativeApplicationUpdater – updater for AIR apps packaged with native installers

with 48 comments

I just released on Google Code a new project called NativeApplicationUpdater. Basically the name explains its purpose but for those that don’t know, AIR 2.0 brings new capability of packaging applications with native installers. This is necessary when you want to use the new NativeProcess APIs. Unfortunately Update Framework that comes with AIR 2.0 SDK doesn’t bring yet capability of updating this type of applications. That is why I decided to build it myself and publish it as open source library.

Here is a video explaining how it works:

Written by Piotr Walczyszyn

August 25th, 2010 at 11:08 am

Posted in Releases

Tagged with , , ,

Swiz 1.0 Chaining API explained

with 8 comments

Yesterday I was tasked to find the best way to bootstrap a Flex application that uses Swiz 1.0 RC1. The challenge was to initialize application controllers and data model in the right sequence. This is an AIR application so it had to initialize data from an SQLite database, make few calls to remote services to check for data updates and do couple of other things before user could actually see first screen. My initial thought was to create a StartupController that would invoke the proper functions in a right order. That was a good initial direction but things started to get more difficult when I had to deal with async remote calls and local async APIs such as the one from the SQLite database.

So my next thought was, why not to try the new Chaining API that comes with Swiz? After my first look at the documentation I wasn’t really sure how I should approach it but after more digging I managed to figure it out ;) Here is what I did. I kept my StartupController with its init function that gets called after the controller is constructed and all its dependencies are injected. This was ensured by the [PostConstruct] metadata that comes with latest version of Swiz. Next that function creates a chains of function calls, remote invocations and events that bootstrap my application.

This is my StartupController where everything starts:

package controllers
{
	import delegates.RemoteServiceDelegate;
 
	import flash.events.IEventDispatcher;
 
	import mx.rpc.events.FaultEvent;
	import mx.rpc.events.ResultEvent;
 
	import org.swizframework.events.ChainEvent;
	import org.swizframework.utils.chain.AsyncCommandChainStep;
	import org.swizframework.utils.chain.ChainType;
	import org.swizframework.utils.chain.CommandChain;
	import org.swizframework.utils.chain.EventChain;
	import org.swizframework.utils.chain.EventChainStep;
	import org.swizframework.utils.chain.FunctionChainStep;
 
	public class StartupController
	{
		[Dispatcher]
		public var dispatcher:IEventDispatcher;
 
		[Inject]
		public var remoteServiceDelegate:RemoteServiceDelegate;
 
		[PostConstruct]
		public function init():void
		{
			// Initializing sequential CommandChain, that will stop on errors
			var commandChain:CommandChain = new CommandChain(ChainType.SEQUENCE, true);
			// Registering event listener when chain execution is complete
			commandChain.addEventListener(ChainEvent.CHAIN_COMPLETE, commandChainComplete);
			// Registering event listener in case chain execution fails
			commandChain.addEventListener(ChainEvent.CHAIN_FAIL, commandChainFail);
 
			// Adding async chain step that invokes remote AMF service
			commandChain.addStep(
				new AsyncCommandChainStep(
					remoteServiceDelegate.ping,
					["ping param value"],
					pingResultHandler,
					pingFaultHandler));
			// Adding function step that calls local function
			commandChain.addStep(new FunctionChainStep(this.localFunction));
 
			// Initializing parallel event chain that will be nested in command chain
			var eventChain:EventChain = new EventChain(dispatcher, ChainType.PARALLEL, true);
			// Registering event listener when event chain execution is complete
			eventChain.addEventListener(ChainEvent.CHAIN_COMPLETE, eventChainComplete);
			// Registering event listener in case chain execution fails
			eventChain.addEventListener(ChainEvent.CHAIN_FAIL, eventChainFail);
 
			// Adding event chain step that will dispatch INIT_PERSISTENCE event,
			// this event is mediated in PersistenceController
			eventChain.addEvent(new EventChainStep("INIT_PERSISTENCE"));
			// Adding event chain step that will dispatch INIT_SOMETHING_ELSE event,
			// this event is NOT mediated anywhere, this just for example and better understanding
			// eventChain.addEvent(new EventChainStep("INIT_SOMETHING_ELSE"));
 
			// Nesting event chain in parent command chain
			commandChain.addStep(eventChain);
			// Starting whole command chain
			commandChain.start();
		}
 
		private function localFunction():void
		{
			trace("Running localFunction");
		}
 
		public function pingResultHandler(event:ResultEvent):void
		{
			trace("Received result from remote ping call:", event.result);
		}
 
		public function pingFaultHandler(event:FaultEvent):void
		{
			trace(event.fault.faultDetail);
		}
 
		private function commandChainComplete(event:ChainEvent):void
		{
			trace("CommandChain complete");
		}
 
		private function eventChainComplete(event:ChainEvent):void
		{
			trace("EventChain complete");
		}
 
		private function commandChainFail(event:ChainEvent):void
		{
			trace("CommandChain failed");
		}
 
		private function eventChainFail(event:ChainEvent):void
		{
			trace("EventChain failed");
		}
	}
}

Below is my PersistenceController that will initialize the local database; its init function is called when the INIT_PERSISTENCE event is dispatched. When the database initialization is finished event.complete(); has to be called in order to proceed with chain execution:

package controllers
{
	import flash.events.IEventDispatcher;
 
	import org.swizframework.utils.chain.EventChainStep;
 
	public class PersistenceController
	{
		[Dispatcher]
		public var dispatcher:IEventDispatcher;
 
		[Mediate("INIT_PERSISTENCE")]
		public function init(event:EventChainStep):void
		{
			trace("Initializing PersistenceController...");
			event.complete();
		}
 
	}
}

This last snippet demonstrates the RemoteServiceDelegate class, which can be used to invoke remote services. It works with AsyncCommandChainStep:

package delegates
{
	import mx.rpc.AsyncToken;
	import mx.rpc.remoting.RemoteObject;
 
	public class RemoteServiceDelegate
	{
		[Inject]
		public var remoteObject:RemoteObject;
 
		public function ping(param:String):AsyncToken
		{
			return remoteObject.ping(param);
		}
	}
}

You can download my demo project source code from here; note that it doesn’t do anything except print out traces to the console. This zip contains a build of latest Swiz source code from GitHub that has some FunctionChainStep fixes.

Written by Piotr Walczyszyn

August 11th, 2010 at 3:51 pm

Posted in Examples

Tagged with ,

Flerry 1.2.0 released!

with 38 comments

I’m proud to announce Flerry 1.2.0, which brings following new features and changes:

  • Java discovery process has been completely rewritten. Now it looks into default location on given operating system:
    • Windows – c:\Windows\System32\javaw.exe (starting from version 6 this is the default Java location)
    • Mac – /usr/bin/java if that doesn’t exist it checks /System/Library/Frameworks/JavaVM.framework/Versions/Current/Commands/java
    • Linux – /usr/bin/java if that doesn’t exist it checks /etc/alternatives/java
    • In case any of these default locations fail it tries fallback mechanism, on Windows it is a native code compiled into FindJava.exe utility. This utility checks the registry on users machine and returns path to the location where java is installed. This was contributed by my colleague Serge Jespers; he used it for his Package Assistant Pro application. In case of Mac and Linux it uses native „/usr/bin/whereis java“ command to discover where Java is installed.
  • The default location where to place jar files has been renamed to libs as it no longer contains only jar files. Now it also contains FindJava.exe utility. It can be customized by setting libsDirectory property on NativeObject class.
  • Adding all jars under libsDirectory folder into the classpath automatically. Specifying it explicitly is no longer required.
  • Compiled java code can be placed under classes folder. It is not required to package it into a jar anymore. This makes debugging and testing the application much easier.
  • Out-of-the-box support for java code debugging. Flerry Getting Started (part 2) video tutorial covers how this can be used.
  • Improved communication from AIR to Java, now it can support large objects transfer. This is due to object splitting into 256 bytes chunks.
  • Added basic set of FlexUnit tests.
  • Added Ant build script.
  • Updated AMF serialization jars from BlazeDS 4.0.
  • Removed reference between flerry and flerry-demo projects. Now flerry-demo is a standalone project referenced by flerry.swc.

This time kudos go to Jhonny Everson, Serge Jespers and Erko Bridee for their contributions and support.

Watch getting started video tutorials to get up to speed with Flerry.

Written by Piotr Walczyszyn

August 3rd, 2010 at 3:31 pm

Posted in Releases

Tagged with , , ,

Flerry 1.1.2 released

with one comment

This is just a quick note to say that I released new version of Flerry; Flerry 1.1.2 is just a bug fix release. It fixes an OutOfBounds error when receiving async messages from a Java process. This error was pointed out by Erko Bridee that has written nice post on Flerry in Portuguese.

Today I also started working on the 1.2 release, which will improve java path discovery on the Windows platform. I’m planning to reuse code written by my colleague Serge Jespers for Package Assistant Pro. It is simple native C code that checks the Windows registry to find where Java is installed.

Written by Piotr Walczyszyn

July 21st, 2010 at 3:16 pm

Posted in Releases

Tagged with , ,

AMF Playground with public services, Flash/Flex client-server communication

without comments

Today I published a microsite (http://amf.riaspace.com/) on my blog dedicated to AMF communication. The goal of it is to gather necessary information needed for quick start with AMF.

You will find there:

  • Publicly available AMF services for the start without setting up your own server environment
  • Code snippets demonstrating how to utilize AMF services
  • Video tutorials on how to setup your own Flex/Zend_Amf projects
  • Demo applications with a source code

At the moment I’m hosting only PHP based services but I’m also thinking about Java based backend to be able to play with messaging.

Written by Piotr Walczyszyn

July 15th, 2010 at 9:58 am

Posted in Articles,Releases

Tagged with , ,

Flerry 1.1.1 released supporting large objects transfer

with one comment

I just released a new version of Flerry that fixes a problem with transferring large object structures from Java to Flex. This release is thanks to Mohammed Abbas who contributed the patch. Again I’m really happy that this project is evolving and the community is contributing to it actively.

To start working with Flerry go ahead and download the flerry and flerry-demo projects. You may also find my previous posts (Post 1 | Post 2) helpful.

Written by Piotr Walczyszyn

July 5th, 2010 at 3:00 pm

Posted in Releases

Tagged with , ,

Flerry 1.1.0 released with a two-way Flex-Java communication

with 10 comments

I would like to proudly announce that Flerry 1.1.0 was released! For those of you that don’t know what is Flerry, it’s a Flex-Java bridge for Adobe AIR 2.0. This new release brings possibility to call/initiate communication from Java to Flex/AS3 code. This functionality was solely developed by Jhonny Everson, big kudos to Jhonny!!! I love when open source really works and community contributes their work, with that said I encourage any of you that use Flerry to commit to the project ;)

You can grab latest FB4 project with Flerry and demo app from here.

Usage is really simple:

First create instance of NativeObject either in MXML or AS3 (binPath is path to jar file with compiled Java source classes):

<flerry:NativeObject id="nativeObject" singleton="true" 
binPath="./jars/flerry-demo.jar"  source="net.riaspace.flerrydemo.MyJavaObject" />

Next subscribe to messages sent from Java side, “sendMsg” parameter defines message identifier:

// Subscribe to receive remote messages.
nativeObject.subscribe("sendMsg", messageHandler);

On the Java side you have static method sendMessage on NativeObject class with message parameter and again message identifier:

NativeObject.sendMessage(map, "sendMsg");

Written by Piotr Walczyszyn

June 30th, 2010 at 10:30 am

Posted in Releases

Tagged with , ,

Adobe TV: Styling Flex 4 components with Flash Builder 4

with 6 comments

As you probably know by now Flash Builder 4 with Flex 4 were released yesterday. Along with that, new content was published on Adobe TV. You can find there my video describing new styling and theming capabilities in Flex 4 and Flash Builder 4.

UPDATE (31.03.2010): You can also get this video through iTunes and on YouTube.

Other videos also published:

  • Build your first desktop application
    Follow along as James Ward shows you how to build your first desktop application using Flash Builder, Flex and AIR.

  • Flash Builder 4 for ColdFusion Developers
    ColdFusion Evangelist Terry Ryan highlights the flexibility of the data-centric features in Flash Builder 4. He shows off the new workflow for wiring a ColdFusion back-end to a Flex front-end.

  • Build a Dashboard Application in Flex 4
    Adobe Platform Evangelist Michael Chaize offers a step-by-step tutorial on building a dashboard application. He walks you through a Flex 4 project created with the Flash Builder 4 IDE.

  • Build your first Flex 4 application
    Platform Evangelist Serge Jespers describes how to build a Flex 4 application using Flash Builder 4. Discover the benefits of controlling components’ properties such as improved efficiency in managing data.

  • Write Flex and PHP code using Flash Builder 4
    Platform Evangelist Mihai Corlan explains how to write Flex and PHP code using Flash Builder 4 and Zend Studio 7.1. He also illustrates how remoting enables your application to consume PHP services.

  • Debug Flex and PHP code using Flash Builder 4
    In this video, Mihai Corlan discusses how to debug the code of a combined Flex and PHP project using Flash Builder 4 and Zend Studio 7.1. He reviews how to use breakpoints to test your application.

  • Define events in Flex 4 with Flash Builder 4
    Platform Evangelist Mihai Corlan shows how to create components with Flash Builder 4 and ActionScript, and he simplifies how to customize an event dispatch in a Flex 4 project.

  • Styling Flex 4 Components with Flash Builder 4
    Piotr Walczyszyn demonstrates the new theming capabilities in Flash Builder 4 and the new features of the CSS engine that come with Flex 4.

Written by Piotr Walczyszyn

March 23rd, 2010 at 2:13 pm

Posted in News,Releases

Tagged with ,