Archive for December, 2003

Opal UI Case Study Part II: Design Decisions and Emerging Usability Design Patterns

Telrock's original design brief stated that Opal should be "Outlook for SMS". That it should look and behave like Outlook in every way. This was, of course, a reflection of Opal's target audience: enterprise users who are already familiar with Outlook for email.

Although I could understand the business need behind wanting to emulate it, I was worried that Outlook's multi-pane interface was overly complicated for the modest requirements of SMS. It was important to notice that Email and SMS are very different mediums. Although emails can run into the thousands of words and contain complex attachments, SMS messages are limited to 160 characters. We also had strict limits on screen real-estate: Opal had to display on 800x600 screens and re-layout as would a desktop application when scaled. I knew that there would be several factors that would affect the usability of the whole application.

Outlook: Powerful but complicated.


Looking back on these, I see that I can summarize as them as a set of useful usability design patternettes (baby patterns, not fully developed or abstracted out and documented as per efforts such as the GOF catalog. I plan to develop and analyze these further as time goes on and look forward to your comments on them.)

Emerging Usability Patterns

Talk One Language

There should only ever be a single term or phrase used to refer to any given item in the application. An item here may refer to a concept, a business function or task or even a widget or individual interface element. You will find that the use of a metaphor for the project, as advocated by XP, will ease this task tremendously.

Respect User Effort

Try to limit the user's physical toil while using the application. Scrolling while viewing messages must be kept to a minimum or obliterated altogether.

Let The User Work

Users must be able to perform their most frequent, most important tasks without any resistance. For an SMS Messaging app this would include reading, replying to and forwarding messages and quickly checking the various mailboxes.

Prevent, Don't Scold

Whenever possible the UI should prevent the user from making a mistake instead of alerting the user to the mistake after the fact. This must be achieved without the UI getting in the way of the user.

Give Sufficient Feedback

The UI should give the user sufficient feedback for users actions. (This ties in nicely with Steve Krugs "Don't Make Me Think" philosophy: The user should never have to think "did that work?") Related to Don't Lose The User, see below.

Show, Don't Tell

Although this may seem to contradict with the Give Sufficient Feedback pattern, it is rather meant to compliment it. Whenever possible, meaningful visual cues (when appropriate to the audience) should be chosen instead of lengthy textual descriptions. This can also pertain to actually teaching a user to do something in an application by showing them.

Don't Lose The User

The UI should protect the user's sense of spatial positioning. The user should never feel "lost" within the application.

Don't Sell What You Can't Deliver

Users must not be given Graphical User Interface (GUI) expectations that cannot be met (or can only be partially met) within a Web User Interface (WUI). Whenever OS or GUI expectations are set, they must be fully met. That said, the application must try and meet OS expectations as much as possible, especially for ergonomic features such as keyboard shortcuts and navigation but also for expected auxiliary helpers such as tooltips.

Don't Keep Them Waiting

The application must perform fast enough to be considered usable within the given engineering limits for the application.

As you can see, these are general points of advice that can apply to any application and yet have been presented here at times with specific relevance to the Opal problem domain. Based on these overall guidelines, the following are examples of high-level design decisions that were taken and applied in Opal.

Patterns Applied: Examples from Opal

The SMS Character Count gives users sufficient feedback and the message textbox allows users to see a whole SMS message without scrolling.
Respect User Effort: Eliminating Scrolling

The message preview textbox was created so as to display a full SMS message without scrolling. Although this meant that we had to be frugal with the other form elements we placed on the Message Tabs, it was more important for users to not have to scroll to read an SMS message.

Give Sufficient Feedback: SMS Character Count

We created a custom SMS character count widget to show users exactly how many characters they had left before they would need to send a message as two SMSs and then three SMSs. This was an especially important piece of information for users as they would be charged by SMS message sent.

Prevent Don't Scold: Form Validations

All forms in Opal implement client-side validation. Submit buttons (such as "Send Message" or "Add Contact") gray out until the form has passed client-side validation. Of course, Ali and Steven made sure that all forms are validated server-side for correctness and security before being processed. Client-side validation in no way negates the requirement for server-side validation. The two have entirely dissimilar goals. Client-side validation exists solely to improve the user experience.

The Send Business Card screen doesn't let users hit the send button before they have filled in all required fields.


Let The User Work: Mailbox Tabs and Message Action Tabs

