Skip to Content »

 mxna good to go?

  • May 5th, 2008
  • 5:18 pm

mxna is now redirecting to http://feeds.adobe.com. It’s running pretty nice now, hopefully it stays this way.

 Mate Flex Framework

  • May 5th, 2008
  • 11:01 am

I just heard about the new Flex framework Mate (pronounced ma-tay) from asfusion. After spending some time going through their site I gotta say I am VERY impressed, both by the framework itself, and the documentation they have put together (considering how many times I’ve been let down by poor documentation in the past, Mate’s is great by comparison) .

The framework is tag-based, easy to follow, and looks like it should be pretty easy for people to pick up. It uses EventMap files which contain EventHandler child tags which describe what to do in response to a certain event….call service, set a property on an object, etc. Some cool things I noticed right off the bat:

  • the way their system works, you can use model objects in the Cairgorm style (one ModelLocator singleton) or in the PureMVC style (proxy/”manager” objects managing their data) and it works the same either way.
  • Objects can be created and cached for future reference in response to an event
  • The framework uses “injector” tags to set/bind properties of one an object to another.

There’s definitely a lot more cool stuff going on in Mate. Go check it out at http://mate.asfusion.com/

 Simple Spark

  • April 23rd, 2008
  • 10:07 am

So while Internal Server Error was down again…err, sorry, while MXNA was down again, I went and checked in over at Web Worker Daily and found this gem: Simple Spark, a catalog of over 8500 Web Apps, broken down by category with reviews and ratings for each. It’s pretty impressive, I’ve already found a few I would probably have never heard of that look pretty interesting.

(side note: does this now mean that web 2.0 has folded over onto itself and has begun to implode?)

 Embedding Bitmap Text in Flash CS3

  • April 19th, 2008
  • 12:22 pm

Lost a few hours to this one today. I was trying to embed a font in a textfield with the antialising set to ‘Bitmap Text (no anti-alias)’. No matter what though, the font would not display in the text field when embedded. Turns out that internally flash actually renames the font, to ‘FontName_8pt_st’ (substite the 8 for whatever font size you embedded into the textfield). Not sure what the ‘_st’ part is but so far it seems constant, doesn’t ever change. I’m curious to know the reasoning behind this. Anyway, just remember to use the ‘updated’ font name instead of the normal font name, and you should be good.

 Flex Builder vs. TextMate

  • April 16th, 2008
  • 3:19 pm

I was doing a bunch of Flex work for the past few months, and get really comfortable with Flex Builder. There are so many awesome features to aid development it simply kicks ass.

However, my current project is Flash CS3-based, so I went back to TextMate, which I also love. There are many great features in TextMate which eclipse does not do that really make me miss working in it.

My main points of comparison:
TextMate:

  • Perceptual Bulk - TextMate feels so lean, where FlexBuilder just feels so heavy. Probably due to eclipse not being a native mac app, but still, I just feel ‘cleaner’ working in TextMate.
  • Tab Triggers - I can’t count how much typing I’ve saved using tab triggers in TextMate. Type in a few key strokes and hit tab, and some templated code gets placed…with tabstops mixed in so you can simply tab to the next appropriate place to type. I only pray that someone tells me you can do that in eclipse.
  • Column Selection - Another tool of TextMate that i find incredibly timesaving. being able to select a rectangular area of text, and have whatever you type repeated on each of the selected lines, is a blessing. Another thing I wish eclipse would support.

Flex Builder (eclipse):

  • Integrated debugger - That pretty much puts the smack down right there.
  • Code Sense/Code Completion - Another swift backhand. For being such an awesome text editor, why can’t TextMate handle this better? (yes I know about using the escape key for auto-complete, but that’s pretty weak compared to what you get in eclipse).
  • Find in Language Reference - I use this constantly, and as far I know it doesn’t exist in TextMate (for actionscript anyway)

There’s probably a few more but those are what jump out at me. If anyone knows how to get some of the features listed above into the other app, please do tell :)

 Sending Negative Integers through AMFPHP

  • April 11th, 2008
  • 12:55 pm

There is a weird bug in AMFPHP regarding sending negative integers. If you try and send a number such as -87, it shows up as 4294967209 in php. I did some digging and found on the amfphp forums that it has to do with amfphp's readAmf3Int() method in AMFDeserialzer.php. Here is the updated function that was posted on the forum:

