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:
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:
Using BitmapData to Improve Performance (And One Small Annoyance)
Lately I've been experimenting with generative art in Flash/ActionScript 3. Its been pretty fun and I've created some interesting results. In my experience, and I can only assume in most other artists and developers cases, I really got familiar with the Flash Player's performance limitiations. More specifically, I came to truly find out just how bad the Flash Player is at rendering a lot of display objects at once, even if they're just Shape objects, even if cacheAsBitmap = true, and even if they're not animating in any way. This, of course, forces you to look into performance enhancing techniques.
Get yourself to NYC for Flash and the City
I had the pleasure of hanging out with Elad Elrom last night. He's one of the organizers of the upcoming Flash and the City conference here in NYC. I highly recommend attending this conference for the following reasons:
1. Its in F*ckin' New York City!
I know NYC isn't for everyone but there's everything you could imagine here. On top of learning and getting inspired about Flash you'll have everything NYC has to offer at your finger tips. The organizers of the conference know this and have created what they call the "City Track". They've organized a few "field trips" throughout the city that you can tag along with. Just think of all the cool stuff you'll be able to check out, eat, and do while you're here!
2. Its at the 3-Legged Dog Art & Technology Center
This place is just plain cool. Its entirely artist-run and have been supporting the arts in NYC since the center was built in 2006 just three blocks south of the WTC site. Personally, it feels good to be supporting such an organization.
3. The ridiculously good list of attending speakers
ZOMG! Srsly u guys! There hasn't been a large Flash conference in NYC...since...I don't know...2004? And that one pretty much sucked. But just look at the list of speakers! If you don't recognize the names, just trust me on this. They're are some really sharp people speaking about some great developments in the industry.
4. The Price is Right
Tickets right now are $299 (but lets just be real and say $300). In comparison to other conferences, this is CHEAP, especially for NYC standards. And if you keep your ear in the community (Twitter, blogs, etc), you might even be able to find a coupon code!
I'd say these are my main reasons for anyone to attend the conference right now. I'm sure I'll come up with more and if I do, I'll update this post. Naturally, I plan on attending seeing as I live here and I hope to see you along with my other friends and colleagues here as well! It's gonna be a blast.
Open Source Media Framework (Sprint 8) Bug in NetStreamPlayTrait and NetStreamTimeTrait?
Over the last two months or so I've been keeping my eyes on Adobe's Open Source Media Framework (OSMF) project. I started fiddling around with Sprint 7, seeing if I could build a progressive video player component on top of it. My first impression was that the project was still in its infancy solely based on the naming conventions of the framework's events. It just didn't feel intuitive. Additionally, there seemed to be some bugs surrounding the seeking of progressive videos. Alas, the development team has made some major improvements in Sprint 8 with regards to both of these items.
Upon downloading Sprint 8 I was immediately happy with the renaming of the framework event classes. They make much more sense now. Seeking progressive videos seemed to have improved as well, but I was still experiencing some buggy behavior when continuously scrubbing a progressive video.
New Flash Community Developments: Robotlegs and Signals
I've come to realize that I'm always a bit hesitant to change. I was late to get a cell phone, late to join Facebook, late to join Twitter, and often late to look into developments within the Flash community. Lately I've been trying to change how often I tune into Flash community developments. As of late I've stumbled across two projects that struck my fancy: Robotlegs and Signals. Robotlegs is a lightweight MVCS architecture that is very focused on dependency injection. Signals is the result of Robert Penner's frustration with the Flash Player's native event system. Thus he has created an event system inspired by C# events and signals/aslots in Qt. Both looked like interesting projects so I decided to dive into them further. I'll start with robotlegs.
AIR:CMR – Free Books? Academia?
I just received a couple copies of the Chinese translation of Adobe AIR -Create Modify Reuse. It's pretty exciting to see your book translated into other languages, even if you can't read them.
I'd like to donate them to a High School or College. Would anyone in academia like a Chinese or Spanish translated copy of our book? I'd prefer to hear from people who instruct New Media or IT courses, or is involved with a school's library.
I will only ship these to a school address. No home addresses. No student dorms and housing. Please email me at aircmr "@" nobien.net.