The Mailbox Tabs allow users to quickly switch mailboxes.A composite tab-based interface was designed to expose the critical, most frequent tasks of users. The mailbox tabs allow users single click access to their mailboxes while, at the same time, exposing the mailbox-sensitive message actions. Thus, users are immediately able to see the context-sensitive actions they can perform on a message in a given mailbox tab. On the other end of the usability scale would have been an implementation of a context-senstive menu for messages that would hide the possible actions until triggered (according to usability studies, most beginner/intermediate users do not use context-senstive menus.)

Show, Don't Tell: Menu Bar and Tool Bar as teaching methods for migrating Outlook Users.

The Menu Bar and Tool Bar allow Outlook users to migrate easily to Opal.To provide a migration path for Outlook users, while at the same time trying to meet OS expectations, we implemented a menu bar and tool bar reminiscent of the ones in Outlook. If these simply performed the expected actions, Outlook users may have been expected to rely on using them for their everyday work. This would not be an optimum use of Opal, however, as the menu especially adds a level of complication to frequently performed tasks (users have to open a menu to select an action). Instead, the menu and tool bars were implemented to Show, Don't Tell. When an Outlook user first changes to a given mailbox using the menu or tool bar, the Mailbox tab animates to the chosen mail box, thereby showing the user that they could also have clicked on the tab (although the tab control is a well-known GUI component in its own right.) The same goes for when the user selects a Message Action (eg. Reply). Using this system, Outlook users can very quickly adapt to the efficient way of using Opal through the tab interface (and this, without being told how to!)

Don't Lose The User and Don't Sell What You Can't Deliver: Screen-based RIAs vs. Multiple-Window-based RIAs.

Opal uses a screen-based approach instead of a full window-based one so as not to confuse users with unfulfilled operating system expectations.It is very important to note the differences between Graphical User Interfaces (as used by desktop applications such as Outlook) and Web User Interfaces (as used by Rich Internet Applications such as Opal). It is equally important to manage client's expectations as to the limitations of Web User Interfaces, even those termed "Rich" and developed using Flash.

The greatest difference between a WUI and a GUI is usually the most overlooked: WUI applications run from within a GUI application which, in turn, runs inside a window-based operating system. Past usability studies have shown that especially beginning users have problems with the concept of multiple windows, preferring usually to keep a single window up at a time. Even in multitasking operating systems like Windows XP or OS X, novice users sometimes prefer to start up a single application, shut it down and start another application and so on. The perceived complexity of the system is heightened when the user is confronted with an interface (an RIA such as Opal) within a GUI application (the web browser) that itself contains windows.

Firstly, we rob our novice user of the comforts of his single window existence. Secondly, the new windowing system works in a different way and contains its own rules and limits. It is thus important to implement a screen-based interface in RIAs so that you Don't Lose The User and Don't Sell What You Can't Deliver.

Even if an RIA developer takes pains to develop a Multi-Window Interface that mimics a certain dominant OS, the interface is still being presented to the user in the document area of a GUI application (the web browser). This is contrary to OS expectations wherein users expect not to see windows within documents. Perhaps this is one area where application browsers such as Central will have an impact on user expectations. It remains, however, that the only way a multi-window interface can provide a high-level of usability in an RIA is if the application can run in its own OS window and not as a document within a web browser and thus access the windowing abilities of whatever OS it happens to be running on. As this is currently not a possibility with Flash, we decided to go with a screen-based system in Opal.

Although modal pop-ups are sparingly used due to issues of screen real-estate and Outlook migration expectations, users are visually shown that these dialog boxes are modal screens via the graying out of lower screens. Although this removes the OS expectations surrounding non-modal multiple-window interfaces, the graphic similarity of the dialog screens to windows has led certain users in testing to attempt to move windows around. This may thus be a feature that we implement in the second release so as to adhere to Don't Sell What You Can't Deliver.

Don't Keep Them Waiting: The name of the game is performance.

If there was one issue we kept running into during development of Opal, it was performance. It is no secret that Flash is not the fastest kid on the block and it is possible to run into issues when client's expectations are not managed as to the limitations of RIAs. Although RIAs can recreate a lot of the desktop application experience from within a web application, there are limits.

