24
Sep
09

Do they test at all?

I’ve noticed that there are a lot of sites out there that have swfs throwing Errors (*).  It’s the most annoying thing about having to use the debugger version of the flash player. I don’t want to look at other coders sloppy error handling, but there seems to be no choice. Check Microsofts Xbox Live site for instance: http://live.xbox.com/nb-NO/default.aspx – it pops an error window with: Error #2044: Unhandled IOErrorEvent:. text=Error #2035: URL Not Found. The site is just a random example – Microsoft is no better or worse than others. Continue reading ‘Do they test at all?’

31
Aug
09

Flash Builder wishes

Everybody wants to change the world. And every developer wants something their tools don’t provide. I’m mostly a happy camper when it comes to Flash/Flex Builder – it allows me to do my job with little fuss. And if there is something that taints the experience  I can just think of the Flash IDE – which immediately makes Flex shine again. But even so there are a couple of things that could lighten the day:

Super quick bookmarks
I need to jump around in the code when debugging or adding functionality to existing code. In venerable SE|PY, I could click once in the left hand margin to set bookmarks. In Flex I have to select text, context click and save.  Too much! I just need a quick way to navigate between a bunch of methods.

What about my parents?
Complex frameworks often entails extended classes to avoid duplicate code. But remembering in which class of the inheritance chain a method is defined can be hard. What about an option that lets you view all the inherited methods as well? In the same code view, but with colour coded backgrounds to make it possible to see at a glance where the method hails from. And with navigation to go into the actual class the inherited method was defined in. When trying to familiarise (or re-familiarise) myself with code sets, this would make the task much easier.

References
The Declarations and References search tools introduced in FB3 are a good idea, but they are slow and clunky. This information should be available instantly, either through context icons or context sensitive views – select a method – the content of the view changes.

Complex formulas
Formulas for placing and scaling graphic elements can grow to be quite complex – I do this frequently and so far, the only way to make it more readable is to split it up over several lines, making the steps towards the final answer easier to decipher when I have to change or debug the code six months later. At that point everything is forgotten and I have a hard time remembering what I did or why.

But why can’t the code editor show formulas as you would write them on paper? Instead of one long line suited to computers, we could view fractions as numbers above and below lines. I usually write out formulas that way on paper and ‘translate’ into code when I think I’ve got it. I found this example from TUAW: which is how achieve this on a mac. Imagine how much easier it would be to read formula-heavy code if FB could show it to us this way?

latexitdraganddrop

28
Jul
09

Flex API bug

I just ran into an issue that looks like a bug in the Flex API. The DragManager is used for dragging and dropping between flex components, and it can also be used to implement drag and drop quite easily in your own projects. It’s (mostly) well implemented and the syntax is straightforward. To start a drag, use DragManager.doDrag(dragInitiator, dragSource, mouseEvent). The details are explained in the documentation.

The bug I encountered is in the dragSource part of the call above – it’s an instance of  DragSource class, used to store data being dragged. You add data with myDragSourceInstance.addData(myData, “identifyingString”). Nice and sensible. The problem occurs when data is retrieved through myDragSourceInstance.dataForFormat(“identifyingString”). It returns Object as data can be of any type. Here’s the method from DragSource:

public function dataForFormat(format:String):Object
 {
 var data:Object = dataHolder[format];
 if (data)
   return data;

 if (formatHandlers[format])
   return formatHandlers[format]();

 return null;
 }

But if the data you added is numeric zero – 0 – the test if(data) will return false and the method will return null instead of numeric zero. Bummer! I suspect that if (data || data === 0) would be better.

The workaround I used was to set data as a string instead. As data return is untyped, we need to cast it anyhow.

What do you think? Has Adobe implemented the method correctly or is this a bona fide bug?

02
Jul
09

Flash on the Beach

We’re sending three people to FotB this year. It’s our first time at the conference and we’re going mostly due to the recommendations from friends and colleagues who’ve been there before.

Very much looking forward to great sessions with all the flash-sphere names and getting to know others who work with flash. Coincidentally, Papirfly went to Brighton this winter for three days of work on strategy and products. Due to inexpensive flights and proximity to Gatwick airport, going to Brighton ended up costing about the same as staying at a hotel in Norway. Fortunately, we blew the savings on a day of racing at the Goodwood Motor Circuit! Brighton’s a nice, friendly city that I’m looking forward to visiting again and I hope to get to know the flash community better.

See you in September.

Flasher in a classic Porsche

Flash developer in a classic Porsche at Goodwood

09
Jun
09

Work at Papirfly?

We seem to have avoided the credit crunch, there’s still too much to do for too few people. So we need more talented flash developers. Requirements are, in short, good programming skills. We do most of our development in Flex builder and AS3, some older projects are still in AS2. Knowledge of printing processes is a plus, but not a requirement: CMYK colours, ICC profiles, Type1 vs. TTF vs. OT, etc.

You must be willing to relocate – F2F is still better than IM. And willing to learn to speak Norwegian (or do so already).

We’re located in Sandnes, just outside Stavanger – Norway’s third largest and most beautiful city. We offer good insurance plans, a company cabin, really, really nice colleagues, interesting work and excellent coffee.

Take a look at the company web page for more about us. www.papirfly.com or www.papirfly.no. Contact us at perATpapirflyDOTno (you know how to decode the email address)

02
Jun
09

DIY Flex SDK 3.3 in Flex Builder

Adobe has updated the flex SDK to 3.3 – they did so in March this year. I had assumed that this update was part of the Adobe auto updating regime – all other Adobe applications are handled, but apparently not all parts of the Flex Builder. So instead of waiting for things to fix themselves, I did it manually using these clear and simple instructions.

I was playing around with the Flex 4 betas when I saw it. Installing the Flex 4 SDK follows the same steps, but using it is a roller-coaster of weird bugs and exiting new features. I’m currently trying to get to terms with the new Text Layout Framework API. Exploring new APIs is overwhelming, but I have to say that it looks very good indeed.

28
May
09

Open challenge: Dynamic ContextMenu

Inspired by the very enjoyable challenge from my friends at Apt, we’re doing our own. In a recent project I needed a contextMenu which allowed the user to select the number of pictures to show in a ad template. The choices change with the size of the ad, so every time the context menu is shown, it’s regenerated first. But for the challenge, you can skip the regenereation bit.

I’ll post my solution on tuesday (2.jun)

Continue reading ‘Open challenge: Dynamic ContextMenu’