Life on Rails » Technological travels in Flex, Air, RIA and life in general
Imagine a beautiful autumn park, and a bald ginger man reading books and playing guitar, and doing other stuff

I passed my Adobe Flex Exam

I passed my ACE exam,

Adobe Certified Professional

I’m now an Adobe Certified Professional in Flex. Whoohoo!

I’m really chuffed, I scored 86%, and got 100% on the UIComponent section, which is no surprise really, as I do lots of ux work on our current project. Getting to the exam was hilarious. It was on a Sunday and we don’t have a train service on a Sunday, so I planned it precisely: cabs, bus, tube, the lot. 2 hours of travel to get to the examination only to find… I’d gone to the wrong place!!!

I couldn’t believe it, I had just 45 minutes to get to the other side of London. Fortunately, I found a mini cab office next door with a cab driver who was like something from a Jason Staham movie (think “the transporter”). This guy was super cool, and drove like a maniac. I had to use his 10 year old map of London to find the way to the proper examination centre, which made me sooo travel sick, it was unbelievable..

But we got there, and despite me being late and so sick that I had to sit down for 10 minutes, I passed! I have to say it, the exam is quite hard – you need to know a lot of stuff to pass. Here’s a pic of all the notes that I made over the last 3 weeks. If you’re gonna do this, even if you’ve been doing flex for a year or more, I really suggest reading up, for a few reasons:

  • the areas covered by the exam are very diverse,
  • you need precise knowledge of some controls in order to choose between bogus properties, and real properties,
  • It tests you on some of the finer points of framework, such as low level event architecture and the collection and renderer interfaces,
  • best of all – you learn loads by reading up.
More...

flexTRAMP - "Achieve something with every build"

This is my new open source project…

Flex TRAMP is a testing Runtime Actionscript Mini Parser,..

which means it allows you to interact with your running flex app, and:

  • create variables,
  • assign objects,
  • update attributes,
  • call methods
  • and basically interact with your flex app.

Why?

Me and some colleagues are currently working on a flex app that takes a while to build. It’s very frustrating to do a build, then see that some variable, or object is initialised with the wrong value, and have to rebuild again..

I’m used to working with FIrebug – if something goes wrong with my js, I can modify it on the fly, and try again.

Take this example: We’ve got a part of our app that prints some info out. To get to it, you have to enter lots of registration info, and perform lots of tasks.

With FlexTRAMP, I can fire up the app, and in the command line window that appears when I click the FlexTRAMP button, I can create and initialise all of the objects I need, and call the print method, again, and again and again.. no need to go through the whole registration process. Lots of time saved, I’m more productive, and therefore happier :)

Another example – only just today – I did a few changes and made a build. I found that the currentState of one of my component’s was wrong.. This meant I had to go back and rebuild again… however, using FlexTRAMP, I could still set the state, update a few vars, and one method call later, debug a transition I had, which I found needed a slight tweak.

So you see, I didn’t end up doing a build and achieving nothing.

For anyone used to Firebug, or Microsoft’s command line processors, you will know the use of this approach. It’s not a replacement for unit tests, but a very useful tool for when you have to get hacky with some defects, or trail blazing some code.

But I thought Actionscript doesnt have eval?

More...

Flex unit, and asynchronous tests

Thought I’d share this with you..

If you’re using flexUnit and want to test some class or method that dispatches an asyncrhonous event, then this snippet is for you.

I’ve seen this done a few ways, but I recently discovered this neat little feature of flexUnit. If you know this already, then good for you, but if not, let me introduce you to the addAsync method.

Basically, this TestCase method acts as a proxy between you’re addEventListener call and FlexUnit, giving you a teeny bit of extra functionality on the way. The basic use is:

  1. myObject.addEventListener( eventName addAsync( handlerMethod, timeOutInMillisecs ) );

It’s quite straight forward, you provide it with a handler in your TestCase, and if a matching method is not dispatched in the prescribed amount of time, the test fails. Neato.

More...

FLEX EXAM

I’m going for my Adobe Certified Exam in flex later this month. Most people wait till they pass to make it public knowledge. You’re sat next to someone for months, then one day they suddenly come out with : “yeah, I got my ace now”, or you read a blog post “I passed my ACE”.... well, balls to that! I haven’t passed mine yet… I might fail and look like an utter cock in the process! However, at least this way…

  • More pressure on me to pass,
  • I’m being straight with my friends and colleagues, and not just suddenly being like “oh, yeah I was just walking to work the other day and wow! there was this exam hall right there and they just happened to be doing the ACE exam, which I’ve never mentioned to you ever before, and I just happened to be on the register, and just happened to go in and pass, so yeah, yesterday I wasn’t an ACE, but now I am..”
  • At least I can blog about the learning process with some gusto… I wont elaborate, but what man ever takes his missus out to dinner again, once he’s had desert…

I’ve so far found that Lynda.com is great to do a refresher course of what you know – and it’s also really good for learning some new stuff too (despite using fms and flashcom, I’ve not had much exposure to FDS or LCDS). I’d heartily recommend going through their excellent Flex videos. I also recommend reading “flex 2 training from the source” and cribbing on “UML demystified” or another similar title.

There are a couple more things you can do as well. This one chap has made ATTest which is an excellent tool for doing mock exams in Flex – it comes with 3 mini tests and 3 exams, and comes for the bargain price of : £20 ($39)... I heartily recommend it.

I’ve been particularly working with E4X and LCDS, which are certainly my weakest areas. My test is on the 24th – so we’ll just have to see how it goes. I’m hoping that I pass though, not least of all because everyone knows I’m sitting the test!

I’ll keep this blog up to date with my progress and let you know any cool stuff I find.

WISH ME LUCK :D !!

Failing that, give me some good advice!! Anyone else done it? Got any suggestions.. wow – look : there’s a comments form below, just for you!

Finding available modes on a webcam

I recently ended up having to find what webcam modes were supported by a webcam. The following code can be used to find out what’s available..

It turned out that my problem wasn’t anything to do with modes, which is why I didn’t expand this further – had I done, I would’ve stored an array of modes I supported, and checked to see if I had a match.

  1. fps=15;
  2. cam = Camera.getCamera();
  3. for (w=100;w<1000;w=w+20){
  4. for (h=100;h<1000;h=h+20){
  5. cam.setMode(w,h,fps);
  6. if ((w cam.width ) &amp;&amp; (h cam.height)){
  7. trace( w + " x " + h + " @ " + cam.fps);
  8. }
  9. }