A detail from Bits And Pixels custom Grid component. The component is 10x faster than the Macromedia DRK Grid and implements the same API.One issue we ran into, for example, was that the speed of the setSize method on the Macromedia DRK Data Grid was resulting in unacceptable redraw times when the application was resized. This resulted in a very risky two-weeks in which I wrote a completely new Data Grid component that implemented the DRK Data Grid interface and could be plug-and-play replaced into application. The resulting Data Grid offered a 10x performance boost and brought redraw rates back within acceptable limits.

The Menu Bar, Tool Bar and the buttons in Opal are all instances of the smart Menu Component that Bits And Pixels built.What about the risk and additional cost introduced into development? Would those two weeks have turned into four, six, or possibly a buggy implementation of a core component that could have plagued Opal's existence had I not had extensive experience in creating similar components for the K12 Online School? Should competent application developers be expected to also be proficient component developers? I will try and tackle these questions in the next installment in this series: Dances with Components, wherein will be told the story of the Opal Data Grid, Opal Menu and the Exciting Tale of the Many Components That Were Optimized, Extended and/or Decorated.

In the Editorial for the series, I will examine whether or not Flash MX 2004 or Flex would have solved these issues had they been available for use while we were developing the first release of Opal.

Opal UI Case Study Part I: Architecting the User Experience

Web Applications have been around for years, what makes RIAs different? Answer: The User Experience.

At Bits And Pixels we do one thing: Architect Rich Internet Experiences. Although it's our tagline and may appear to be blatant marketing speak, it's not. Our focus in RIA development is usability and the user experience. It is the user experience that sets RIAs apart from existing web applications and the usability of an RIA, just like the usability of any application, will ultimately determine end user acceptance or rejection of the product.

In software development there is a worrying statistic: According to the Chaos report (the Standish Group, 1995), over 75% of all IT projects fail. Failure can come in the form of user rejection or schedule and budget overruns or both.

Over the years, the field of Human-Computer Interaction (HCI) has developed guidelines for User-Centered Product Development. In tandem, progressive software engineers have flocked under the banner of the Agile manifesto and Agile development methodologies such as eXtreme Programming (XP). This year at CF-Europe, I presented a session wherein I highlighted our development methodology at Bits And Pixels: User-Centered Agile Product Development (UCAPD). That session was based in part on my experiences with Ali and Steven on Opal (they are devoted and effective practioners of XP) and in part on my (ongoing) devotion to the study of HCI, including ergonomics. As someone who has been using a computer for over 19 years and suffers from Repetitive Stress Injury (RSI), I have a very personal interest in making applications usable and ergonomic and believe that all software manufacturers should be held accountable for the ergonomics of their software.

Although over 75% of all IT projects fail, the secret to a software project that does not fail is very simple: Know your users, listen to your users and keep listening to your users as you develop. XP states that the customer should be a member of the team. Most times the customer and the user will not be the same. In these cases, UCAPD states that both the customer and the user should be part of the team. In fact, this is a conclusion reached by many XP practitioners in real-life, and is even outlined in the excellent book eXtreme Programming in Action: Practical Experiences from Real World Projects (Lippert, Roock & Wolf). The customer is responsible for handling the business domain but it is the user who has ultimate say in whether or not an application is usable.

In developing Opal, we asked but could not have access to independent end users (enterprise users of Opal). Instead we had to make do with the customer as user. As such, from a UCAPD perspective, we built Opal for user acceptance by the customer. In that regard, it passed with flying colors. In this instance, our customer was also a previous/current end user and thus I was less hesitant to press my case. In a manner of speaking, our customer was also our user and although I would have liked access to independent end users (at least to minimize the chances of an "ought to" error* creeping in), it was not a show-stopper in terms of development.

Application development is all about risk management. Having a solid Agile development process and a focus on the user, usability design and usability testing all work towards minimizing risk while embracing change.

In the next installment of the Opal UI Case Study series, I will take you through Opal's high-level usability and UI design decisions, starting from the brief and exploring emerging usability design patterns.

* "Ought to" errors are sneaky little things. They arise when managers have expectations of how end users "ought to" perform their tasks. It is not uncommon that these expectations carry little or no relation to how end users actually perform their tasks. The unsuspecting developer ends up developing an "ought to" system that meets with initial management approval, followed by end user rejection.

Flash Ant Opal UI Case Study Series

Welcome to the Opal UI Case Study series by Bits And Pixels.

