Changeset 3302 for lang/legacy-actionscript/as2draw/AS2Draw.as
- Timestamp:
- 12/19/07 04:35:09 (13 months ago)
- Files:
-
- 1 modified
-
lang/legacy-actionscript/as2draw/AS2Draw.as (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
lang/legacy-actionscript/as2draw/AS2Draw.as
r3301 r3302 4 4 private var mToolPalette:ToolPalette; 5 5 private var mSelectedPenButton:PenButton; 6 private var mSelectedColorButton:ColorButton; 7 public var DEFAULT_COLORS:Array = [0xffffff, 0xdddddd, 0x888888, 0x000000, 0xf04433, 0xffaf98, 0x80c090]; 6 8 7 9 public function AS2Draw(aRoot:MovieClip) 8 10 { 9 mToolPalette = new ToolPalette(aRoot, 480, 24, 0x888888);11 mToolPalette = new ToolPalette(aRoot, 480, 56, 0x888888); 10 12 buildToolPalette(mToolPalette); 11 13 12 mDrawable = new Drawable (aRoot, 0x eeffdd, 480, 200);13 mDrawable.setY( 24);14 mDrawable = new Drawable (aRoot, 0xffffff, 480, 232); 15 mDrawable.setY(56); 14 16 } 15 17 … … 17 19 { 18 20 var _this = this; 19 var closure = function(b){_this.pushedPenButton(b);};20 21 21 var p1:PenButton = new PenButton(3); 22 tp.addButton(p1); 23 p1.afterPush = closure; 22 { 23 var closure = function(b){_this.pushedPenButton(b);}; 24 25 var p1:PenButton = new PenButton(3); 26 tp.addButton(p1); 27 p1.afterPush = closure; 24 28 25 var p2:PenButton = new PenButton(8);26 tp.addButton(p2);27 p2.afterPush = closure;29 var p2:PenButton = new PenButton(8); 30 tp.addButton(p2); 31 p2.afterPush = closure; 28 32 29 var p3:PenButton = new PenButton(16); 30 tp.addButton(p3); 31 p3.afterPush = closure; 33 var p3:PenButton = new PenButton(16); 34 tp.addButton(p3); 35 p3.afterPush = closure; 36 37 pushedPenButton(p1); 38 } 39 40 tp.appendBlank(8); 41 42 { 43 var l = DEFAULT_COLORS.length; 44 var closure = function(b){_this.pushedColorButton(b);}; 45 for (var i:Number = 0;i < l;i++) 46 { 47 var cb:ColorButton = new ColorButton(DEFAULT_COLORS[i]); 48 tp.addButton(cb); 49 50 cb.afterPush = closure; 51 } 52 } 32 53 } 33 54 … … 43 64 } 44 65 66 private function pushedColorButton(aButton:ColorButton) 67 { 68 if (mSelectedColorButton) 69 { 70 mSelectedColorButton.setSelected(false); 71 } 72 73 mSelectedColorButton = aButton; 74 mSelectedColorButton.setSelected(true); 75 } 76 45 77 static function main() 46 78 {
![(please configure the [header_logo] section in trac.ini)](/share/chrome/site/your_project_logo.png)