joshbuhler.com

Tag: sample code

Flash Waterfall Bitmap Effect

by Josh on Jul.03, 2008, under ActionScript, Flash

I saw this effect a long time ago, and wanted to use it in a project, but after about ten minutes of searching for the original, I gave up and just decided to make my own.

waterfall.png

Click on the image above to view it in action.

This is just a basic bitmap effect that uses BitmapData to draw an image, with the pixels spilling down from the top in a waterfall-type effect. The fun thing about this is that since the source of the effect needs to implement IBitmapDrawable, you can supply just about anything as the source. In the example below, select “This Panel” to watch the options panel be redrawn. The end effect is that each individual piece of the panel is “beamed down” on it’s own. The “Flow” image is another favorite of mine.

The ’speed’ option is simply the number of milliseconds used in the Timer to execute the effect.

Source is also provided, just right-click on the example to get it.

5 Comments :, , , , , , , , more...

AIR Installer Badge - Error #2032

by Josh on Jun.30, 2008, under AIR

While working on creating an installer badge for an AIR application I’m working on, I kept receiving the following error when trying to install the application: Error# 2032

error2032.png

After doing a bit of Googling, the most common solution I found was to make sure that the MIME-type for AIR was set on your server so that it would recognize the AIR filetype.

You can do this by adding the following line to the .htaccess file for your server: (I’m not a server guru, so this may not work in all cases, but it works on the Apache server I’m using.)

AddType application/vnd.adobe.air-application-installer-package+zip .air

After adding this I was still receiving the error. So… a little more time searching, and I found another piece to the solution - I had been using a relative path name in the flashVars for my installer badge. That doesn’t work. Apparently, while you can use a relative path for the thumbnail image displayed by the badge, the actual path to the .air installer file must be the full path to the file. (http://www.domain.com/pathToInstaller.air).

Since it took me a little bit longer to find that part of the solution, I wanted to post it here, just to add one more place where you might be able to find it. These aren’t the only two reasons why you could receive this error, but at least it’s two more possible solutions.

8 Comments :, , , , more...

Comparing Objects Using ByteArrays

by Josh on Feb.11, 2008, under ActionScript

There have been plenty of times in projects where I’ve wanted to compare two objects to see if they are equal. I don’t really care if they are the same object, all I care about is if they are identical - meaning that they could be two unique objects, but that the values of their properties are equal to each other.

(continue reading…)

Leave a Comment :, , , , , , more...

Looking for something?

Use the form below to search the site:

Still not finding what you're looking for? Drop a comment on a post or contact us so we can take care of it!

Visit our friends!

A few highly recommended friends...