Articles

Archive for the 'bugs' 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’

internal classes confuse cs4 compiler

We (and others) noticed that some stuff wouldn’t compile anymore under the new cs4 flash authoring tool. The compiler complained mostly with messages like ‘1020: Method marked override must override another method.’

Thanks to a post on this blog we found the following bug on bugs.adobe.com. As you can see, it turns out the compiler is wrong. It cannot handle internal classes (and our tests suggest this behaviour is erratic). This breaks backwards compatibility in a major way, but it seems Adobe didn’t catch this in their testsuites.

We started refactoring immediately by removing the internal classes from some of the classes that used them and at the moment everything is back to normal again. All tests passed. This is on top of an earlier refactoring where we tried to fix the issue by changing some stuff on interfaces and by introducing an abstract List type in the inheritance chain for LinkedList and ArrayList.

We’ll put up the new stuff somewhere this week.
We have put the new source code in the repository.