Opal is the Enterprise SMS Messaging RIA that Bits And Pixels built in conjunction with Ali McLeod and Steven Webster for Telrock Communications. In this series, I will take you through Opal's user interface, highlighting some of the usability and UI design decisions that were made and discuss the challenges we faced and how we overcame them.

If you have not seen Opal in action, we have prepared a narrated Flash Presentation on the Opal UI over at Bits And Pixels that should give you a good idea of how the application looks and works.

Present installments:

Future installments:

  • Part III: Dances with Components
  • Part IV: Lessons Learned and Applied
  • Part V: Opal: Future Directions

Editorial: Would Flash MX 2004 or Flex have decreased development time and lowered risk for Opal?

Utilizing your ActionScript knowledge to Script Windows (and backing up your sites while you’re at it!)

As part of reviving the What Is Flash Wiki, I restarted the scheduled automatic daily backups of the database from the web server to my local backup machine and thought it would be nice to share with you how I achieve this as it involves JScript for scripting Windows and JScript is a close cousin of ActionScript (they are both based on the latest ECMAScript specs.)

Update: If you're looking to do the same thing on OS X, Mike Chambers has a great post on Shell Scripting on OS X with ECMA / JavaScript

On a hugely dynamic site such as a Wiki or forum, it is very important to have constant backups of the database to protect against data loss. On a busy site with lots of updates, losing even a day of data is not good but it's worse if that becomes two or three days or a week! The way the What Is Flash server is set up, you can hit a certain URL (with proper authorization) to download backups of the site or of the various databases that it uses. What is needed is a script file that hits these URLs and does so on a daily basis, archiving the backups on the local machine. Enter the Scheduled Tasks scheduler and Windows Scripting.

If you're on Windows, there's very little you cannot automate using the Scheduled Tasks scheduler and Windows Scripting Host WSH).

Here are three of the best references I could find on them:

