A practical application of the BitmapData class
The BitmapData class has been introduced in Flash 8 to give us pixel-level control of bitmap object. With the BitmapData class comes a fair amount of methods and properties that you can discover in the Flash 8 manual. But for now, and as a gentle introduction, I would like to show you how we can use the BitmapData class in a practical and simple way to approach the concept of color picking just using a couple of methods and very little code. First let's have a look at the final version below.
The code
Let's have a look at the code below, roll over the
import flash.display.BitmapData; mc = this.createEmptyMovieClip("mc", 0); selectedColor.swapDepths(_root.getNextHighestDepth()); onMouseMove = function(){ |
This little example just give you a little glimpse of the possibilities offered by the BitmapData class but hopefully you will find it useful if you are looking for that particular type of method to retrieve a color code from a picture.
Good Luck :)