Monday, 3 May 2010

encouraging lack of action

The progress of the applications narrative requires user interaction and non-interaction. Programming the non-interaction has been interesting due to it being rare to have events triggered this way.

Probably not the most efficient way of doing this little time based event but here is the Action Script 3.0 code thus far.


stage.addEventListener(MouseEvent.MOUSE_MOVE, onMove);

var mouseTimer:Timer = new Timer(3000);

mouseTimer.start();

mouseTimer.addEventListener(TimerEvent.TIMER, onMouseTimer);



function onMouseTimer(e:TimerEvent):void{

trace('Go To Sleep');


}


This code triggers 'Go To Sleep' to be traced into the output window in flash every 5 seconds of non-movement. The next step is to get this code to trigger only on specific music based events. I also want to refine the time of the event to be more random. Perhaps triggering somewhere between every 5 to 8 seconds.

No comments:

Post a Comment