Adventures in Bey Bey Name Generating

I had the pleasure of working with my wife on a project for the first time this week. It was only about a day’s worth of work, but so far it’s been the most viral thing I’ve ever been a part of. And also had the quickest visitor drop off due to it’s timely nature.

The project was the Bey Bey Name Generator (┬áIt’s a simple little web app that was inspired by Jay Z and Beyonce giving their new baby the ridiculous name of Blue Ivy. My wife heard this and said to me almost immediately that we should make a website that lets you come up with your own name using the same equation of Color + Plant = Silly Ass baby name.I found some spare time to design and code it and threw it online. It’s crazy how simple the concept and execution was and how people seemed to really dig it. screenshot

In the 3 days since we let it loose, it’s generated 27,000+ views, mostly coming from facebook, twitter, the huffington post, and While it was taking off, I kept my eyes on the live google analytics stuff to see where it was blowing at the time. I suggest anyone that’s launching a site to check that out. It’s actually really cool (if you find graphs and statistics and that sort of thing cool). But my favorite part of the whole thing was when Beavis and Butthead tweeted about it.

I don’t plan on doing any other of these quick little projects anytime soon, but if the moment arrives, I’ve learned that you just have to run with it before it’s old news.

Setting the swf Base Directory in HTML

Have you ever completed a flash project and started testing it online only to realize that the swf is looking for assets either in a different directory than the one you specified? Or that the folder that you have all your media stored is not in a relative directory like it was when working on it locally?

The solution that I mustered up in the past was to create a flashvar called something like “mediafolder” and put that in the embed code. From there, I would go back into my actionscript code and make sure all external media had the passed “mediafolder” variable appended to the beginning of the url for each external asset and then republish my swf.

This always worked well, so I usually plan for this, but my latest project didn’t have that built in. When it came to testing and we realized that the media folder was going to be in a different location than the base swf file and it was supposed to launch soon, it was time to see if there was another alternative to the usual solution. That’s when I discovered the “base” attribute in the swf object embed code.

The “base” attribute is actually an href attribute that specifies a base URL for all relative URLs on a page. Traditionally, you should be able to put it in the head of an html page and have all links on a page link relative to the string specified in the base attribute. For this it’s just specified for the swf, which picks it up when passed as a param and picks up any external asset from that folder by default instead of the folder that the actual swf is in.

Here’s a sample of the swfobject embed code:


With the example above, any asset that the main swf is trying to load relative to itself can now be placed in “../project/subfolder” without having to change any actionscript and republishing your swf. This is a tip that has saved me hours of work and would have saved me even more time had I discovered it in the past.