Tuesday 6 July 2010

OBJ model fails to load in Away3D

Error contains:
Error #1009: Cannot access a property or method of a null object reference
away3d.loaders::Obj/parseMtl()...


Seems to affect OBJ files that contain mtl file references that have been created on a Linux PC.

Solution is to open the obj file in wordpad in Windows and just resave it.
I suspect that this changes the line endings to Windows native format.

Thursday 22 April 2010

using printf in libavcodec

Although av_log is preferred, you can use printf statements for your own personal debugging processes by adding

#undef printf

before any of your own code.

Thursday 11 March 2010

Actionscript 3: Error: Call to possibly undefined method addEventListener through a reference with a static type class

If you have been following Gustavo Kawamoto's instructions for making a Actionscript 3 static, singleton class you might be have received the undefined method addEventListener error when trying to set up an event listener for your static object.

The thing to remember is that you must add an event listener on an object instance, so try the following:

MyStaticClass.getInstance().addEventListener(MyEvent.BLAH, myHandler);


This works since the getInstance() method returns the instance of your static singleton.

Tuesday 5 January 2010

Firefox slow in Ubuntu. DNS lookup fix.

Problem: Firefox takes an age to resolve host addresses in Ubuntu.

Solution:
Open Firefox,
type about:config into the address bar, press return,
Scroll down to the entry network.dns.disableIPv6 and set it to TRUE (with a right mouse click).
Surf away.


With thanks to http://www.craigmayhew.com/blog/2009/11/slow-dns-lookups-in-firefox-on-ubuntu-9-10-karmic-koala/