Popular Posts

Recent Comments

About

I'm Thomas Viktil. I like to play with all sorts of things. And this is where I write about the things I learn while playing.


Archive for the ‘flex’ Category:

Garbage collecting in AIR

At a recent project I had to make a video loop indefinitely and most importanly: seemless. I tried all kinds of different methods, including using FLV, F4V, M4V, FLVplayback component, the Video class, embedded video and a few other. The only solution that worked was (in my opinion) the most ...


AS3 Snippet #3: Remove all childs

I code snippet I tend to use quite often. And one that I tend to forget how I wrote the last time i used it. while (this.numChildren > 0) {     removeChild(this.getChildAt(0)); } Update: And when you want to remove a child as a part of an event handler, do this: event.target.parent.removeChild(event.target); Let's say you want to ...


Adobe AIR: Error when creating AIR file: 303

I'm currently using Flex Builder 3.0.1.205647 with Flex SDK 3.1.0 and I got an error saying Flex couldn't create my AIR file. After a bit of googling I found out that it is a bug in Flex Builder 3 (Bug report #FB-11712), and it seems like it will be fixed ...


Tips: Reading variables from Arduino using Flash, Flex or AIR

If you have experienced getting only gibberish from the Arduino when tracing it's output using Flash, Flex or AIR, you might have misconfigured the socket server. I spent a whole day trying to figure out why I only got square boxes, a couple of random numbers and an occasional 'f' now ...


ActionScript 3: Events

A couple of days ago I encountered a problem with Events. I clicked and object, but another returned the event. Despite adding mouseEnabled = false to the objects I didn't care about, I still couldn't figure it out. Events is nothing new to me, but this was beginning to get ...

Posted in AS3, flash, flex

Actionscript: Outputting a grid using only one for-loop

Sometime this winter a friend of mine (Knut Urdalen) introduced me to a part of mathematics called modular arithmetic. Now that is a nifty little thing. In modular arithmetic, or modulus if you like, numbers reset themselves when reaching a given limit. Modulus is also known as "clock arithmetic", and the ...


Making a YouTube-esque video player in Flex

Earlier this week I finished a project for one of our clients. The client produces quite lot of video content, and wanted a video player that could be embedded in other websites. This was a rather straight forward project where I got to use a lot of things I already ...


totalTime and MetadataReceived from VideoDisplay object in Flex

Interesting (and more than a bit annoying) observation; neither the property totalTime or the event MetadataEvent.METADATA_RECEIVED will trigger unless the buffer is full.I just discovered this as I tried to dynamically set the bufferTime to be 30% of the total playtime (I calculate the bufferTime using totalBytes and bytesLoaded). But ...