Changeset 15097
- Timestamp:
- 07/03/08 15:33:30 (3 months ago)
- Location:
- lang/actionscript/FPazzle/trunk/src
- Files:
-
- 4 modified
-
FPazzle.mxml (modified) (3 diffs)
-
net/suztomo/FPazzle/FBoard.as (modified) (1 diff)
-
net/suztomo/FPazzle/FPiece.as (modified) (3 diffs)
-
net/suztomo/FPazzle/RotateController.as (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
lang/actionscript/FPazzle/trunk/src/FPazzle.mxml
r15005 r15097 56 56 57 57 private var board:FBoard; 58 public function init():void {58 public function init():void{ 59 59 flc = new FlickrConnector(); 60 60 Security.loadPolicyFile("http://farm1.static.flickr.com/crossdomain.xml"); … … 83 83 public function onSearch():void 84 84 { 85 searchbox.enabled = false; 85 86 if (keyword.text.length < 3) { 86 87 Alert.show("Please Input 3 or more charactors word", "Too short keyword"); … … 141 142 flc.loadImage(word, 0); 142 143 flc.addEventListener(FlickrConnector.NOT_FOUND, onNotFound); 143 searchbox.enabled = false;144 144 CursorManager.setBusyCursor(); 145 145 } -
lang/actionscript/FPazzle/trunk/src/net/suztomo/FPazzle/FBoard.as
r15005 r15097 60 60 { 61 61 var piece:FPiece = new FPiece(pazzleImage, p_width, p_height, _x_index, _y_index); 62 63 // Rotate for Assignment... I don't like rotation. 64 piece.rotation = Math.floor(Math.random() * 4) * 90; 65 62 66 if (pazzleImage == null) { 63 67 trace("pazzle Image is not setted"); -
lang/actionscript/FPazzle/trunk/src/net/suztomo/FPazzle/FPiece.as
r14992 r15097 24 24 private var idNumber:TextField; 25 25 private var rotateController:RotateController; 26 private var rotateControllers:Array; 26 27 private var toX:Number, toY:Number; 27 28 … … 65 66 addEventListener(MouseEvent.MOUSE_OUT, onOut); 66 67 67 rotateController = new RotateController(this, p_width, p_height); 68 rotateControllers = new Array(); 69 rotateControllers.push(new RotateController(this, p_width, p_height, 0)); 70 rotateControllers.push(new RotateController(this, p_width, p_height, 1)); 71 rotateControllers.push(new RotateController(this, p_width, p_height, 2)); 72 rotateControllers.push(new RotateController(this, p_width, p_height, 3)); 68 73 } 69 74 … … 183 188 public function attachRotateController():void 184 189 { 185 if (!contains(rotateController)) 186 addChild(rotateController); 190 for (var i:int; i<rotateControllers.length; i++) { 191 addChild(rotateControllers[i]); 192 } 187 193 } 188 194 189 195 public function detachRotateController():void 190 196 { 191 if (contains(rotateController)) 192 removeChild(rotateController); 197 for (var i:int; i<rotateControllers.length; i++) { 198 if (contains(rotateControllers[i])) removeChild(rotateControllers[i]); 199 } 193 200 } 194 201 -
lang/actionscript/FPazzle/trunk/src/net/suztomo/FPazzle/RotateController.as
r14949 r15097 4 4 import flash.display.Sprite; 5 5 import flash.events.*; 6 7 import mx.managers.CursorManager; 6 8 7 9 public class RotateController extends Sprite … … 19 21 private var arrow1:RotationArrow; 20 22 private var arrow2:RotationArrow; 23 private var type:int; 24 25 private const ON_OUT_ALPHA:Number = 0.0; 21 26 22 23 public function RotateController(_target:DisplayObject, p_width:Number, p_height:Number) 27 public function RotateController(_target:DisplayObject, p_width:Number, p_height:Number, _type:int = 0) 24 28 { 25 29 super(); 26 30 target = _target; 27 31 init_rot = target.rotation; 32 type = _type; 28 33 //addEventListener(MouseEvent.MOUSE_DOWN, onClick); 29 34 //addEventListener(MouseEvent.MOUSE_UP, onRelese); … … 31 36 //this.x = - target.width / 2; 32 37 //this.y = - target.height / 2; 33 x = + p_width / 2; 34 y = + p_height / 2; 35 38 if (type == 0 || type == 3) { 39 x = + p_width / 2; 40 } else { 41 x = - p_width / 2; 42 } 43 44 if (type == 0 || type == 1) { 45 y = + p_height / 2; 46 } else { 47 y = - p_height / 2; 48 } 49 50 rotation = 90 * type; 51 36 52 graphics.beginFill(0xFFFFFF, 1); 37 53 graphics.drawCircle(0, 0, 20); … … 48 64 addEventListener(MouseEvent.MOUSE_OUT, onOut); 49 65 50 arrow1.addEventListener(MouseEvent. CLICK, rotate90);51 arrow2.addEventListener(MouseEvent. CLICK, rotate270);66 arrow1.addEventListener(MouseEvent.MOUSE_DOWN, rotate90); 67 arrow2.addEventListener(MouseEvent.MOUSE_DOWN, rotate270); 52 68 53 alpha = 0.5;69 alpha = ON_OUT_ALPHA; 54 70 } 55 71 … … 57 73 { 58 74 alpha = 1.0; 75 CursorManager.removeAllCursors(); 76 event.stopPropagation(); 59 77 } 60 78 61 79 private function onOut(e:Event):void 62 80 { 63 alpha = 0.5;81 alpha = ON_OUT_ALPHA; 64 82 } 65 83 … … 81 99 { 82 100 target.rotation += 90; 101 e.stopPropagation(); 83 102 } 84 103 … … 86 105 { 87 106 target.rotation -= 90; 107 e.stopPropagation(); 88 108 } 89 109
![(please configure the [header_logo] section in trac.ini)](/share/chrome/site/your_project_logo.png)