Box2D AS3

I’ve decided to take a look at Box2D for Flash, cause I hope to make some games using this powerful engine, but according to the news from 1/08/10 on box2d.org, website was hacked by someone. So, right now Box 2D AS3 Manual is not available (404 Page not found), but thanks to Google, there is a cache of the manual.

З.Ы.: Actually, latest version of manual can be found here: http://box2dflash.boristhebrave.com/docs/.


Ctrl+F4 in Flash CS4/CS5/CS5.5

Ctrl+F4, this is what I usually use to close tabs in IDE, like MS Visual Studio or Eclispe. Meanwhile Flash CS4 says that Ctrl+F4 is “Reserved by the system”.
The problem was easy to solve.

All files with keyboard shortcuts for Flash are situated here(Windows 2000/XP): C:\Documents and Settings\%USER_NAME%\Local Settings\Application Data\Adobe\Flash CS4\en\Configuration\Keyboard Shortcuts\

or here (Windows Vista/7): C:\Users\%USER_NAME%\AppData\Local\Adobe\Flash CS4\en\Configuration\Keyboard Shortcuts\

After some investigation, I have changed line
<Shortcut id=”57602″ key=”87″ scope=”1″ flags=”11″ /> 
to
<Shortcut id=”57602″ key=”115″ scope=”1″ flags=”11″ />.

And voilà, Ctrl+F4 works!

UPDATE: The same works for Flash CS5.
Path: C:\Users\%USER_NAME%\AppData\Local\Adobe\Flash CS5\en\Configuration\Keyboard Shortcuts\
Find the line with the id=”57602″ and replace it with the following:
<Shortcut id=”57602″ key=”115″ scope=”IDR_MAINFRAME” flags=”11″ />

In Flash CS5.5 this line should be the following:
<Shortcut id=”57602″ key=”115″ scope=”IDR_MAINFRAME” flags=”9″ />


AS3 Sound

I don’t know why they did like this, but work with sound in as2 was much easier.
Now in as3 each sound should have its own class, what is “cool” of course, but what if I have 100 sound files? Well, I don’t have to create all these classes, but I have to create an object to play the sound.
In as2 it was more simple, just link identifier and play sound by its ID.

Second, why do I start playing sound with Sound object and stop playing with SoundChannel object?
And if I pause(stop) sound with SoundChannel object I need Sound object to resume it. So I have to store somewhere two objects in order to control my sound. Add here one more object for sound volume and looping. Very practical.
Maybe I don’t understand something… 🙂