Blog
Here is a full list of blog posts you can find on this site. If you can’t find what you are looking for, please use the search box.
Using the Nape Physics Engine in ActionScript 3
May 12, 2012 If you have been pulling your hair out trying to figure out how Box2DFlash (aka Box2DAS3) works, you are not alone. The problem is that, until recently, there were very few simple, free and solid alternatives. And then came the Nape Physics Engine... Nape is a lighter-weight 2D physics engine which will most likely satisfy all your needs while being much easier to use than Box2DFlash. It is also usually faster than Box2DFlash. It does have a few drawbacks but, overall, I highly recommend you ...Linking .swc files in your ActionScript Editor
May 10, 2012 My students often ask me how to use .swc files within their physical computing projects. They know how to use external libraries in the form of class packages but are a bit stomped when the library is delivered in the form of a .swc file. For those of you with the same issue, here is the linking procedure for various ActionScript editors. A .swc (commonly pronounced "swic") file is a compiled package of Flash symbols (such as DisplayObjects, fonts, sounds, etc.) and ActionScript classes. It i...stage.stageWidth returning incorrect values ? Let me help.
April 27, 2012 Are you trying to fetch the actual stage width or height of your project on startup and are getting weird results ? Perhaps it reports a width of 500 and a height of 375 ? If that's the case, read on, I might have a solution for you. If you are using Flash Builder which, in turn, is using the mxmlc compiler behind the scenes, you might retrieve strange results when calling stage.stageWidth or stage.stageHeight. If you are not using the tag, the actual default size of your project will b...My humble attempt at an ActionScript video feed color-tracking library
April 10, 2012 I'm releasing today a beta version of my new ChromaTracker ActionScript 3 library. This library allows the tracking of blobs of color within any DisplayObject. Of particular interest is the ability to track colors within live video feeds such as those from webcams. To use it, you simply create a ChromaTracker object and specify a color to track. Then, you repeatedly call the track() function to recuperate a rectangle object representing the outer edge of the detected color zone. You can also...Logic Studio 9 MIDI note numbers
November 9, 2011 MIDI note numbers are the unique numbers assigned to each note in the MIDI system. The MIDI numbering scheme uses 8 bits to identify all the notes. Therefore, there are 128 notes (28) that can be assigned in MIDI. Which note is which is not always straightforward. Let's take a look at how Apple did it in Logic Studio 9. The MIDI specification, as defined by the ISO (International Oraganization for Standardization), tells us that middle C is MIDI note number 60. All other notes are relative t...Alternative scale tuning in Logic Pro 9
November 6, 2011 As some of you may already know, it is possible to use an alternative scale tuning in Apple's Logic Pro version 7, 8 and 9. If you tried creating completely custom user scales, though, you probably had a hard time fiddling with cents adjustments. There is a better way... Creating custom scales by using cent adjustments is cumbersome. You have to calculate how many cents each note must drift from the default equal temperament scale. This means that you need to know the frequencies of all 12 n...Dynamically modifying a TextField inside the evil SimpleButton class
May 27, 2011 As of yesterday, I had never used the ActionScript 3 SimpleButton class... and now I wish I nad not ventured anywhere near this ill-devised piece of *&?%. Should you ever want to use it or if you are currently struggling with it, I strongly suggest you read this quick primer. Maybe it's my fault. I was expecting a completely different behaviour from this seemingly simple class. It all started with this ordinary scenario : a button on the stage, a text field inside the button and me wanti...Using OSCulator as an OSC-to-MIDI bridge
May 4, 2011 Getting custom open sound control messages to properly trigger MIDI events in OSCulator is not as simple as it might look like. Since I made good progress in the last few days (with the gracious help of Camille Troillard, the author of the software), I though I'd share some of my findings. OSCulator is a tool mostly designed to bridge OSC compatible hardware (and various other controllers such as the Wiimote) to software. I myself use it primarily as an OSC-to-MIDI bridge and it works quite w...WiiFlashServerJ crashing or slowing down on Mac OS X ?
March 18, 2011 If, like me, you are using the officiel 0.4.5 release of WiiFlashServerJ from wiiflash.bytearray.org on Mac OS X, you might have encoutered problems such as slowdows or crashes. If that's the case, read on. I might have a solution for you. Ben Berman posted an updated version of the server dubbed WiiFlashServerJ+BSB on the WiiFlash mailing list somewhere last year. It will most likely fix the crashing and chugging issues you are having. At least it mostly did for me. I say "mostly" becaus...Announcing Jmulator : an ActionScript 3 library to work with keyboard emulators
January 30, 2011 This winter, I'm trying something new with my students. I am inviting them to use a keyboard emulator for my physical computing class. It should make it very easy for them to receive physical switch data within their authoring environment (Adobe Flash). And because I want them to focus on the interaction rather than the programming, I created Jmulator, an ActionScript 3 library to simplify even further the usage of keyboard emulators (also know as keyboard encoders) in Flash. For those wh...Styling the 'alt' attribute of images
October 29, 2010 Why on earth would anybody want to style the alternative text that is used when images cannot be displayed ? Isn't that text meant for visually-impaired users (who couldn't possibly care less about the text's style) or for text-only browsers like Links ?!? Well, not quite. Read on for a very common use-case where changing the style of 'alt' text could prove useful.If you sometimes have to suffer through the creation of HTML newsletters, you know that most of the time images are not displayed by ...Opening a local socket from an SWF file
May 23, 2010 Opening local sockets is by default prohibited in the Flash Player. This actually makes a lot of sense. You wouldn't want any website you visit being able to open a socket on your machine. However, there are some times when you actually need this. Such as when you want to access a Wiimote through WiiFlash, an Arduino through SerialProxy or send MIDI data through flosc. How can we tell the Flash Player to relax instead of giving us the dreaded "SecurityError: Error #2010" or the evil "Security Sa...Using CTRL-ENTER to compile ActionScript code in FDT
May 19, 2010 If you have made the switch from the Flash IDE to PowerFlasher's FDT you might be missing the beloved CTRL-ENTER (or COMMAND-ENTER on Mac) shortcut to compile your code. Don't sweat it. This is easily fixed. In order to setup FDT to compile on CTRL-ENTER, there are two things you need to do. First, you need to open the Preferences window. Then go to Run/Debug and then Launching. In there, select Always launch the previously launched application. This will make it so that each time you ...Getting rid of warning messages from external libraries in PowerFlasher's FDT
May 7, 2010 A bunch of ActionScript libraries use rather "loose" variable-typing practices. One such library is TweenMax. While I love this library, it really annoys me to see all those warning messages show up in FDT when I'm coding. How can one get rid of those ? Well it turns out that the good people at PowerFlasher thought of just this problem. Knowing where to look is the hard part but this is what I'm about to show you now. Simply right-click on your Flash project in the Flash Explorer pa...Using a Widcomm-based Bluetooth receiver with a Wiimote on Windows XP
April 23, 2010 If, like me, you bought a Bluetooth USB key in order to connect a Wiimote to your Windows XP PC, you might have gotten stuck on the screen where the driver asks for a "passcode". This is especially frustrating because the Wiimote has usually already been recognized. If that's the case, read on I might have a solution for you. The current driver of bluetooth USB dongles based on the Broadcom/Widcomm chipset (made by the likes of Asus, Belkin or RocketFish) does not allow the user to bypass or ...Apache 2 .htaccess Cheat Sheet
February 1, 2010 The Apache HTTP Server is a very highly customizable piece of software. So much that for newcomers, simply trying to customize a basic .htaccess file can be overwhelming. Therefore, when I was tasked with teaching the basics of the .htaccess file to my students, I figured it would be helpful to hand them out a nicely edited printable cheat sheet. I did search the web with the hopes that someone had already made one. Unfortunately, I could not find the one that was just right for my needs....Stop Thunderbird from littering your desktop with attachments
January 22, 2010 I love Thunderbird. It is both flexible, powerful and user-friendly. But, on Mac OS X, it has the nasty habit of saving a copy of all the opened attachments on the desktop leaving a messy trail... Can something be done about that ? You bet ! I said Thunderbird was flexible, didn't I ? It is so flexible that it will let you edit tons of hidden parameters if you so wish. Those parameters can be found in the "Thunderbird" menu under the "Preferences" item. In the preferences window go to "Ad...Drupal 6.x, from A to D
January 16, 2010 You read right. We are not going all the way to Z. This article is only meant to be a quick setup guide for a very common Drupal environment. To be perfectly honest, this is my own personal check list of tasks to perform when setting up a new website with Drupal. Maybe it can be useful to you too. This guide is meant to be used with version 6.x which is the current major version as of this writing. Bear in mind this is not a tutorial. It is barely a check list to get you started. Get D...Physical Computing Bookmarks
January 13, 2010 Do you keep losing your physical computing bookmarks ? Well, for some reason, I do. I lost them when I changed computer. I lost them when I reinstalled my OS. I lost them when I switched browser. I'm so hopeless that I've decided to write this blog post in the hope to put an end to this awful sequence. Worst case scenario they will at least be cached by Google... So here it goes : my constantly expanding list of physical computing (and related) bookmarks and favorites. This list is in no ...Printing from Mac OS X to a Windows Vista shared printer
October 3, 2009 If you ever needed to print from a Mac OS X computer to a printer shared on a Windows Vista workstation you most likely entered a world of pain and frustration. For most people, except perhaps some masochistic types, this is definitely not what printing should be about. Especially not on a "user-friendly" Mac anyway... Printing from my MacBook to my old, trustworthy HP LaserJet 1100 had always been easy. I simply hooked up the printer to my no-name Windows XP box, shared it and used...Fixing Garbled French Accented Characters in the Outlook Web Access Thunderbird Plugin
August 28, 2009 The OWA Thunderbird plugin is a life-saver. Especially for those of you who (like me) have an employer that's not too keen on open standards. However - for a long time - I have been plagued by a problem that garbled French accented characters in the messages I sent. Until I got a message from Alvaro... I had posted this problem on the Thunderbird Webmail Extension Google Group a long while ago and finally today I was contacted by Alvaro Lozada Borrero who was kind enough to provide me w...The Browser Screenshot Compendium (2009 edition)
July 5, 2009 Every web designer is - at one point - faced with that question: "What is the optimal width and height for that new site I'm working on ?". Let's try to answer that question using common sense and a little tool I developed which I dubbed the "Browser Screenshot Compendium". Every experienced web designer understands that there is a substantial difference between the screen resolution and the usable content area of a browser window. Unfortunately, as far as I know, there is no readily avai...Making the Alesis Multimix 12 Firewire mixer work in BootCamp on a MacBook Pro
June 22, 2009 If, like me, you are the owner of an Alesis Multimix 12 Firewire mixer and can't seem to get it to work on your MacBook Pro under Windows XP, I have a fix for you. Read on. Let me guess... your mixer works fine in Mac OS X but if you switch to Windows XP (BootCamp) you get... nothing ? Well, that's exactly what was happening to me. I therefore knew that both the mixer and my Mac were not the problem. In XP, the driver would install but I could not start the Alesis Control Panel and I coul...Dotted, double and dashed CSS border styles peculiarities
May 15, 2009 In a course on the CSS box model, a student of mine once asked me in which zones of an HTML element is the background color visible. The answer, so I then thought, was pretty simple : the background color is visible behind the content and in the padding zone but not in the margin which always has a transparent background. It turns out the answer is not quite as straightforward as I thought... The complication comes from the border. In the case of a solid border, the question is irrelevant...SerialProxy v0.1.4 can use COM ports above 9
May 4, 2009 SerialProxy (aka serproxy.exe) v0.1.3 or lower cannot use COM ports above 9 on Windows (due to a weird syntax issue in Microsoft's API). If, like me, you ever faced that same problem, there was no easy solution... until today ! Important update : I believe the fix to the issue discussed here has been integrated in the latest version of TinkerProxy. TinkerProxy 2.0 is an update to SerialProxy 0.1.4 (serproxy.exe). It works in the same way as did serproxy.exe and uses the same configuration...SerialProxy vs COM10 : The ultimate deathmatch
April 22, 2009 If you ever tried to access COM port 10 or above with SerialProxy on Windows you already know it just does not work. Period. Let me tell you why it does not work and how we can fix that. Update : this problem has been resolved as of May 4th 2009. Please check the article titled SerialProxy can now use COM ports above 9 for more details. If you are interfacing Flash with Arduino, you surely know of the existence of serproxy.exe (aka SerialProxy). This very handy piece of software transl...Interfacing Flash and Arduino, from scratch (Part 1)
January 8, 2009 The Arduino micro-controller is a powerful little wonder. We already know it can be programmed using the Arduino IDE, but wouldn't it be cool if we could interact with it strictly using Flash ? This article shows you how it can be done. Once everything is set up, what can be achieved by the Flash/Arduino combo is pretty amazing. For instance, you can configure the board, read sensor inputs or trigger external equipments directly from the comfort of your beloved ActionScript 3 code. While ...