Using ServiceCapture and Fiddler with FireFox

September 5, 2008 – 11:40 pm by Sam Ahn
I've been using both ServiceCapture and Fiddler for a while now to debug HTTP traffic from web applications (I've dabbled with TamperData but never got hooked). Using such software with FireFox was a bit cumbersome due to the network settings you have to turn on and off. That is until I stumbled across the ConnSets plugin. ConnSets lets you save network settings configurations and switch from one to another with a click of a menu option. Here are some tips for working with ConnSets: Create a Default Setting After installing ConnSets, you get the default option "none - Standard" as shown in this screenshot: Selecting "none - Standard" essentially turns off ConnSets. If you've changed your network settings and then choose "none - Standard" it does not reset your settings to the default "Direct connection to the Internet". Create a default setting and use that instead of "none - Standard". Go to: Tools > Options ...

SVN hidden files affecting Flash CS3 publishing

August 5, 2008 – 9:47 pm by Sam Ahn
It appears that SVN hidden files can affect Flash CS3 publishing. A couple other developers and I came across an issue when trying to publish an .fla. We're all on Window XP and the files are in SVN. One day Flash started showing errors when publishing such as: 1046: Type was not found or was not a compile-time constant: [class with static consts]. 5001: The name of package '[class package]' does not reflect the location of this file. Please change the package definition's name inside this file, or move the file. [class pointing to library symbol] Of course we couldn't find any issues with the code or .fla. After much trial and error it was discovered that if you exported the source files (thus removing all SVN hidden files) it published without any errors. After even more trial and error, it was discovered that there is some threshold of files in SVN that ...

The Morphic Group Helps Build PermissionTV PDK

July 30, 2008 – 10:11 am by Joey
The Morphic Group has been working with PermissionTV since 2007, lending our engineering expertise to the architecture and development of the next generation of the PermissionTV platform. Specifically we've been working with them on the Platform Development Kit (PDK), which contains a large set of libraries and an application architecture designed for the express purpose of building highly flexible video applications for the PermissionTV platform using Flash and/or Flex. PermissionTV just announced the official launch of the PDK, and now we get to talk about the work we've been doing. This is good news for us because now we can finally start to disclose details of what we've been working on in silence for months and months. We think the PDK is one of the coolest projects we've seen in a long time. We really like PermissionTV, and we think they've got a real edge over their competitors because they are ...

Dynamically Getting JavaScript Properties

July 23, 2008 – 10:44 pm by Sam Ahn
Jumping off of Joey's post about anonymous functions from externalinterface, here's a quick and perhaps obvious method of dynamically getting JavaScript properties: package examples { import flash.external.ExternalInterface; public class JavaScript { public static function getProperty(name:String):Object { var property:Object; if (ExternalInterface.available) { property = ExternalInterface.call("function() { return " + name +"; }"); } else { property = new Object() } return property; } ...

Flex Link Buttons: Adding line breaks/wordwrap functionality

July 23, 2008 – 4:05 pm by Dennis
In my endless pursuit to rely more on the flex framework instead of created components from the ground up (call it a outset of flash-itis), I still find cases where I need to refine flex components. For example, Link buttons. How do you add line breaks and word wrapping in a link button? After a bit of searching ... I found this simple solution that I would like to share. You would essential extend the linkButton class by creating your own custom linkButton. This custom component would override createChildren and measureText methods. In createChildren(), you would enable "textField" to workwrap and allow multiple lines. Then in measureText(), the correct height and width needs to be set by getting line metrics of the "textField". Note: "textField" is a Text Field property in the base class. ... override protected function createChildren():void { super.createChildren(); if (textField){ ...

The Morphic Group: Adobe Solution Partner

July 2, 2008 – 5:35 pm by Sam Roach
The Morphic Group is proud to announce its participation in the Adobe Solution Partner Program. This strategic alliance is a conscious effort to demonstrate the company's dedication to its customers by leveraging access to Adobe's developer core, as well as strengthen The Morphic Group’s brand in the RIA community. The Adobe Solution Partner Program benefits partners who extend, enhance and support Adobe products and technologies in the solutions they deliver to customers. As a member, The Morphic Group recognized the additional benefits and opportunities Adobe's program provides. And by integrating new technologies into their products, The Morphic Group is able to extend their reach as well as provide superior support.

LineLimitText Component: Text With maxLines Property

June 17, 2008 – 3:46 pm by Sam Ahn
A little while ago I worked on a project that required some Flex screens to have text fields display dynamic text using a specified maximum number of lines. A simple solution would be to merely define a height on a Text component. In this case there were other components that flowed in the layout below the text field. Setting a height would show an unnecessary space for text that had fewer than the maximum number of lines. Also setting a height wouldn't work well with changing the text styles. So what was I to do? After reading the Flex docs and scanning the Text, Label, and TextField source, I decided to subclass the Text component. Here is the resulting component: package com.themorphicgroup.controls { import flash.text.TextLineMetrics; import mx.core.mx_internal; import mx.core.UITextField; import mx.controls.Text; use namespace mx_internal; public class LineLimitText extends Text { ...

Better Unit Tests With FlexUnit

June 17, 2008 – 7:55 am by Joey
This is probably not news. In fact, it's definitely not _new_ news on account of I learned about it from Theo Hultberg's blog from a post from last year (http://blog.iconara.net/2007/02/06/flexunit/). However, it was, rather embarassingly, news to me, and therefore I'll post it just in case someone else doesn't know this. You can write unit tests with FlexUnit using what is probably a more familiar structure to most people than the structure promoted by the FlexUnit documentation. I've been using FlexUnit for a few years. And during this time I naively thought you _had_ to write tests using the structure that Darron Schall wrote about (http://www.darronschall.com/weblog/archives/000216.cfm). However, I never really cared much for that structure. I found it strange, and it didn't provide the flexibility I wanted in unit tests. For client work I just accepted this. However, recently I started writing a new chapter for the pending Programming Flex 3, ...

Flash Video: The Best of Both Worlds (or how I learned to love Cue Points)

June 11, 2008 – 1:21 pm by Dennis
Video is the word. It is now used every capacity on the net. The idea of using video with animation is not new. Some would swear by using After Effects solely and not consider building flash timeline animation with video. In some case, you use what you know. And at The Morphic Group, we know Flash and Actionscript. We were asked to build a presentation that featured video of a person talking about the client’s product while presenting statistic and data in an exciting visual way. We decided to do this presentation with Flash Timeline animation, Actionscript, FLV video files and some luck. The idea was to get a production house to produce video excerpts with alpha layers. A script was conceived and the video assets were delivered within a few weeks to a month (give or take the corrections and post-production snafus). While we were waiting for the video to ...

Anonymous Functions From ExternalInterface

June 5, 2008 – 9:49 am by Joey
I've been working on an ActionScript library for a project. One of the recent and new requirements for this library is that it has to interface with a JavaScript API for a browser plugin. The JavaScript API for this particular plugin requires constructing instances of JavaScript objects, maintaining persistent references to those objects, calling methods on those objects, creating divs, changing styles for divs and JavaScript objects, etc. Rather than create another set of JavaScript functions and require yet another <script> tag in the HTML page I figured it would be nicer to encapsulate everything into ActionScript. Perhaps what I'm about to say is common knowledge and nothing of any interest to anyone. However, I thought it was interesting and worth posting about. The first parameter for the ExternalInterface.call() method is a string containing a name of a JavaScript function. When executed the call() method effectively appends the function call operator ...