To download the backups, I've written a script in JSCript that creates a directory with the current date as its name (in the form YYYY-MM-DD). It then goes and gets the latest backups for that day from the site and saves them locally in the newly-created directory. In order to access the site, I use Lynx, a powerful text-only browser famous in the Linux/Unix world. You cannot use IE for this since IE doesn't support the type of command line arguments that Lynx does. (You can also use CURL and a Cron job for this and it may more sense for you to do so if you're on a Unix-based system.)

The following script illustrates how it works (you need to have the Lynx.bat file -- see the Lynx installation instructions to know what I'm talking about -- in the current directory and substitute your own URL in the script here.

If you save the script as some_script.js, you can run it from the command line using wscript some_script.js. If you now add this to the Scheduled Tasks (Start->Programs->Accesories->System Tools->Scheduled Tasks and then double-click to launch the Add Scheduled Task Wizard) you can have it execute automatically at a specified time interval (eg. every day.)

Scripting Windows using JScript is a piece of cake if you know ActionScript and can give you complete control over your system. Coupled with the Windows Task Scheduler, you can automate things too.

What Is Flash revived!

What Is Flash project revived!

I have just revived the What Is Flash project. More information is available on the What Is Flash Announcements page

RecordSet.as filter() method fix for Flash MX 2004

I first encountered the issue with the RecordSet's filter() method around May of this year while working on a project with Flash MX. At the time, I documented it and mentioned the fix without actually posting any code on it.
Continue reading 'RecordSet.as filter() method fix for Flash MX 2004'

The ARIAWare RIA Platform and Pattern-Based RIA Development

A high-level overview of the client-side framework in the ARIAWare RIA Platform (ARP)

The ARIAWare RIA Platform (ARP) is a framework by Bits And Pixels that has evolved over many years and reflects the sum of years of experience with Flash and RIA development dating back to the Flash 4 and Flash 5 days. The foundations of ARP date all the way back to our experience in creating the world's first (and largest) RIA, the K12 virtual school that I helped develop in 2000 in Reston, Virginia. After leaving K12, I took a few months off to create the very first version of ARP, in Flash 5 and released parts of it as the open-source FC-Lib library. This evolved, in time, to Flash MX and parts were again released as open source as part of the Moose library. (Can you tell that I'm a big fan of open source?) In order to bring the platform in line with best practices in software architecture, we researched many standard software patterns and implemented them in a ground-up, complete rewrite for AS2 following our work on the first release of the Opal project. The current platform is written in an entirely new language (AS2) and contains no direct code from the Flash 5 or Flash MX versions or from the platform used during Opal. We currently do not have plans to open source the platform but we are holding consulting and training sessions on pattern-based RIA development and will be happy to consider licensing ARP on a per-case basis.

In this article, I want to take you through ARP and the design patterns we have used in creating it. In doing so, I hope you will also get a better idea of what design patterns are and which ones are the most popular (and useful) for Rich Internet Application development.

Design Philosophy

The design philosophy behind ARP involves embracing a Componentware approach to software development or Component-based Development. As stated in the Software Architect Bootcamp (Malveau, R, Moubray, Thomas J.), the elements of Componentware include:

  • Component infrastructures
  • Software patterns
  • Software architecture
  • Component-based development

Componentware uses polymorphism, encapsulation, late binding; delegation instead of inheritance.

ARP makes use of widely-known and accepted Design Patterns whenever possible. Design patterns are "proven software design ideas which are reused by developers" that are "considered as simple as common sense by expert-level developers." (p.50-51; Software Architect Bootcamp).

Template

The structural classes within ARP are implemented using the popular Template pattern. This pattern, presented in the Gang of Four book (p.325), is especially useful for class libraries such as ARP for placing common functionality within the library.

Applications based on ARP import and extend the base ARP classes (eg. Controller, Command). ConcreteClasses based on the templates must implement any Abstract operations (also known as "primitive operations") and may implement any required hook operations. (The Concrete Classes use the hook operations to extend the behavior of the template.) The contract for Abstracts operations is enforced using interfaces in AS2 to give greater compile-time error checking support.

The View

ARP is implemented in a manner as to allow it to work seamlessly with Form-based development in Flash MX 2004 Professional and future technologies such as Flex. It is also structured so that it can work with lightweight replacements to the Form architecture. This flexibility widens the applicability of ARP beyond standard RIAs to web sites and applications that require a smaller footprint without sacrificing application structure and maintainability.

We have developed in-house reference applications that use both the Flash MX 2004 Professional Forms and a lightweight alternative we call ARP Forms. ARP Forms are being used for the first time in a commercial configurator application for one of our clients. Currently, there are astronomic performance gains to using ARP Forms over Flash MX 2004 Professional Forms. Since ARP Forms implement the Flash Forms interface, once the performance issues with Flash Forms have been ironed out we can replace ARP Forms with Flash Forms (and vice-versa) in plug-and-play fashion. The same goes for using Flex as the presentation layer in future applications.

The Controller

The Ariaware Application Controller works in a fashion that is similar to the Controller described in the Command Procedure pattern document at openloop.com wherein it is stated "In essence, Controller is like a server waiting for request to map to Command objects". This is also in line with designs of the Controller pattern as stated in popular books such as Core J2EE Design Patterns (p.64). As stated there, "Control code may also be encapsulated in command objects that work in coordination with the controller" (p. 65) and "Encapsulate code related to lookup services and caching in Business Delegate" (p.302). This is what we have implemented in ARP.

ARP, thus, allows the use of a Controller to map View events (which we call System Events) to Commands. The Controller listens for System Events and maps these to Commands. We have taken this implementation one step further using a naming convention that automates the mapping process while minimizing the chances of coding error and halving the amount of code that would otherwise be necessary. This convention brings further structure to the application and improves our maintainability.

Commands

Commands are implemented in a standard manner, as discussed in Javaspaces Principles, Patterns and Practice, p. 166 (Freeman, Harper, Arnold; Sun/Addison-Wesley). In addition, we have taken the advice of Core J2EE Design Patterns p. 302 in delegating "code related to lookup services and caching in Business Delegate".

The Controller acts as the Invoker and the Business Delegate and the View are both Receivers.

One of the shortcomings that we noticed during the development of the Opal project was how the framework being used could not handle multiple views for a single command. This lead to the duplication of commands to service different views and quite a few headaches. Although we brought up the issue during development, time constraints meant that we couldn't implement a solution for that platform at the time. We're happy to have created a system now that does not necessitate the duplication of commands to service multiple views.

In ARP, the Controller creates Command instances for each service call and the Command instances are each passed a reference to the view that they pertain to.

Although we had come to the conclusion that View Helpers would be necessary for Opal, our new ARP framework does not require their use. In ARP, public methods within thew view serve this purpose. We now view (no pun intended) View Helpers as an artificial and unnecessary addition to a Flash-based RIA/platform in AS2.

Business Delegate

The Business Delegate hides the client from the complexity of remote communication with business service components. It hides the implementation details of the business service, such as lookup and access mechanisms. It reduces coupling between client and system's business services and possibly shields client from volatility in implementation of business service API. (Core J2EE Design Patterns p.302)

Business Delegates are implemented in a standard manner as stated by Core J2EE Design Patterns (p.302) to "Encapsulate code related to lookup services and caching".

Specifically, the model given on p.302 describes our implementation of the Business Delegate, with the Command acting as Client.

Service Locator

The Service Locator is an abstraction that allows us to decouple the service location function of our applications from the service consumption function. The Service Location in ARP is a slight variation of the implementation of the Service Locator as outlined in Core J2EE Design Patterns (p.316). The Service Locator, thus, is a singleton that returns an instance of a service when asked for it by name. For the most part, in our development, a Service means an OpenAMF (Flash Remoting) Service but could easily mean a web service or a local implementation that interacts with local or remote shared objects, etc. To add yet another layer of abstraction and increase our flexibility, we have implemented a hot-swappable GatewayConnection singleton that is utilized by the Service Locator for connecting to different types of services: Gateway connections currently exist for Flash Remoting, Local Shared Objects, Remote Shared Objects, Video and Audio (using Flash Communication Server) and local files (xml, flat file).

Value Objects

We use Value Objects (sometimes referred to in the latest Flash documentation as Transfer Objects) to model problem domain objects and structure the exchange of data among the various tiers. You can find a good explanation and implementation of Value Objects over at the Java Practices web site.

Singletons

ARP makes use of the Singleton pattern in implementing quite a few of its components. These implementations are standard implementations of the pattern as widely published (e.g., Applied Java Patterns. Sun Microsystems Press, p.37).

Components

A Componentware approach to software development would not be complete without components and we use quite a few in our daily development. In addition to the standard Macromedia Flash MX and Flash MX 2004 components and the ones in the DRKs (most of which we have heavily extended using the Decorator pattern and/or optimized for performance) we utilize third party components as well as our own custom components. Our current range of custom components includes a robust Menu component that uses the Composite pattern and introspection to automatically draw itself either as a menu bar, toolbar, image button or a simple text button, a movie loader component based on the FC-Lib Movie Loader class and its big brother, the Tornado Movie Loader that allows us to implement intelligent preloading in applications, a custom Data Grid component that implements the Macromedia DRK Data Grid interface while offering a performance improvement by a factor of ten as well as other helpers and components.

We have plans to package and license some of these components in the very near future, to coincide with the official launch of our new ARIAWare brand, so keep your ears peeled!

In Conclusion

We have put a lot of time and energy into creating ARP, the Ariaware RIA Platform, and it is already proving to be a great enhancement to our productivity. ARP allows us to rapidly develop Rich Internet Applications that are easily maintainable and scalable. Our experience with Flash since the early Flash 4 days and our work in RIAs dating back to the Flash 5 days means that we know a thing or two about what works and what doesn't for n-tier rich-client web application development using Flash. The delicate balance lies in adapting current best practices to Flash in a performant manner that suits the limits of Flash while guaranteeing maintainability and scalability of the application. ARP is one tool in our toolbox that lets us do that.

In this article, I have only discussed the client-side architecture of ARP and that is really only half the picture. ARP also comprises a J2EE-based server-side framework architected by Isiltan Kef, our Lead Java Developer, and I have a nasty suspicion that he will be publishing some details about it in the near future.

I hope you enjoyed reading about the various design patterns and how we've used them in ARP. We would encourage anyone interested in developing RIAs to learn and use design patterns in their own work. There is a wealth of information, both online and in books, regarding design patterns and their implementations. Although certain patterns solve problems that only really relate to certain platforms (e.g. traditional web application development in a stateless environment), many others can be implemented directly in ActionScript, many times through adapting standard, published, reference implementations.

Ariaware RIA Platform and ARP are trademarks of Bits And Pixels, Ltd.

An Interesting MX 2004 Migration Issue: Case Sensitivity and Scope

I'm in the process of migrating Opal, our Enterprise SMS Messaging RIA for Telrock Communications, from Flash MX To MX 2004 and I just ran into a very interesting issue that appears to be related to case sensitivity and variable scope. The migration, at this point, does not involve a move from AS1 to AS2 -- it is purely aimed at a Flash MX 2004 recompile optimized for the Flash 6r65+ player to reap the performance gains.

Returning to the issue at hand, the following code works in Flash MX:

SomeCommand.prototype.execute = function( viewRef )
{
	var someBusinessDelegate = new SomeBusinessDelegate( this );
	someBusinessDelegate.someMethod();
}

It does not work, however, when compiled in Flash MX 2004 (the someMethod() method of the SomeBusinessDelegate is not called.) I am guessing that either SomeBusinessDelegate is undefined or it somehow shadows the local variable, someBusinessDelegate. I say "guessing" because if I add a trace, to check the typeof SomeBusinessDelegate, the darn thing works! :)

