Nobien A nerd blog about nerdy things by … nerdy guys?

13Apr/106

On Learning

I'm at the point with Flash/ActionScript where I feel like I can no longer move forward in learning, at least not while gaining that awesome feeling of "No shit?! That's how it's done?!"

The Adobe v. Apple stand off isn't helping this. But over all, I don't think the public opinion of Flash really matters. If Flash sticks it out, I can still build banner ads, video players and microsites until I'm blue in the face. It's just nice to expand my options.

So what to learn and how to learn it?
I've picked up books on the iPhone SDK/Cocoa, Android, PHP and C++. Yes, it's quite an ambitious step to branch off and become a "general developer" vs. a Flash Developer. But I think over all, it should help.

Problems, and where you come in..
The biggest issue I'm having with learning new languages and frameworks is that every book, online doc, etc... has these drawn-out examples that start off with "How Conditionals Work" and end with advanced topics like "Dealing with Web Services." I know how programming languages work, so I end up getting bored and skipping over pages, often overlooking some crucial information about the product. By the end, I'm finishing their example just to finish it and often forgetting what I had learned.

So how you finding ways to learn and ways to get around this general "I already know this..." mentality?

What resources are you using to learn new languages?

How did you get to the point where everything clicks?

I realize these are pretty general, but I'm curious, so I must ask.

Filed under: Inspiration 6 Comments
6Apr/103

Capturing BitmapData of a Single Blurred Display Object is Annoying

I feel like I'm going crazy here. I have a circle inside a MovieClip. The (x,y) position of the circle inside the MovieClip is (0,0).  I'm applying a BlurFilter to the MovieClip the circle is in. I'd like to create some BitmapData based on the filtered MovieClip. Here's my code.

var blur:BlurFilter = new BlurFilter( 20, 20 );
 
circle2.filters = [blur];
 
var bd:BitmapData = new BitmapData( circle2.width + blur.blurX,
    circle2.height + blur.blurY, true, 0x00FFFFFF );
var clipRect:Rectangle = bd.generateFilterRect(
    circle2.getRect( null ), blur );
trace( clipRect ); // (x=-10, y=-10, w=70, h=70)
bd.draw( circle2, null, null, null, clipRect );
 
var bm:Bitmap = new Bitmap( bd );
bm.x = 385;
bm.y = 31;
addChild( bm );

And here's the result:

Get Adobe Flash player

I'd like to think that using the clipRect that's returned from the bd.generateFilterRect() method in the bd.draw() method would properly define the capture area of the MovieClip, but it always gets cropped wrong. Am I crazy? I really feel like this should work. I've fiddle around with the values and I still can't seem to get it to work.

The only work around I was able to come up with was to put the circle MovieClip in a container and adjust the X and Y position of the container based on the blurX and blurY values, but that just seems annoying to have to do!

Any suggestions?

Update!
Thanks to Dan (see comment below) to letting me know whats up. I was a total moron. I tend to shy away from Matrix objects because I'm scared of them (only becase I don't know how to use them). Works like a charm now. Check it:

Get Adobe Flash player