Duplicate a DisplayObject as a BitMap

In working on a project, I created a simple utility class that has this public static method. This basically takes a DisplayObject, copies it, and adds it to a new Sprite which is then returned to the caller. Simple enough. I'm sure this can be refined or done a different way, so have at it.

public static function duplicateImageAsSprite( original:DisplayObject ):Sprite
{
    var bitmapData:BitmapData = new BitmapData( original.width , original.height ,
        true , 0x000000 );
    bitmapData.draw( original as IBitmapDrawable );

    var bitmap:Bitmap = new Bitmap( bitmapData );

    var returnSprite:Sprite = new Sprite();
    returnSprite.addChild( bitmap as DisplayObject );

    return returnSprite;
}

More Than Two Simultaneous Key Presses and KeyboardEvent.KEY_DOWN Woes

I'm rather annoyed right now. For whatever reason, I didn't think that determining if the user has 3 keys pressed at once would be so difficult. Attempt to press all the arrow keys that correspond to the arrows being displayed...

Sometimes it works, sometimes it doesn't and I can't understand why or find a pattern to the malfunction. But basically whats happening is at some point the KEY_DOWN event just isn't dispatched for a particular arrow key once two of the other arrow keys have been pressed. Does anyone have any freaking idea why this is happening?

Headed to FITC Chicago. Free Books?

So I just got the OK from work to go to the FITC Chicago event. I'm pretty excited because I'm actually quite interested in the sessions that are going to be happening at the one day event. Most particularly I'm looking forward to hearing Samuel Agesilas (levelofindustry.com fame) speak about Orchid. I'll also be hoping to maybe hear some news about his Saffron project. That of course would just be a bonus. At any rate, is anyone else going? Perhaps I'll bring a few copies of the book to hand out if anyone would be interested.

R&D Departments & AD Agencies.

There was a pretty interesting entry up on CREATIVITY (online) last week. It was about how Arnold, Boston started it's very own Research & Development department, staffed with a couple of young technologist/designers. [read here]

My opinion on this matter is a bit mixed. Part of me is looking at this type of idea with great skepticism, another is looking at it with a little jealousy, and a small part is looking at it with some hope. I'm more curious what other peoples' opinions are on this subject.

Read the rest of this entry »

Super Fun! UT Loop Website

This is rad little site. I was able to make a funny little loop and then get an embed code for it. Great concept.


SWFAddress 2.1 & SWFObject 2 Work Together.

I spent a good hour yesterday trying to get SWFAddress 2.1 and SWFObject 2 to work together. First off, they do work together. Second, there's nothing to it. Then why did it take me an hour? Because I'm a dummy and I had the order in which each JavaScript set was called. In hindsight, this is common sense, but the golden ticket here is calling SWFAddress javascript BEFORE declaring the SWFObject. This more applies to people using the dynamic way of embedding the SWFObject. ie:

 
<head>
    <title>SWFObject v2.0 - step 3</title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
    <script type="text/javascript" src="js/swfobject.js"></script>
    <script type="text/javascript" src="js/swfaddress.js"></script>
    <script type="text/javascript">
                swfobject.embedSWF('website.swf', 'website', '100%', '100%', '9.0.45', 
                'swfobject/expressinstall.swf', {}, {bgcolor: '#CCCCCC', menu: 'false'}, {id: 'website'});
    </script>
</head>
 

Silly right? I saw a couple of posts out there of people having a hard time getting this going. Once I flipped the JS declaration, it worked. And I felt kinda dumb. But hey ... That's life.

BTW: both SWFAddress and SWFObject 2 are pretty amazing and should be worked into your site/app flow if they aren't already.