So, this works: (How weird is that?)

//...
trace (typeof SomeBusinessDelegate);
var someBusinessDelegate = new SomeBusinessDelegate();
//...

Don't you just love these situations? It's like an awkward moment of silence where you're staring at Flash, Flash is staring at you and you're pretty much speechless. I think if Flash could blush it would, perhaps even manage a shy smile and shrug its shoulders as if to say: "Oops!.. oh well!"

Skipping over the Miracle Trace Fix (tm), I tried changing the name of the local variable from userDelegate to lUserDelegate and voila... the business delegate got called.

I'm guessing that this is some sort of scope issue that behaves differently in Flash MX and Flash MX 2004. Definitely one to watch out for!

Now I venture bravely on to solving some other fascinating migration issues (can you hear the drums? The trumpets?) :)

Registrations, User Accounts and Commenting

I just realized that we had accidentally disabled registrations and, of course, you need to register to post comments... I believe that would explain a certain lack of comments on this site :)

I've just enabled registrations and, furthermore, I've transferred all current accounts from onRelease.org so you don't have to re-register if you have an account there. You can use the same username and password to login and post comments here.

The procedure for getting commenting privileges is to register for an account and then use the provided link to email and request that your account be upgraded. Although it may seem like a convoluted process, it has completely eliminated blog spam on onRelease. I'm seeing more and more blog spam everywhere and it's not pretty.

