Using .SWC files with the Flex SDK Command Line Compiler

If you are not a nerd, you might want to skip this post. It involves a specific technique for a specific Flash programming and development issue.

Still reading? Okay.

When programming in Actionscript, I use Notepad++ and the Flex SDK command-line compiler. The closer I can get to pure code – or rather, the farther I can get from using a Flash-specific IDE – the better. Unfortunately, there is one big hurdle to overcome when using this work method, and that is the inclusion of .swc files in my projects. A lot of useful libraries (e.g. Google Maps for Flash) come bundled as .swc files, and frankly, unless you want to pull a library apart and play with it, having everything compiled together in one file is pretty convenient.

All of the tutorials and documentation for the libraries contained within the .swc files assume you are using either the Flash IDE or Flash Develop. Nothing wrong with that; it is a fairly safe assumption which covers ~90% of the developers out there. Not so good for me, though.

So it was with unrestrained joy that I found an answer to my dilemma which gave me the best of both worlds. This is a simple extension to the tutorial put together by Senocular a couple of years ago, for those of us who refuse to be locked to a single development environment. The supa-smart Sakri found a way to add the libraries at compile time, without having to do any funky coding, or dealing with less-than-perfect developer tools. The complete instructions (assuming you have downloaded and installed the Flex SDK) are as follows:

0) Open the command prompt
1) drag&drop mxml.exe (or shortcut icon) into the command line
2) hit [space]
3) drag&drop your .as file into the command prompt
4) hit [space]
5) type in: “-compiler.include-libraries” without the quotes
6) hit [space]
7) drag&drop the swc you want to use into the command prompt
8) hit enter

If your code has no errors, then this should create a .swf file in the same directory as the .as file you dragged onto the command prompt. Best of luck!

Night Photos of the Grand River

Ice at the Sixth Street Bridge Dam
Ice hanging from a tree stuck on the edge of the Sixth Street Bridge dam, near the fish ladder.
30 second exposure.

Grand River At Night
Ice on a rock in the middle of the Grand River, near the Sixth Street Bridge dam.
60 second exposure.

Grand Rapids from the Fish Ladder 3
Looking East at the medical mile from the fish ladder.
15 second exposure.

Grand Rapids from the Fish Ladder 1
Looking East at the medical mile from the fish ladder. The line of lights across the sky is a plane approaching the airport.
30 second exposure.

Grand Rapids from the Fish Ladder 2
Looking East at the medical mile from the fish ladder.
15 second exposure.

Squash

Hubbard Squash 01

What started as this grotesque thing ended up as food enough to feed a large family for a day, or a small one for several days. The best part? A gallon of soup, the recipe for which follows:

Ingredients
6 ½ pounds Hubbard squash, cut into 1-2” cubes
3 medium tomatoes, skinned and chopped
1 large white or yellow onion, chopped
3 cloves garlic, chopped
1” ginger root, peeled and grated
1 tsp dried rosemary
1 tsp dried thyme
1 small hot pepper (optional) finely chopped
salt and pepper to taste
1 tbsp olive oil
1-2 limes
enough stock (vegetable or chicken) to cover all vegetables

Directions
Grind the rosemary and thyme in a mortar and pestle.

Pour oil into a large pot, heat, and add onions, garlic and ginger. Saute for a few minutes, until onions begin to turn translucent.

Add tomatoes and saute, constantly stirring, for another couple of minutes.

Begin adding squash, a handful of cubes at a time, stirring all the while, until all of the squash is in the pot.

Add the stock, bring to a boil, and reduce to a simmer. Cook until the squash is tender. This will take about half an hour.

Remove from heat and let the soup cool. Once it can be handled safely, puree everything with a blender. This will probably have to be done in three or four batches.

Return the soup to the pot, and add salt and pepper, and stir in the juice of 1-2 limes, adjusted for taste.

I documented the whole process. You can see the rest of the photos here.

A Tragedy Which Affects Us All

Due to budget cutbacks, the City of Grand Rapids has had to remove the lighthouse beacons from the Grand River at the base of the Sixth Street Bridge Dam. This has had disastrous consequences.

Turtle on the Rocks

Turtle Sunning on the Rocks in the Grand River

Turtle on the Rocks in the Grand River

TURTLES have been RUNNING AGROUND on the ROCKS!!!! Without beacons marking the deeper channels, turtles can’t avoid the rocks as they build up speed to leap the dam on their annual migrations northward.

Please: Think of the Turtles.