Articles

Archive for the 'dpdk' Category

Timeline Events via the TimelineListener class

While viewing a post on bytearray.org and after teaching a class on creative technology at the avans hogeschool today, I got inspired to write some easy code to be informed by the timeline of a Movieclip when a certain label is reached.

A student of mine slapped me in the face with my own words that “code on the timeline is evil” when he asked how he could trigger an action inside the flash Document Class from the timeline or from a specific framelabel. My reply was simple: just call a method on a certain keyframe that you have exposed in the Document class. < Sssslappppp > :) So I decided to show him the clean way by listening to an Event.ENTER_FRAME Event and checking the framelabel or the end of the timeline whenever the event handler got called. All from inside the Document class, no code on the timeline there.

I encapsulated the whole thing in a class, have it dispatch events you can register to and make it able to get some data out of it and at the same time make it work for different scenes (as he was working with them). In this way we can perfectly seperate design and timeline stuff from code, optimizing workflow by having designers tweak their animations and killer design while only informing the developer of some framelabels and eliminating spaghetti code and potential bugs.

For this purpose I wrote the TimelineListener class in the nl.dpdk.utils package. read on for some simple code.
Continue reading ‘Timeline Events via the TimelineListener class’

Factory for creating ResultSet from an SQLResult in AIR

There is a minor update in the nl.dpdk.air package.

While creating some AIR applications, it turned out the SQLResult, a resultset wrapper used when working with a local SQLite database is not as powerful as we want it to be. Therefore we wrote a little Factory to convert an SQLResult to an nl.dpdk.collections.sets.ResultSet.

Our ResultSet is also used when doing flash remoting and when returning data from a remote database, (see the post about that here).
So it’s convenient to use when working with local data from a database as well. As an added bonus, it offers some more features than the very simple SQLResult, which is essentially an Array of anonymous objects.

The ResultSet makes use of our very powerful List datastructure, which features sorting (which is better done by the database), selecting, mapping, folding and applying commands as well as a very rich api where you can use the datastructure as a Queue or a Stack.
Continue reading ‘Factory for creating ResultSet from an SQLResult in AIR’

Using a flashvars / flash parameters registry: configure your flash files externally

Providing data to your flash movie can be done through javascript, through loading data from xml, UrlVariables (post and get) or flash remoting with the actionscript message format (amf), or by passing FlashVars to your movie at embed time in your html page. We are using a software design pattern known as a Registry to be able to have easy access to our externally provided parameters known as FlashVars throughout our application.

Continue reading ‘Using a flashvars / flash parameters registry: configure your flash files externally’

folding, mapping and applying commands on datastructures and collections

Hi, we have a great update on the collections package featuring methods that allow us to map the list, fold it and to apply commands on every item in the list. This sort of extremely powerful functionality can be compared in intention to using specifications on collections on which we wrote an earlier post here. Some more updates include some bugfixes in the unittests and a stack overflow problem occuring only on macs. But this article will focus on highlighting the high level methods we just added. Want to have a huge boost in productivity and clarity of code??? Read on!
Continue reading ‘folding, mapping and applying commands on datastructures and collections’

Tracking user activities inside your application with the Tracker

In every campaign we create we implement some mechanism to measure what the user is doing with and within our application. After all, we want to see the results and be able to have a good analysis of the application’s efficiency. We use a variety of techniques, depending on the client’s wishes: Google analytics, webtrends, dmfacts or a custom implementation where we log stuff via our custom logging framework.

What all these implementations have in common is the necessity to be able to track stuff from within flash in a generic way. We only want to do a little customization for every application, while using the same method to track or log stuff in every application. For this purpose we created the nl.dpdk.log.statistics package.
Continue reading ‘Tracking user activities inside your application with the Tracker’

Open Source package released on dutch Adobe User Group

We have made a great step for Dutch interactive agencies by releasing some of the source code we work with (flash actionscript 3) to the general public.

The announcement was just made at the newly launched website of the dutch adobe user group and on our website (dutch).
Continue reading ‘Open Source package released on dutch Adobe User Group’

Specification pattern for selection on lists

One thing I really like to use is selection or validation based on the Specification pattern, as originally proposed by Martin Fowler and Eric Evans.

Specifications are a very powerful way to perform selection, searching and validation on any object without putting the logic on the object itself. We would really like a way to reuse our business logic, throughout our application, in several use cases, without cluttering our domain object. We also want a way to generalize the selection criterium on a list kind of structure, instead of writing a wrapper around a list based structure that holds some logic that is needed for our problem domain. We also need a way to explicitly state what our business logic is and make it easily reachable, as business logic changes all the time, depending on the wishes of the client, the users of the application, on the weather and other stuff beyond our control ;). This is where the Specification pattern is a great way of doing business with our application.
Continue reading ‘Specification pattern for selection on lists’

Flash Media Server and using RemoteId

When working with multiuser applications, the method of choice in flash is the flash media server (fms). The main alternatives are wowza, a commercial server for streaming media and red5, the opensource alternative.

No matter what server you use, keeping track of the connected users is one of the main things that need to be done correctly. We need to be able to communicate with each and every user from our clientside application via the fms, we need to be able to keep track of them and be able to know what and how something changed about their data. We want to be able to target specific users and send them messages, we want to know which user has sent us a message etc.
Continue reading ‘Flash Media Server and using RemoteId’

The Log and LogEvent classes.

In this article I would like to elaborate a little on two of the more basic classes in our tool kit, namely Log and LogEvent. Both can be found in the nl.dpdk.log package.

Log and LogEvent are used in conjunction with each other and are used to log messages and act as a substitute for Flash’s built-in trace statement. (But you probably figured all that out by just looking at the class names so I’m going to delve in a little deeper and provide you with some usage examples here.)
Continue reading ‘The Log and LogEvent classes.’