Viewing the ‘Flex’ Category


Nimbus – MVC Framework Intro

04.25.2009
UPDATE: Since the writing of this post, I’ve converted to and fully endorse Robotlegs as my MVC framework of choice. I invite you to check it out.


For those who don’t know, Nimbus is a Flex MVC framework (or micro-architecture for the technically-inclined). Sponsored by Rain, we develop it primarily for use on our applications but make it available for public use and encourage the community to contribute.

Nimbus pulls core concepts from Cairngorm but is meant to cut out a lot of the plumbing developers groan about when they hear “Cairngorm.” It’s light, but it’s not fluffy. Baked in are those rare and tasty flavor morsels you thought only existed in those Funfetti cupcakes your grandmother bakes with love on your birthday. Continue reading »


Loading a Remote Style SWF

04.14.2009

This post has been replaced by Loading a Remote Module into a Local App. Enjoy!


Advanced Callout Component

12.17.2008

Most flex developers have become acquainted with the built-in tooltop the flex framework provides. It’s very convenient when all you need is a plain text hint to display briefly while the cursor is over a particular element.

But what’s a flex developer to do when more is called for? The flex tooltip sometimes just won’t cut it. To appease my appetite, I cooked myself up a callout component. Please, feast with me.
Continue reading »


Blocking TabBar Click/Change Events

12.15.2008

One scenario that often presents itself when developing a Flex application is blocking users from navigating away from the current view.  You might want to do this if the user’s form data is incomplete or if data has changed and you want to ensure they want to discard or save their changes.

When the TabBar comes into play, blocking tab changes isn’t always straightforward.  The TabBar doesn’t dispatch any type of TabChanging event that can be canceled.  Nothing else is really offered in the way of blocking the action either.  To make matters worse, a click on a tab in the tabbar actually dispatches two different click events, one of which is a “simulated click trigger event.”

My purpose isn’t to go into the shortcomings of the TabBar component or its inner workings.  Instead, I’ll offer the BlockableTabBar for your use:
Continue reading »


Meta-Learnings from Adobe MAX 2008

12.01.2008

While I learned a fair share at Adobe MAX 2008, I’d like to focus this post on meta-learnings.  What are meta-learnings?  I’m not sure yet, but here we go:

  • Gucci is to Hollywood as writing books is to nerds.  I don’t remember the number of times I heard someone flaunting his/her authorship on a book, but I’m quite positive it surpassed the fingers on one hand.  Writing books is the new black when it comes to tech.
  • Adobe is very in-tune with their customers.  One of their general sessions was focused on presenting how Adobe is addressing specific customer problems.  Key corporate leaders presented in real style and with what seemed to be honest sincerity.  Being that I’ve seen the problems firsthand, I can honestly say they seem to know what their customers need and how to get there.  At one presentation, a member of the audience asked something related to accessing the screen dimensions of a cell phone an AIR application is running on.  I then overheard one of Adobe’s team members on the back row ask another team member, “Do you know if we do that?”  The other one said, “I don’t know, but let’s take a look at it.”  How many times can you ask a question about a product and get the immediate attention of the development team behind it? Continue reading »

Finding the nearest component in Flex

10.15.2008

In Flex, we sometimes need to find the component nearest to the mouse cursor. The following example will show you how to do so. Here are the basic steps:

  1. We will set up an event listener to watch for mouse movements.
  2. On every mouse movement, we will loop through all the application’s children, evaluating each one.
  3. We retrieve the bounding rectangle for the component we are currently evaluating.
  4. If the cursor is to the left or right of the component, we find the distance between the x position of the cursor and the x position of the nearest vertical side of the bounding rectangle. If it’s not to the left or the right, the horizontal distance is zero.
  5. If the cursor is above or below the component, we find the distance between the y position of the cursor and the y position of the nearest horizontal side of the bounding rectangle. If it’s not to the top or the left, the vertical distance is zero.
  6. We use the Pythagorean theorem to find the actual distance between the cursor and the component using the two distances previously determined.
  7. If it is a shorter distance to the component we are evaluating than the distance to any of the components previously evaluated, we’ll make note of it.
  8. Finally, we report the closest component found.

Continue reading »


Adobe Flex Certification Study Materials

10.04.2008

Yesterday I took the Adobe Flex Certification exam.  I did pretty well and passed, so I thought I’d share the resources I used to study:

http://partners.adobe.com/public/en/ace/ACE_Exam_Guide_Flex2.pdf
This will give you a brief intro to the exam, a few ideas of where to start your studying, and a short sample of questions to get you into the testing rhythm.  The questions on there are a fairly good representation of what you might find on the exam.

http://office.realeyesmedia.com/blogs/jun/samples/certification/Flex20Blueprint.htm
This does a good job of breaking down all the topics that might show up on the exam.  It would be helpful to look through the various items and focus on your particular weaknesses.

Continue reading »


The Why, What, and Where of Custom AMF Class Adapters

09.04.2008

If you’ve read my article on Action Message Format (AMF) you’ll already know that AMF is a super-duper way to transfer data between a Flex/Flash/AIR application and its server-side counterpart.  Essentially when the client application makes a call to a service, the server can return a Java (or PHP, Python, .NET) object and when it gets back to the Flex application, wallah, its converted into an identical object in ActionScript.  Similarly, if the client application sends an ActionScript object to the server during a service call, it arrives as an identical Java object.

While that’s impressive, when it comes to implementation in a medium-to-high complexity system there are questions that still need to be answered.   In this article, I’d like to address where to translate custom AMF classes.

Continue reading »


The best Flex MVC framework

08.31.2008
UPDATE: Since the writing of this post, I’ve converted to and fully endorse Robotlegs as my MVC framework of choice. I invite you to check it out. Even so, the content of this post still remains relevant.


There isn’t one.  At least not for everyone.  That’s the bottom line and hours of googling won’t change it.  I’ll explain what I mean–but first, here’s a real intro:

Continue reading »


Simple AMFPHP Example

02.10.2008

With the advent of Flex and RIA (Rich Internet Application) development came AMF (Action Message Format). Flex, in general, focuses only on front-end functionality, meaning it does not directly hit a database to store or retrieve persistent data. Instead, database calls are written in a more traditional back-end language like Java, PHP, Python, or .NET and such services are then exposed to be “consumed” (used) by the Flex front-end.

AMF is a protocol that allows ActionScript (the language of Flash/Flex) to call services exposed by the back-end. Additionally, if you choose, AMF allows you to translate a programmer-defined object between ActionScript and your back-end language of choice. In other words, if you have a customer class in ActionScript and you want to pass an instantiated customer object to the back-end, you simply call the exposed back-end service and pass the customer object as a parameter. The AMF layer transparently translates the ActionScript customer object into, let’s say, a customer object in Java. This functionality isn’t required. Instead of using a class you have defined, you could instead just send an integer to the backend as a parameter and, after processing, send a string back to the front-end. Continue reading »