PHP:
  1. function readAmf3Int()
  2.     {
  3.         $res = 0;
  4.         $int = $this->readByte();
  5.        
  6.         if($int <128) {
  7.             return $int;
  8.         } else {
  9.             $int = ($int & 0x7f) <<7;
  10.            
  11.             $tmp = $this->readByte();
  12.            
  13.             if($tmp <128) {
  14.                 $int |= $tmp;
  15.             }else{
  16.                 $int = ($int | ($tmp & 0x7f)) <<7;
  17.                 $tmp = $this->readByte();
  18.                 if($tmp <128){
  19.                     $int |= $tmp;
  20.                 }else{
  21.                     $int = ($int | ($tmp & 0x7f)) <<8;
  22.                     $tmp = $this->readByte();
  23.                     $int |= $tmp;
  24.                 }
  25.             }
  26.         }
  27.  
  28.         $mask = 1<<28;
  29.         $res = -($int & $mask) | $int;
  30.  
  31.         return $res;
  32.     }

 For those unfamiliar: An overview of Flex, FlexBuilder, and the Flex SDK

  • April 4th, 2008
  • 4:05 pm

I wrote this up for a client, and realized I had given some version of this many times, so since I had it all written out I figured I'd post it here. I was trying to keep it somewhat high-level, as it's generally targeted towards the non-developers.

Originally there was Flash. Flash was built as an animation tool and followed a timeline-based approach. When i say timeline-based, think of a filmstrip, and how it is made of a strip of individual, consecutive frames....that was the concept behind Flash, to make editing those long sequences of animation easier. If you open up an .fla file, you can clearly see that each layer is made up of consecutive frames...those consecutive frames are collectively referred to as a ‘timeline’.
Eventually, people figured out that they could build really cool stuff in flash, even full-blown applications that didn’t really have too much to do with traditional animation. Eventually the timeline metaphor, more than just becoming irrelevant, started getting in the way. People were building apps based more an an individual screen-based metaphor, and creating each of those screens on individual frames of the timeline could often be a chore.

So, in order to accommodate Flash application developers, as well as developers coming from other languages into Flash development that were getting scared off by Flash’s awkward development environment, the Flex framework and FlexBuilder were created. In general, the Flex framework is a code library of components which help to facilitate building applications that run within Flash Player. FlexBuilder is the Flex IDE (integrated development environment...big term for a code editor with some other development-related features thrown in) offered by Adobe, which really just a specialized build of Eclipse, which is an industry-standard open source IDE.

In addition to (or instead of) using FlexBuilder, the Flex SDK (software development kit) is open source, and it contains the Flex source code library and compiler, so you can develop Flex apps in any IDE. Setting up and using the SDK will provide the same results as using FlexBuilder, but requires more time and effort to set up...so you get all the tools for free, but you have to set them up yourself. That’s the tradeoff to using FlexBuilder where everything is prepackaged and set up for you already.

Flex application are written using a tag-based approach, so Flex apps are generally made up of text files containing a mix of markup that looks like html (this is called mxml), and Actionscript 3 code. When the flex application source code is compiled, the compiler turns the mxml tags are into normal Actionscript 3 code, and a .swf file is produced. That .swf file runs in Flash Player, the same as a .swf file produced from Flash.

 AMFEXT doesn’t handle incoming arraycollections

  • March 30th, 2008
  • 12:15 pm

Ran into an issue today with AMFPHP trying to send an ArrayCollection...it kept choking when trying to decode the collection. I knew this was already possible, but forgot I had installed the php extension AMFEXT, which handles the encoding/decoding for amfphp when it is installed. Turns out that it doesn't like incoming arraycollections. Disabling the extension fixed my problem, but I would sure like find a way to get them working together.

 BorderSkin on top of children

  • March 27th, 2008
  • 1:39 pm

Sheesh...I just wasted half a day trying to figure out how to get a borderSkin to appear on top of all the children in a custom component I was building. It was a subclass of Canvas, so it was really easy...now that I know, it seems so obvious I want to kick myself. Anyway, you just need to do:

Actionscript:
  1. override protected function layoutChrome(unscaledWidth:Number,unscaledHeight:Number):void{
  2.     super.layoutChrome(unscaledWidth, unscaledHeight);
  3.    
  4.     //move the border in front of the children
  5.     rawChildren.setChildIndex(rawChildren.getChildByName('border'), rawChildren.numChildren - 1);         
  6.  
  7. }

 IMagick - ImageMagick extension for PHP

  • March 25th, 2008
  • 9:30 am

If you're spending a decent amount of time manipulating images in php using GD or command-line ImageMagick, you should check out the Imagick php extension. Imagick provides an object-oriented interface to the ImageMagick API.

As far as I can tell, this extension was left for dead a while ago but revitalized over the last year or so and is now rockin pretty hard. The developer is pretty responsive on the Imagick board at the ImageMagick forums as well, and he's got lots of nice code tidbits on his own blog.

There is also the MagickWand For PHP extension, but I found the syntax pretty odd to deal with, it probably relates more to the way GD works than the OO style of Imagick.