home about | services artwork blog

M endorsement

Friday, August 24, 2007

I finally got my motorcycle license last week, prompted in part by the fact that the other developer will be on maternity leave any time now, limiting my ability to spend half a day at the DMV, and by the fact that geico sent a letter in reference to my new policy, asking to see a copy of the license. The reason I never got the M endorsement in Milwaukee was because I could never get in to take a test. You had to schedule road tests months in advance. It was ridiculous. I have a feeling it was mostly to get people to take MSF courses out of frustration. Not to mention feeling retarded for showing up to a motorcycle test with a scooter. It almost seems like cheating.

But not here, in Louisiana! Cause here... who cares? Getting to the DMV here is substantially harder than the actual test. Just sitting at the DMV waiting for the test is harder than the actual test. When my turn finally came around, a lady instructed me to bring my bike to the back of the parking lot. She met me back there, checked that my lights all worked properly, and asked me to do two figure 8's. "How big?" I asked. "Whatever you feel comfortable with..." So I said "ok" and did a reasonably small figure 8, but nothing drastic. She called to me to go all the way to the back fence, so I made my second figure 8 much bigger. Then she motioned for me to pull into an empty parking spot and said "You passed! you didn't fall."

Then her co-worker started talking to us about how she was thinking she should get one of them scooters. It was even easier than driving around the block for my first driver's license when 1 was 15.



I've definitely got Vespa envy lately.

Labels:

posted by j. Permanent Link 0 comments

flash tidbit

Wednesday, August 22, 2007

Something I picked up last week:

I use the "? :" syntax for simple if/else statements all over the place in my code, but one thing i never really liked was in this scenario where you're saying if x exists, set this variable equal to x, otherwise make it y... like this:

var bla = (x) ? x : y;

So I found out that you can do:

var bla = x || y;

and it means the same thing. If x doesn't exist, make it y. One scenario I haven't tried yet but am suddenly curious about... if x is a boolean and it's false, does that make bla y? Or is this only in the case of x being null or undefined? Hm!

Labels: ,

posted by j. Permanent Link 1 comments

Fuse Tweening without onMotionFinished

Tuesday, August 14, 2007

Yes, I have just written a non-New Orleans based post:

I've been using the Tween class in Flash to good effect for a long time now, but this current project i'm working on has finally spurred me to check out Fuse again (specifically for using movieclip_mc._tint = "#FF0000"; instead of messing around with ColorMatrixFilter, ugh).

Ok, so I'm going through this other thing i'm working on, replacing Tweens with Fuse methods and whatnot, and I got stumped on something annoying: Tween has a very easy method for triggering subsequent events with "onMotionFinished," while Fuse has a few ways of triggering events like callbacks and listeners... but i hate listeners. I don't like writing them. I think they're convoluted and annoying -- not that using syntax like onMotionFinished is that different, but it avoids two lines of code: creating and adding the listener object.

So say I've got a method two methods, removePageX() and displayPageY(). removePageX() is a bunch of tweens to fade out of move movieclips, which using fuse i could just attach {scope:this,func:"displayPageY"}. BUT, before calling displayPageY, I want removePageX to tween out all of the movieclips, then removeMovieClip()'s, then call displayPageY. The closest thing that Fuse offers, of course, involves listeners. This is what I've come up with:

fadeStartBtn.onMotionFinished = function(){
owner.evtObj.this_mc.removeMovieClip();
owner.evtObj.that_mc.removeMovieClip();
owner.evtObj.next_btn.removeMovieClip();
owner.displayPageY();
}


gets replaced with

var listener = new Object();
listener.onTweenEnd = function(){
owner.evtObj.this_mc.removeMovieClip();
owner.evtObj.that_mc.removeMovieClip();
owner.evtObj.next_btn.removeMovieClip();
owner.displayPageY();
}
evtObj.start_btn.addListener(listener);


What it comes down to in using fuse is that I either have to add all of these listeners all over the place using this method, or, if I use callbacks (which i've read are better on resources), I'd have to create a kind of proxy method that happens between one remove method and the next display method. I think optimally, it could be done one of two ways. Either it could be as simple as

evtObj.start_btn.onTweenEnd = function()... (or even retain onMotionFinished...)

-or-

we could do something like

var blaMethod:Function = function(){
bla.removeMovieClip();
trace("so bla");
}
bleh.fadeOut(1,Regular.easeInOut,.5,{scope:this,func:blaMethod});


but that doesn't work, presumably because of scoping issues, as it's looking for blaMethod in the class not the removePageX method.

So I don't know. Maybe there's some very simple solution that I'm overlooking, and if so someone point it out! Otherwise, i guess listeners it is!

Labels: , ,

posted by j. Permanent Link 9 comments