Personal and Professional Blog of Rich Hauck

Light Graffiti

October 16, 2009

I teach digital imaging at HACC, and one of the projects I assign is a low-light/night photography series. The assignment usually yields some pretty interesting stuff.

I give a brief presentation on abstract photography beforehand, where I mention painting with light, but I never actively tried it (if you’re not familiar with what this is, it’s basically doing a long exposure and taking a light source, such as a flashlight, and playing around). This semester, one of my students expressed their interest in this technique, and it got me wondering how difficult it is to not appear in the photo. Since I couldn’t remember ever seeing light grafitti on Beyond Second, and I figured it was about time to post something, too.

As I prefer to teach with my own examples (and not stock photography), I went out the other night and did some shooting. My wife noted that it was the first time in ages I’d done so . . .

_MG_6417

I was trying to get a skyline shot for a site design. I never used it in the design, but I started playing around with 20-30 second exposures.

_MG_6446

You can see my head above the statue. I tried to work quickly, as I didn’t want to wake the guy snoring on the nearby bench.

_MG_6443

I think it’s good practice to take a standard exposure of the subject matter, just in case you want to do tonal mapping to the image. I tried doing this to eliminate the ghosting in the above shot, but in this case, merging the two yielded too clean a result for my taste.

It’s pretty addictive, and one soon finds themselves wanting to experiment with different colors, patterns, etc. I’ll probably go out and do this again at some point, and I’m wondering if I’ll ever see someone doing the same at 2 a.m.

Categories: photography

Events, Etc. Website Launches

October 15, 2009

_MG_5203

Hauck Interactive recently launched a new Website for Events, Etc., the catering company from the folks over at the Hershey Pantry. The new site features some of my photography–and had me running out to all of the really nice wedding venues in Hershey and Dauphin county. Check it out.

No more lawnmowing for me this year!

October 13, 2009

IMG_0584

Categories: webdesign

Visiting Jim Henson’s Fantastic World

October 11, 2009

muppet I’m just getting to this now, but a few weeks back I made it out to the James A. Michener Art Museum to see Jim Henson’s Fantastic World, a traveling exhibit that will be in Doylestown until November 29, 2009.

It’s not a large exhibit, though I found the video worth watching–a rarity when it comes to me in museums. Yes, they have Bert, Ernie, and Rolf encased in glass. No, sadly, they don’t have Jennifer Connelly or David Bowie present (though I’ve been meaning to rent Labyrinth). Despite the “timed entry system” stated on the museum Website, they were pretty laid back.

I was most surprised by the fact that Jim Henson worked extensively in graphic design and advertising. Sadly, the YouTube video is gone, but I never knew that Cookie Monster got his start in a 1971 IBM training video (BoingBoing has a photo).

Categories: art, travel

Skinning Shopify with Flash

October 8, 2009

I figured I’d dedicate a post to this topic since I just wrapped up a rather painful learning experience with skinning Shopify (the Ruby on Rails-based shopping cart service) with a complete Flash frontend. Judging from the lack of documentation online, I’m willing to bet I’m one of the first crazy enough to take on such a challenge, and I’d hope to save some other poor developer some time.

Shopify tools

For starters, here’s a few of the tools Shopify provides for skinning:

  • Shopify’s API, which allows you to communicate with the inventory, products, collections, and cart on Shopify.com
  • Vision, a toolkit for creating a Shopify theme.

Working with Vision

jhhjk

If you're wondering how to access Shopify's API for your store--and your store only, check this link in your Shopify admin.

I  started with Vision, which is this handy application that you can run locally, modify Rails/HTML theme files, and then test in a browser. Once ready, you simply zip up the theme’s contents and upload it via your Shopify store’s browser-based admin. A nice setup, though I came across a few technicalities–

  • As of this writing, Vision themes are limited a 40 MB size limit, and rightly so, since it’s a browser-based file upload. I happened to be working with a site with roughly 300 MB worth of photos, so I was forced to host the assets on a different site.
  • Shopify’s admin allows you to individually edit theme files, but if you want to upload a replacement you have to first delete the existing file. This made it very time consuming, since SWF files can’t be edited in a text editor.
  • Themes are broken down into three folders:
    1. assets – files associated with your theme. Think images, javascript, swf files, etc.
    2. layout – this contains the theme.liquid file, which is basically the wrapper in which all of the templates are loaded
    3. templates – this contains a variety of necessary pages for a shopping cart site, like a product page, cart page, etc.

    A few things to note here: Unfortunately, I learned that the assets folder can’t contain subfolders, which lead me to a rather messy site structure. Your Shopify site will require all of the default template files. Since I was essentially rebuilding these all in Flash, I embedded my main SWF in theme.liquid and HTML-commented the include calls in theme.liquid.

Getting ActionScript working with Shopify’s API

The key here is authentication, as described in Shopify’s API. The API spits out XML, which is easy enough to parse in ActionScript, however, since API calls look like this:

https://API_KEY:SOME_PASSWORD@some-shop.myshopify.com/admin/orders.xml

they shouldn’t be queried from within Flash directly, as this exposes the shop owner’s API Key and password. Instead, it’s safer to create a server-side script, open the XML, and then feed it to Flash.

Once I got past this, it was pretty straightforward, with one exception–I couldn’t find the cart contents in the API documentation. After doing some asking around, I discovered that the cart contents can be found at your-shop.myshopify.com/cart.js. Now, unlike the API, this list of products contained in the cart is not XML, but Javascript Object Notation (JSON). Sure, I could have taken the time to write a JSON parser for ActionScript 3, but thankfully the good people at Adobe have already written one. It’s in as3corelib, which is hosted on Google Code.

Security and crossdomain goodness

Anytime a SWF file attempts to access content from a URL other than the one it’s on it first checks for a crossdomain policy. This is basically an XML file named crossdomain.xml that is hosted on the root level of the server (You can catch the dry documentation on this here and here).

Fortunately, Shopify has crossdomain.xml files prepared, however, it’s still a bit tricky.

Since they don’t want anyone hacking their main site, there’s no policy file on *.shopify.com. Granted, your-shop.myshopify.com has a policy, but there’s no way to pull your theme files.

domain has crossdomain.xml hosts swf theme files
your-shop.myshopify.com YES NO
cdn.shopify.com (URL to theme assets as generated by Vision) NO YES
static.myshopify.com YES NO
static.shopify.com NO YES

In the end, I explicitly referenced all of my SWF files from static.shopify.com and relied on the crossdomain policy file on your-shop.myshopify.com, which looks like this:

<cross-domain-policy>
<allow-access-from domain="*.shopify.com"/>
<allow-access-from domain="*.myshopify.com"/>
<allow-access-from domain="www.mydomain.com"/>
</cross-domain-policy>

So that’s it in a nutshell. If you’re out there using Flash as a complete skin for Shopify, drop a comment and let me know that I wasn’t alone! :)

Categories: ActionScript, Flash, flex, webdesign

Harrisburg Cupcake Cup

October 7, 2009

cupcake-cup

I made sure to make it back from a grad school reunion in NYC to attend Harrisburg’s first Cupcake Cup. Kudos to Erica Streisfeld for organizing the event, which took place at the Midtown Scholar bookstore and raised a few hundred dollars for the Central PA Food Bank. Sadly, the cupcakes weren’t documented thoroughly, so I’m not even sure which delicious one I had. I guess I’ll just have to wait for next year.

Categories: food and drink, Harrisburg

About Me

Rich HauckI'm a designer, developer, and teacher based in Harrisburg, Pa. I run Hauck Interactive, Inc.




Archives