ForceSmoothing in ActionScript 2
I’m working on this project where I need to import images listed in a XML file into the application. Each image goes through a series of size variations depending on where you are in the application. Now they could have shot for me to use but to save on cost, I’m working with one larger image and scaling it as need be. So if you have worked with Flash before and have scaled images down, you’ll know that the image don’t render all that nice. Especially when the images have patterns and colors all over the place.
To get around the rending issue when you drop an image on the stage I could set “Allow smoothing” in the properties menu of the image within the flash library. but since these image are dynamic, that won’t work.
Flash has the ability to smooth images that are loaded via loadMovie by using “forceSmoothing” but from what I have seen online, many people don’t see a difference when using it.
After messing around with it, I did manage to get it to work.
First I tried to apply forceSmoothing to the clip from my actions layer.
emptyClip.forceSmoothing = true
this failed!
I had to place the code on the movieClip itself, something I try not do ever but for this project, it worked but was not 100%.
onClipEvent (load) {
this.forceSmoothing = true;
}
To reach the goal I had to add “_quality = “BEST”;” to the mix.
_quality = “BEST”;
This told the flash to render the movie at a higher quality than the default rendering setting. I did test this to see if it would work without the onClipEvent and it failed.
So in conclusion, in order to have larger images scaled down render smoothly, you will need to use “forceSmoothing” and “_quality = “BEST”" together.
YAY!!! No more ugly looking images and the client doesn’t have to go spend more money on photo shoots!
About this entry
You’re currently reading “ForceSmoothing in ActionScript 2,” an entry on homer gaines
- Published:
- 08.29.08 / 5pm
- Category:
- ActionScript 2.0, Resources
No comments
Jump to comment form | comments rss [?] | trackback uri [?]