Oh, children, children…

20 02 2010

And parents.  Spent this afternoon (took a break around dinner, see below) and evening learning about parent-child relationships, event listeners, and classes in general.  I have decided to never again use timeline navigation for anything but animation… the class-based movie-clip stage method that Jody Hall explains so well in this tutorial is so slick and easy that I think even a beginner in both Flash and OOP (object-oriented programming) could understand and apply it.  I wish I’d read Hall’s work years ago—it’d've saved me loads of sweat and tears!  As it is, I find myself wanting to make an application (I did make one (Mac and PC) as a follow-along to the timeline tutorial), but I’ll be good and stick to my circles and animation!  I’ve been trying to devise an overall gameplan of how to structure the animation/underlayer/mask elements (and, later, how to incorperate Processing or run it alongside).  Thoughts: run animation on top of underlayer on the main timeline/screen, run mask over both.  Required: figure out how to run the two movieClips from ActionScript not timeline, figure out how to mask through AS, resolve circle animation issues, figure out how to use the circles as a mask through AS.  I can do this, I think… I can, I think I can, I think I can…  Three weeks, two papers, one animation and code problem.  Plus finals. :)

Other news: I biked to 5th St for falafel again (I’m getting mileage out of that twenty’s change, mum, thanks!) and went to see Whip It at the David Minor Theater; why they named it “minor” is a mystery to me, as I got my ID checked upon entrance, although I imbibed of no spirits.  Oh, and I finished Forty Thousand in Gehenna.  It was amazing, as all of Cherryh’s books seem to be.  Also amazing is my ability to partition off my brain from the panic that really ought to consume it this close to the end of the term.  Then again, my über-fast research/writing skills have never yet failed me, so it’s logical that my brain not panic, having never had a blow-up caused by failure to meet deadlines.  A child who has never been electrocuted can’t truly fear a live wire, right?  (I wouldn’t know; I stuck tweezers into an outlet when I was two, and that wasn’t my last encounter with high-voltage electricity; I’ve had four or so, to date: tweezer outlet, variable power source exposed alligator clip, light switch with exposed wiring, electric fence—with the back of my hand, of course!  Also, ask my mother about the things I used to eat/put in my mouth—paint, some strange orange chemical I found on a tree, sap my older sister told me was honey, any manner of household cleaning products, soap… the response from Poison Control to my mum’s repeated calls came to be, “What’s she eaten now?”)  Long tangent that was, eh?

UPDATE: I’m going to bed as soon as I post this , I swear (today’s migraine is getting nasty and I’m actually kind of tired, no thanks to my insomnia, and sleep and meds will do wonders for both), but I just had to do this now—I fixed everything but the radius problem on the flash end (big circles get too big), and here it is!  Plus the Processing apps in Mac and Windows.  You need to run the Processing app first, then the swf, and hope that the socket connection between them works!  If not, here’s the code for both.  And here are pictures at 320×240 and 640×480 of sample flash video feed, as the socket seems to be unhappy.  Methinks I must route it through the web or something…

Also, a small increase in stage size leads to a HUGE lag in animation… Will need to figure out how to work with or around this.  But, all in all, I’m VERY pleased with the progress made today.





Ask me what I should be reading…

20 02 2010

Yesterday, John helped me get the socket to work in ActionScript 3.0, which should make drawing much easier… I say “should” because I have yet to draw circles from within a loop successfully, and because I need to make sure my string sorting algorithm is working properly.  I’m going to do a test by sending it obvious data (i.e. x-val-1, y-val-1, r-val-1, x-val-2, y-val-2, r-val-2, et cetera) and then checking the contents of the string and the sorted arrays.  More work on that to come today.

In other news, I enjoyed the sun yesterday: I biked to 5th St Market for falafel and lamb curry at Casablanca, my favorite eats in town, followed by espresso ice cream at Marche Provisions downstairs; then back to campus for my honors science class, which turned out to be very entertaining (among the topics tangentially discussed were floating cities on Venus and relocation of all Republicans to Mars, to which I replied that was littering and we should send them to a penal colony on Venus; note to all Republicans: peace out, I love you, it was all in good fun, I assure you!).  Then I biked out to VRC to see Sherlock Holmes (with my sneaked-in Wetzel Pretzel and Naked bottle full of water, plus the macaroon from Marche Provisions), which proved to be very entertaining (I love explosions and intrigue, plus ROBERT DOWNEY JUNIOR! oh, dare I hope for a sequel?), and then biked back in the relative dark, ignored dinner until 10 or so, and caught myself up on the Men’s single skating (I still think that Johnny Weir was heinously underscored and should have taken bronze at minimum, if not silver; Plushenko’s jumps were just not there—tilts and wobbles and I don’t know how he managed to land one of them, added to choreography that just wasn’t all that great).  Sigh.  I felt so bad for Takahashi falling on that first jump, but he pulled everything else off spectacularly.

I’m almost done with Forty Thousand in Gehenna, by Cherryh again (finished Cyteen: the Vindication some time earlier this week), which has been brilliant.  Go ahead, ask me what I should be reading…

UPDATE: I resolved the array data sorting issues and got Flash to draw from within the loop (yay! but not quite how it should be drawing… compare the two here).  And Flash is crashing again, a scurrilous action I thwart by reflexively saving before I run the thing.  I’ve put a 5-second delay into Processing (better than the 1-second delay it’s been for a while) and I intend to figure out how to debug with breakpoints in Flash.

UPDATE: Hmm…

Attemping to launch and connect to Player using URL /Users/emilys_old/Desktop/SpecialProbs—John/TECH/!!FlashAS3Socket.swf
[SWF] Users:emilys_old:Desktop:SpecialProbs—John:TECH:!!FlashAS3Socket.swf – 2873 bytes after decompression
SecurityError: Error #2010: Local-with-filesystem SWF files are not permitted to use sockets.
at flash.net::XMLSocket/connect()
at _fla::MainTimeline/frame1()[_fla.MainTimeline::frame1:23]
Cannot display source code at this location.

Well, fine, Debugger!  Be that way!  Guess we’ll have to do this the hard way.

UPDATE: Flash has stopped crashing, and the circles are in their proper positions, but the radii are wrong, and the stage is not clearing appreciably.  I think I should start drawing the squares as child sprites so I can delete them as necessary, but the example code in the AS3 API has errors (Packages cannot be nested), which strikes me as funny even as it annoys me.








Follow

Get every new post delivered to your Inbox.