Computer science

You are here

Getting the Squeak Out of the System

Today when working on my Unity3D game for Fantoche, I noticed it again: a short little squeak at the start of a triggered sound clip.

This has happened before in my prototype, but I chalked it off to my inferior post production skills when doing the first sound clips. The new sound clips, however, were pristine, I was sure of it.

So the problem had to be somewhere else. Changing a suspect in my trigger script did not change a thing.

English

Loading External SWF Into Another SWF – And Getting the Movie Clip Out of it

When getting an external SWF using a loader in ActionScript 3, you usually not getting the the MovieClip contained within. Luckily, the loader you used to get the SWF has a property content that contains that movie clip – and with that, also the timeline.

Props to Jonas, who told me that. I just hope I am getting it right here, since I finally didn’t use it in my project …

English

Getting Things In and Out of Arrays in ActionScript or JavaScript

Since I have a hard time keeping push(), pop(), shift() and unshift() apart, here’s a little cheat sheet I whipped up:

Array Manipulating Cheat Sheet

Undefined

Dynamically Referencing Variables and Methods in ActionScript

Sometimes, the state of an object decides which method has to be executed. Instead of an unwieldy switch construction like this …

switch (task) {

case "sleep":
sleep();
break;

case "walk":
walk();
break;

}

… you can use the someObject[someExpression] notation. This works for any object, and you can use it to access both variables and methods. All those lines from above become this:

thistask;

English