Flash tracer

Thursday, February 4th, 2010

Second beta release of my new Adobe Air Flash log tracer for windows. Most Adobe Air Log apps don’t work on Windows operating systems, because Air locks the flashlog.txt file, preventing other SFW’s to write to it.

I have now updated it, so that it works with air 2 beta2.

Download FlexrTracer

Features:

  • Filtering of keywords
  • Autodetection of flashlog.exe
  • Color highlighting of strings

Installation instructions:

  • Download the above ZIP file. and unzip it with you favorite unzipper
  • Install the .EXE air app
  • Copy tail.exe to the installation directory (normally c:/program files/LogReader/

haXe eventListeners

Sunday, January 17th, 2010

Two days ago I decided to try out haXe, an AS3 type of language that can compile code to various formats, SWF, PHP, C++ among others.

I thought it would be good to try some other language than good old PHP or actionscript. Although haXe and Actionscript  are closely related, there are several differences. haXe offers some very nice language elements, which make it better in than actionscript in a lot of respects. First of all types are a bit different and haXe has stronger type enforcing, for function types for example.

I was missing the good old actionscript eventlisteners and timer implementation. I managed to write a few classes to implement basic event handlers. No event bubbling, no canceling of propagation, but apart from that fully functional dispatchers and listeners.

For the timer, just use it more or less like an as3 timer as in the example below (note no TimerEvents).

var timer:HaxeTimer = new HaxeTimer(100, 10);
 timer.addEventListener(new HaxeEvent(HaxeEvent.TIMER), timerHandler);
 function timerHandler(e:HaxeEvent):Void{
trace(e.target.currentCount);
// DoStuff
}

You can find a link to the package below. The code is now in no way optimized for dispatchers with listeners for many different events. I think the listeners should be placed in different arrays according to event type, to make notifying quicker.

Download the events package

Please let me know if you have any code suggestions or if you spot any bugs.

Actionscript 3 math fun: torus knots

Saturday, December 26th, 2009

After seeing the Wikipedia page for torus knots, I thought it would be nice to write a simple 3d genetator in AS3.

The basic code for this script are four lines of codes, looped for each line section, with a max of 2 * PI or 360°.

_r = ((2 + Math.cos((q * i) / p)));

x = _r * tr * Math.cos(i);
y = Math.sin((q * i) / p);
z = _r * tr * Math.sin(i);

The x, y and z values can be drawn using the graphics class after we convert them to 2D points.

Some interesting results can be achieved when the number of line segments is lowered below 100, making the image really distorted. With 35 line segments and high p and q values things get interesting.

Webcam driven website

Sunday, May 17th, 2009

Have a look in the future! Browse this website without using your mouse or keyboard. Using gestures captured by your webcam, you can activate buttons on the screen to open pages.

Click on the image to open the demo in a new window.

gesturecontrol1