Category: Work


Monday 2009/07/20
12:59 PM

Categories:

Flash/Actionscript, Web Dev, Work

We Choose the Moon, FWA S.O.T.D.

Update 2009-08-04: We Choose the Moon was chosen as FWA Site of the Month!

moon_sotm.jpg

moon_sotd.jpg

We Choose the Moon is today’s FWA Site of the Day. The moon landing is tonight, after which the site will shift to post-live mode where you can investigate each of the stages separately.


Wednesday 2009/07/15
6:33 PM

Categories:

Flash/Actionscript, Web Dev, Work

We Choose The Moon

wechoosethemoon.jpg

I’ve been working on this site for a while: We Choose The Moon. It’ll accompany a real-time audio stream of the entire Apollo 11 mission, with each stage marked by a 3D cinematic. Great work by the crew here at Domani Studios, and our fellow astronauts from the Martin Agency and AOL.

Launch time is 9:32 AM EDT tomorrow, July 16. Buckle up.


Wednesday 2009/07/01
10:09 PM

Categories:

Flash/Actionscript, Technology's Betrayal, Web Dev, Work

Event.ACTIVATE and WMode

Another classic case of finding things out the hard way: in ActionScript Event.ACTIVATE and Event.DEACTIVATE do not fire if the swf is embedded with wmode set to transparent. I was working on a project that needed to know when the user switched focus away from the swf, and couldn’t figure out why the event would fire in the standalone player but not when run in the browser.


Thursday 2008/06/12
12:32 PM

Categories:

Tech, Web Dev, Work

svn:externals and the Versions svn Client

versionsapp.jpg

Update 2008-06-16: The latest beta of Versions (1.0b2 (31)) now allows you to set a different program for comparisons. I set mine to Changes, which I find a bit easier to work with than FileMerge.

I recently stumbled upon Matthew Weier O’Phinney’s explanation of svn:externals and how you can use it to mix stuff from multiple repositories in one project. This helped me when I was setting up a new project at work, since we keep a lot of core code in a centralized repository, but of course each project gets its own separate location. Matthew’s explanation should be included in the svn documentation, which (as he points out) lacks a simple example of how to use svn:externals.

The gist is to navigate to the folder into which you want to check out the external library, and then execute:

svn propedit svn:externals .

Within the editor session you need to add one line for every external library. The order goes: name of local folder, path to external library, like so:

extlib http://www.foo.com/path/to/external/libary

After you save and exit, an svn update on the directory will pull the external library into the folder you named in the property declaration.

I ran into one small issue — the propedit command requires that the environment variable SVN_EDITOR is set, otherwise it’ll bail. I added a line to my bash profile (export SVN_EDITOR=/usr/bin/vi) to point it to vi. You can also point it to TextMate if you wish, just use export SVN_EDITOR=’mate -w’ instead.

More…


Friday 2008/04/25
4:05 PM

Categories:

Flash/Actionscript, Technology's Betrayal, Web Dev, Work

So Flash, the Registered TM Symbol, and a URLRequest walk into a bar…

At work we ran into a little issue on how to pass the registered trademark symbol ® from flash to the user's mail client via a mailto: call. We originally tried jamming it into the string like so:

Actionscript:
  1. var tmessage:String = "%26%23174%3B";
  2. var _req:URLRequest = new URLRequest("mailto:?subject=hello&body=" + tmessage);
  3. navigateToURL(_req);

We had hoped that the email client would receive the string and decode it properly, but instead it simply rendered it as ®. Searching the web for help was complicated because "register" and "registration" appear so often in forms and unrelated content.

In the end, some experimentation and reading of the documentation for the URLRequest class led us to this solution:

Actionscript:
  1. package
  2. {
  3.     import flash.net.URLRequest;
  4.     import flash.net.*;
  5.     import flash.display.Sprite;   
  6.    
  7.     public class SendToFriend extends Sprite
  8.     {
  9.        
  10.         private const MESSAGE:String = "This message is from dirtystylus®";
  11.        
  12.         public function SendToFriend(): void
  13.         {
  14.             send();
  15.         }
  16.    
  17.         private function send():void
  18.         {
  19.             var _req:URLRequest = new URLRequest("mailto:");
  20.             var variables:URLVariables = new URLVariables();
  21.             variables.subject = "hello";
  22.             variables.body = MESSAGE;
  23.             _req.data = variables;
  24.             _req.method = URLRequestMethod.GET;
  25.             navigateToURL(_req);
  26.         }
  27.     }
  28. }

The URLRequest class has a data property, to which one can assign a URLVariables object containing stuff that we were trying to jam into the string as name/value url-encoded values. Assigning the variables to the data property also automatically urlencodes them before the URLRequest is sent, so in the final solution we just plugged the "®" symbol directly into the string, and it was urlencoded properly and emerged in the email body intact.