A common oversight in Flash projects, when using a Bitmap with loaded content is that Flash will revert a Bitmap’s smoothing parameter to false when you replace its bitmapData. That is, when the data loads into the Bitmap, anti-aliasing will get turned off. This is simple enough to fix, but since you may not know if someone is going to replace the bitmapData of a Bitmap you have created – then it’s much better to code defensively for it.
This little SmoothBitmap class is for just such an occasion. Instantiate it like a regular Bitmap and, no matter what another developer does with it, smooth, anti aliased pixels when scaling/rotating will be ensured. Enjoy 🙂
Winning two DMA awards back in 2009, I thought I’d give a quick insight into how the animation effects in this piece were achieved. Continue reading Lurpak Breakfast – Behind the screens
If you’re still churning out Flash banners, please use this!
I created this simple utility, called SWFIdle, to enable the Flash Player to lower its CPU usage while the user is not interacting with it. Since it’s possible to have multiple Flash instances embedded in one page (for example, a game and a couple of banners), I recommend using this in your projects, so that Flash instances needn’t fight for CPU and give Flash a worse name than it has already 😉
I know there’s the hasPriority embed attribute now. But:
- That assumes you have access to the HTML that embeds your SWF
- If no other players are present, it has no effect
- There’s still usually little reason to be running your SWF at a high framerate if the user isn’t interacting with it
- Flash banners with wastefully unoptimised drawing routines are probably one of the key reasons that Flash got poo-pooed off of mobile platforms and disabled on everyone’s laptops – CPU usage = battery usage!
At the risk of getting sucked into the Apple vs Adobe shitstorm, my own response to Apple chosing to block Flash content from their mobile devices is to at least tell users why – because Apple left it at the rather obscure blue lego block, with no explanation (great experiential design guys). Simply include this code in your page/s to redirect mobile safari users to a page of your chosing …I direct them here.
I’ve seen a few people get into a pickle over this one. When you’re developing and testing locally, you need to set the ‘Local Playback Security’ setting (sometimes referred to as the ‘use network services’ option) depending on whether you wish to access local external files (e.g. XML files, or images) or some other server (e.g. your dev backend server). You can’t access both from a locally running SWF anymore, since it’s a security risk. So here’s how to set that option in Flash CS3 / CS4 or from within FlashDevelop.
I cobbled this Webcam effect together for no other reason than creative curiosity – a digital hall of mirrors thing, I suppose. Best viewed on your laptop, since it requires Flash and a Webcam…
And for the techies, here’s the source code (zipped FLA).