Category: Flash

Flash Bitmap 9-Slice Scaling (AS3)

I actually wrote this last week for a project I'm working on, so imagine my surprise when I see Grant Skinner's post on 9-slice scaling bitmaps in Flash.

His method uses a JSFL script to pre-slice bitmaps into separate MovieClips, which is great, because it's otherwise a complete pain. Mine works on a different principle, and is for runtime use.

My Slice9Bitmap script uses the pixel data from the Bitmap passed into the constructor, then transfers the appropriate pixel data to each slice, ensuring perfect stretching. Attempting to stretch the entire bitmap beforehand is...messy (also, why you can't do 9-slice scaling with pure CSS2/Javascript (outside of canvas)).

Currently, there is no boundary checking (other than for negative values), so it's up to you to implement this. Alternatively, you could wait until I add more features (which could be anywhere from weeks to months, honestly).

View Slice9Bitmap demo Download

Also, if you're not a hardcore Actionscript guy, Grant's method is quite ideal.


Adobe CS4 Issues and Mini-Review

Adobe has decided to make more of a commitment to customer support. They are teaming up with a global service provider, so I assume that means outsourced phone support. The best place to take your change requests is the Adobe Feature Request form.

This is a really, really long post. It's long both because the Adobe Creative Suite 4 is vast and encompasses many software packages, but also because I found a great deal of things to complain about. While complaining is nothing new for me, finding this many problems with a mature software product is.

In this post, first I will detail the problems I encountered using the CS4 products, some action items for Adobe, state a few positives, and an overall conclusion. I do not intend to review all of the new features (which are many).

Note that this post is about the Windows version. I believe many of these issues are not present on a Mac system, but I can't make any assumptions, because I do not own a Mac, nor have I used CS4 on a Mac.

Continue reading this entry ▶


JSFL: Batch Publish Flash Files

This is a script I wrote to batch publish an entire folder of .fla files. The script we use is far longer, as our version is for our courseware folders. In ours, we parse the filename of each to a CSV file with the chapter, section, sub-section, and duration of each .swf.

JSFL rocks.

// pop up a dialog to get the folder, then fetch the files therein
var folder = fl.browseForFolderURL("Choose a folder to publish:");
var files = FLfile.listFolder(folder + "/*.fla", "files");

for (file in files) {
        var curFile = files[file];

        // open document, publish, and close
        fl.openDocument(folder + "/" + curFile);