1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51
|
import flash.display.BitmapData;
var mc:MovieClip = this.createEmptyMovieClip( "coloriageMc", this.getNextHighestDepth() );
var mcLoader:MovieClipLoader = new MovieClipLoader();
mcLoader.addListener(this);
mcLoader.loadClip("http://www.xxxxxx.com/images/2__1__VE__Coloriage-1.gif", mc);
function onLoadInit()
{
var myBitmap:BitmapData = new BitmapData(563, 456,true,0x00FF0000);
myBitmap.draw(mcLoader);
mcLoader.unloadClip();
//mcLoader.removeMovieClip();
mc.attachBitmap( myBitmap, this.getNextHighestDepth() );
mc._x = 350 ;
mc._y = 10 ;
mc.onPress = function()
{
//remplissage
myBitmap.floodFill((_xmouse - 350), (_ymouse -10), color);
}
//swatch pour voir la couleur
var picker:MovieClip = this.createEmptyMovieClip( "colorPickerMc", this.getNextHighestDepth() );
var bmpdPicker:BitmapData = BitmapData.loadBitmap( 'colorPicker' );
picker.attachBitmap( bmpdPicker, this.getNextHighestDepth() );
picker._x = 50 ;
picker._y = 170 ;
picker.onPress = picker.onRelease = function()
{
//sélecteur de couleur
color = bmpdPicker.getPixel32( (_xmouse - 50), (_ymouse - 170)); // = déplacement dans l'espace
//swatch (voir la couleur)
/*bmpdSwatch.fillRect(bmpdSwatch.rectangle, color );
trace(_xmouse)
trace(color);*/
}
//crayon dessus des couleurs
this.attachMovie( "souris","curseur", this.getNextHighestDepth() );
} |