Thursday, February 17, 2005

A First Attempt At Some Real ActionScripting

There's snow by my window.

Absolutely exemplary the Syracuse weather spirits, the snow persists on even as we go into late February, the sky blessing and cursing us at the same time with light dustings of powdery stuff every so often to remind us that yes, we're in Syracuse, and yes, its fucking cold.

But in spite of a late winter that hadn't even kicked off by mid January, the snow is still retreating noticably fast, dashing aside any premonitions I had had about a late winter slodging on into May and perhaps even June.
We'll get flakes once every so often now, the pitiable little crystals plummeting from the sky in a valiant attempt to bring Syracuse back to its former hellishly wintry splendor, while the trees, the grass and the various foliage shed their skeletal winter coats and attempt to shine green again.

Its in the midst of all this, that I, like one single blade of grass trying to push through a foot of leftover snow, attempt my first mind-numbing foray into Flash Actionscripting.

Its in the midst of all this that I am reminded of why I dropped out of the Computer Science program senior year after having slogged through it my entire high school career.
Its not like its hard...no not at all. Its cake, compared to OpenGL or Java or any of those mass bigtime languages. Cake with icing and three cherries in fact.
Its just -picky-.

The interface for Flash, I found, is -extremely-, extremely click-sensitive. Not saying that it takes more or less pressure per click than any other program, but in saying that the interface is a lot less forgiving in terms of selecting objects and working with them and such.

First thing I did was give the pen tool another chance.
After trying half a dozen things that I could think of off the top of my head, consulting a few books, and trying some more things scraped up from the bottom of my braincase, I was still unable to move two control points across the screen.
I rewarded all of my hard work by deleting them.

Next I attempted to replicate one of the white line borders from the project below by drawing it manually...procedurally, as it were.
This process alone took me two hours. One single fucking white line took me two painstaking hours, most of which consisted of a random mixture of frustrated searchings, looking up tutorials, and occasional cries of "AGH WHAT THE FUCK" that ended up really confusing my roommate.

Finally, finally, I was able to create a single white line.
This white line was unable to move. And as hard as I willed it and wished it to move across the screen on its own, or maybe by the power of my mind, it remained resolutely in place.

So I deleted that too, and just used the line tool.

From there converting to a movie clip symbol was easily done enough. The coding was puttering on nicely until I tried to test the movie and it showed me the one line sitting on the left side of the screen.
It still wasn't moving.
Nevermind the fact that my code is supposedly telling it to run across the screen and do little flips and act like it was happy despite the fact that I could use up my hands and feeting counting and still have times left over where my roommate was confused with my shouting.
It still wasn't moving.

SO then, I took a breather, took a step, took a step -back-, and looked at the code and the timeline, and the symbols...everything.

Then I made two clicks and four keystrokes.
And suddenly it was working-

SWF:
http://web.syr.edu/~pctsao/VectorAnimation.swf
FLA:
http://web.syr.edu/~pctsao/VectorAnimation.fla

I had spent more than an hour and a half of frustrating shouting, typing, recoding, and saying inspiring words to my monitor trying to get this thing to work....and it was all done in two clicks and four keystrokes.

That's awesome.
And by awesome I mean its the most torturous thing I've been through in a while on the computer, and really brings to mind why I was never a -huge- fan of the compsci.

There's snow by my window.
Maybe I should go outside.

No comments: