I would put a variable in _root that contains the currently selected color and the desired alpha:
var currentColor:Number = 0x000000;
var currentAlpha:Number = 0;
Then I would put onRelease event handlers on the paint chips movieclips like this:
redpainchip.onRelease = function(){
currentColor = 0xFF0000;
}
Now you just need a wall to "Paint the walls". If you are publishing the swf for Flash 8 you can use a "Color" filter, otherwise you can use the drawing API in Actionscript:
partOfTheWall.onRelease = function(){
if(this.wall != undefined) this.wall.destroyMovieClip
var wall:MovieClip = this.createEmptyMovieClip(
wall.beginFill (_root.currentColor, _root.currentAlpha);
wall.lineStyle (0, 0x000000, 0);
wall.moveTo (this._x,this._y);
wall.lineTo (this._x+this._width, this._y);
wall.lineTo (this._x+this._width, this._y+this._height);
wall.lineTo (this._x, this._y+this._height);
wall.endFill();
}
This should get you started - let me know if you need more help! I need to get my expert status back :D
Main Topics
Browse All Topics





by: plundquistPosted on 2006-09-24 at 13:25:54ID: 17588184
Oh, I forgot to say that if it is easier to do, I would also be inclined to use a "click the color, click the spot" approach instead of drag and drop. I am open to suggestions on which is easier/better. Thanks!