A real native Alert for Flex / Air

On May 3, 2009, Air,Components,Flex - 7 Comments

When you’re working on an Air project in Flex, and you want an alert to popup, you have a problem. Air doesn’t come with an ‘aired’ version of the Flex Alert. The flex Alert is fine, as long as you work with a single windowed application. As soon as you have more than one window, the Alert of Flex becomes more or less useless. Since you’ve got more than 1 window, Flex doesn’t know which window to make the parent window, so a model alert isn’t possible anymore.
I’ve taken the code from the mx.Alert and rewritten it to an AirAlert. It works exactly as the normal alert, only now it creates a window instead of a Panel / Titlewindow.

Usage: AirAlert.show(‘Test Alert!’, ‘Test Alert!’);
(The same as a normal alert :-P )

Notice: I didn’t copy the Alert.YES / Alert.NO stuff, so you have to use those from the Alert class.
Notice2: You’ll find no license or whatsoever, just use it as you like.

Download / View the source

AIR + Chuck Norris = Chuck Norris Facts Desktop app

On October 7, 2008, Air,Flash - 8 Comments

Today, I fiddled a bit with Adobe AIR (Adobe Integrated Runtime) in Flash CS3, and look here, I’ve created the best application ever! (Every application featuring Chuck Norris is the best application ever).

It serves random facts and roundhouse kicks you in the face! Check it out:

Get Adobe Flash player

ASDebugger: A run-time debugger for AS3 Projects

On July 2, 2008, Components,Flash,Flex - 1 Comment

When you’re developing an Actionscript project – Flash or Flex – you cannot live without a decent debugger. Flex provides quite a good debugger and the Flash IDE has also a reasonable debugger. The problem with those debuggers is that you have to build explicitly for the debugger. So when you’re deploying on a remote server, you don’t have those debug options.

The ASDebugger allows you to trace variables. It has support for strings, integers, arrays, dates, arraycollections, objects and everything in between.

Usage is simple, import the asdebug.as class in your application and call the debugger:

?View Code ACTIONSCRIPT
import nl.flplibrary.debug.ASDebugger;
import mx.collections.ArrayCollection;	
 
private function simpleDebug():void {
	ASDebugger.debug("<b>test</b>");
}
 
private function advancedDebug():void {
	var o:Object = new Object();
	o.my_string = "<i>string</i>";
	o.my_number = 123.456;
	o.my_int = parseInt("1");
	o.my_array = ["item 1", "item 2", "item 3"];
	o.my_arraycollection = new ArrayCollection([{label:"item 1", data: 1},
												{label:"item 2", data: 2},
												{label:"item 3", data: 3}]);
	o.my_object = {	label1:"item 1", data1: 1,
					label2:"<i>item 2</i>", data2: 2,
					label3:"item 3", data3: 3};
	o.my_date = new Date();
	o.my_xml = new XML();
	o.recurse = o;
 
	ASDebugger.debug_prop(o);
}

Before running the application, startup the ASDebugger. The ASDebugger comes in different flavors:

  • In a .exe projector file;
  • In a .swf;
  • As an AIR application;
  • or you can even use the ASDebugger on this page! more…