As always, we look forward to reading your comments!

Introducing FLP Maker

FLP Maker creates complex project files in seconds!Do you use the Project Panel in Flash MX 2004? If so, then do we have a present for you!

We recently started porting a large project from Flash MX to Flash MX 2004 and the prospect of having to recreate the project's folder structure and add each .as and .fla file to the Project Panel by hand seemed almost as exciting as getting two simultaneous root canals while listening to endless tracks of Barry Manilow! So, instead, we wrote FLP Maker.

What does it do?

FLP Maker recursively adds all the .AS and .FLA files in your Flash project to a new Flash Project file (FLP), automatically mirroring the existing physical folder hierarchy on your drive. So forget having to add folders and files manually to the Project Panel (unless you're a fan of ancient history, that is!)

Installing FLP Maker

FLP Maker is a tiny Java application and should thus be cross-platform (if you have problems running it on a certain platform, please let us know.) Installing it is also very easy:

  1. Download the latest version of FLP Maker
  2. Make sure you have at least the Java Runtime Environment installed on your machine.
  3. Unzip the flpmaker.zip file into a directory on your drive.
  4. (Windows 2000, XP) Switch to that directory and run either w2kinstall or wxpinstall, depending on your system
    (Other) Add the directory to your Java classpath.

Using FLP Maker:

  1. Switch to root Flash directory of your project.
  2. Type the following into a terminal window / command line:

    (Windows) flpmaker [projectName] [rootDirectoryOfProject]
    (Other) java flpmaker [projectName] [rootDirectoryOfProject]

Both arguments are optional. Without any arguments, flpmaker creates a project using the name of the directory it is called for and using the same directory as the root of the Flash project. By using the arguments, you can specify a different project name as well as point to an alternative root Flash directory.

You can use the Other syntax, above, on Windows as well. We've just included a small batch file that saves you the trouble of typing "java " to invoke the Java VM each time (aren't we nice?) :)

We hope you enjoy using FLP Maker and that it saves you as much time as it has saved us!






Bad Behavior has blocked 0 access attempts in the last 7 days.