Thursday, February 26, 2009

Fullscreen Flash Flickering

Something's been bugging me ever since I made a Flash site go completely 100% browser window. In Internet Explorer, when I would resize the site, the browser window's content would flicker black all the way from full size to as small as I could make the window. The site was more than usable, but the flickering was enough to annoy the hell out of me, and make me wonder if someone was going to call me out on it. I checked through all of my Flash code and I couldn't figure it out. You could still hear the site, but not see it, nor were any of the buttons clickable. Resize a little more, the site comes right back. Resize as small as the window goes? Gone again. I swore it had something to do with my full Flash black fade, but I removed that layer and it persisted.

This only happened in IE, so it made me wonder if it was an HTML issue.

Anyway, the short of it, I added two lines to my body CSS (which are also in my HTML CSS):

height:100%
width:100%

The flickering is gone. Whew.

I could sit here and tell you that it has something to do with the way that Internet Explorer renders its viewport, that the body is really just another container within your HTML hierarchy, so making sure both your body and HTML CSS have these percentage values..blah blah..blah....

But then I'd be making things up. I really have no clue.

Saturday, February 21, 2009

"Allow Smoothing" on all bitmaps in library

http://mrsteel.wordpress.com/2007/06/12/flash-jsfl-script-allow-smoothing-on-all-bitmaps-in-library/

The JSFL file located at the above link lets you enable "allow smoothing" on all of the bitmaps in your Flash library. You can also adjust it to make all your bitmaps lossless, or jpeg, or whatever you need. This probably saved me an hour.

Update:
This code is awesome, but be aware exactly what it does.

Here's the code:

var libItems = fl.getDocumentDOM().library.items;
for (i = 0; i < libItems.length; i++){
if(libItems[i].itemType == “bitmap”){
libItems[i].allowSmoothing = true;
libItems[i].compressionType = “lossless”;
}
}

With this line in place, it adjusted the compression on all of my objects to "lossless". Meaning my site went from 1.5 megs to 4.5 megs!! Lossless is great, but expensive, and on some objects, it just doesn't make sense.

I got the site back down to 2.5 megs so far (and falling!)