Writing components in Flex, part 1

On July 30, 2008, Components,Flex - 5 Comments

Not too long ago, someone asked me for some tips and tricks to write good components in AS3. Not that I’m the best coder or the most structured person, but when you’ve build some components, you’ll find that you’ll run in the same problems over and over again. Most of the problems you can avoid by starting to write down what your component actually should do. So you first can close flex builder :-P .

For who is this tutorial? Well, I assume you’ve done some coding in AS3, so I won’t explain if-statements and for-loops. Anyone should be able to follow this tutorial, since there won’t be very exotic code in the examples. more…

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…

Flexperminents online!

On June 24, 2008, Flash / Flex,General,php - 2 Comments

Today i’ve launched my new website, labs.flexperiments.nl. All new posts will be posted there, and my components will find a perminent place there.

So update your links and rss feeds!

Changing the default HTML template of Flex

On , Flex - 4 Comments

Just something that came to my mind the other day. Flex is using a rather ‘old’ way of embedding, we (me and my collegues) are more fond of the SWFObject embedding. So I was thinking, is it possible to change the default template of Flex. The Flex docs told me that I should simply change the files in [FLEX DIR]\Flex SDK 2\resources\html-templates. So I changed those files, restarted flex and…. nothing…

But I don’t give in that easily, there must be a way to change the template. more…

WebOrb closes the gap!

On May 7, 2008, Flash / Flex,php - 1 Comment

As of 30/04/2008, the Midnightcoders have released a new version of WebOrb for PHP (version 3.0.0). (Thanks David C. Moody for letting me know). And boy, they’ve certainly improved the performance!

In my previous post WebOrb was a factor 4 slower than it’s opponent, AMFPHP. With this new version, the difference is much smaller. I ran the ‘invoke large dataset’ test and the difference was only 40ms (It used to take 6 seconds, it now takes 270ms). So AMFPHP still holds the speed record, but WebOrb is closing in! more…

It's here! IKTree v1.0 (beta)

On April 3, 2008, Flash / Flex - 9 Comments

Today I’m releasing the first version of my tree component. This component is a substitute for the build-in tree of flex. Why? Because the build in tree is build on the list classes, which aren’t the most stable classes of flex. My tree is build entirely with UIComponents and VBoxes, no list class used here. more…

Sneak Preview: Custom Tree Component for Flex

On March 27, 2008, Flash / Flex - 2 Comments

That’s right, I was so fed up with the tree component of flex, that I decided to build my own. And to make sure that it will not end up as crappy as the default one, my goal was to make sure no listclass or whatsoever would be used.

ikTree

more…

DragManager prevents mouse events of children *Updated*

On , Flash / Flex - 4 Comments

I just ran into another strange behavior of flex. Lets say you have a VBox, with an image inside. When the user clicks the image, it should do some stuff, but when the user clicks (mousedown actually) the VBox it should start dragging. You would expect that when you click the image, both events are fired. This is true when you don’t invoke the dragmanager. If you call the dragmanager, it cancels out all further mouseEvents, thus preventing the code of the image clickhandler to execute. more…

AMFPHP vs. WeborbPHP

On March 14, 2008, Flash / Flex,php - 8 Comments

The other day, we were discussing remoting frameworks and the options you have on a php server. At my work, we use AMFPHP, and never really looked for other solutions. For .NET applications we use WebOrb, so I was wondering how the php version of WebOrb would perform. The results are quite shocking.
more…

Flex 3 my ass, it's like going back to Flex 0.2

On March 3, 2008, Flash / Flex - 9 Comments

Damn I hate the new flex builder. Flex Builder 2.0 wasn’t good, but the new Flex Builder is just plain rubbish! I wish adobe didn’t bought macromedia, I’m sure MM wouldn’t release such a crappy product and have the guts to call it a complete new version. FB3 doesn’t even deserve the name beta, let alone final!

more…