Personal and Professional Blog of Rich Hauck

AlivePDF addImage() bug yields ArgumentError: Error #2015 Invalid BitmapData

May 28, 2009

I’ve recently been using the open-source AlivePDF AS3 library to satisfy a client’s request for printing a PDF from a Flash movie. It’s a handy library–and something that would be handy to have built into Flash  (then again, maybe Adobe Mars will take over).

While trying to print out a screen capture of my SWF I came across a pesky runtime error. I’ve since posted to the AlivePDF open issues list, but I figured I’d post here (below) to help further help anyone searching for the issue.

What steps will reproduce the problem?

Basically, I’ve attempted to pass a parent of a DisplayObject or variable reference to a DisplayObject instance in my class. Examples:

myPDF.addImage(this);
myPDF.addImage(MovieClip.stage);
myPDF.addImage(MovieClip.parent);

What is the expected output? What do you see instead?

I wanted to take a screen capture instance of my entire SWF, but instead I’d get the following runtime error: ArgumentError: Error #2015 Invalid BitmapData.

The problem I found was on line 3190 of org.alivepdf.pdf.PDF.as. Using FlashTracer, I determined that the following values were being passed into the addImage function:

displayObject.width:44038179.6
displayObject.height:16513228.8

When I alternatively hard code the values, the PDF prints fine:
var bitmapDataBuffer:BitmapData = new BitmapData (1000, 600, false);

What version of the product are you using? On what operating system?

I’m using AlivePDF 0.1.4.8 with Flash CS3 and TextMate on MacOSX Leopard

Categories: ActionScript

Visiting the New Yankee Stadium

May 13, 2009
newvsold

Yankee Stadium III next to Yankee Stadium II.

Last week I took my friend Alison to what has become the annual NYC/Yankees trip. When I purchased our tickets from a season ticket-holding friend, I asked what his thoughts were on the new $1.5 billion complex. “Meh” was his response. After attending my first game there, I totally understood his reaction–and began to appreciate just how much I miss the dirty, antiquated–yet original “House that Ruth Built”.

Next to the food, of all the things I miss about big city life would be the convenience of the ballpark only a few subway stops away. I  ended up going to 10-15 games a season for the past few years, so it not only became a part of city living to me, but it rekindled my interest in baseball. This time around I traded the subway for a car ride up, but the experience felt weird for reasons other than transportation.

new-yankee-stadium

The stadium interior

Perhaps it was the game I attended, but there was no Marlboro Man. There was no horse jockey racing his imaginary horse. I fear the Bleacher Creatures have been diluted thanks to the openness of the bleacher area, and even Freddie, who has had his problems getting in,  was nowhere to be found. The grandstand felt further from the action, and the outfield display board felt distracting in all of its HD quality.

That’s not to say there weren’t things I didn’t like. For starters, I loved the return of the frieze and how the flags atop of it were ordered according to the current division standings. The seats were easily more comfortable, and the exterior limestone restored the gates to their original beauty. The Yankee Museum was a nice touch, and nearly every type of food was available (I joked at Alison about finding healthy food–only to discover a mini farmer’s market inside of Gate 4). I was also shocked–SHOCKED that they let my friend in with two bags.

frieze

The frieze returns.

One thing I do miss is the walkway  circumambulating the grandstand seats. Now, one must go underneath the grandstand to walk around, and while there’s a nice balcony mid-grandstand, one wonders why they should bothering sitting in their seats when there’s a closer view at the balcony.

comparison

A comparison of old versus new hallways (old left, new on right) makes me wonder about architecture's impact on crowds.

The bottom line: this new ballpark exemplifies New York in a different manner than its predecessor, as it trades the gritty, crowded, and tradition-laden landmark with one that features excess, accessibility, and financial exclusivity. I’m sure the place will settle into my mind more after a few more games, but it’ll definitely take some getting used to.

Categories: sports, travel

Ronan Pictures 2.0

May 12, 2009

Personally, I REALLY dislike professional pictures (I must have been a home-staging pro in a past life, because I’m really not into littering my house with family pictures!). In this rare case I’ll give the Mrs. a pass though, cause I think the boy came out looking pretty cute. More pictures here.

Now, just don’t expect a Facebook profile for Ronan–or me swapping my profile pic with one of my kid. Yuck!

Categories: photography

Revisiting Rome

May 7, 2009

During last month’s Central PA Tweetup I ran into a few friends that I hadn’t really seen since we were part of a group visiting Rome in 2002. The encounter reminded me of a Website of my Rome pictures I’d built shortly after the trip.

I posted the site to share the photos with friends (pre-Flickr, mind you), and I remember being scolded by people that were offended of a bunch of Penn State students hitting foreign bars so close to 9/11.

Apparently I’d taken the site down years ago, but I decided to restore it in its table layout, 800×600-supporting glory (you can check it out here).

The way I built the site and formatted the photos reminds me more of my age than any old picture of me ever would (Ugh, I’m getting old!).

About Me

Rich HauckI'm a designer, developer, and teacher based in Harrisburg, Pa. I run Hauck Interactive, Inc.




Archives