Changeset 14400 for lang/actionscript
- Timestamp:
- 06/22/08 08:22:01 (5 years ago)
- Location:
- lang/actionscript/FPazzle/trunk/src
- Files:
-
- 4 modified
-
FPazzle.mxml (modified) (3 diffs)
-
net/suztomo/FPazzle/FBoard.as (modified) (2 diffs)
-
net/suztomo/FPazzle/FPieceGroup.as (modified) (3 diffs)
-
net/suztomo/FPazzle/FlickrConnector.as (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
lang/actionscript/FPazzle/trunk/src/FPazzle.mxml
r14387 r14400 33 33 public function init():void { 34 34 flc = new FlickrConnector(); 35 setChildIndex(searchbox, numChildren-1);36 37 35 Security.loadPolicyFile("http://farm1.static.flickr.com/crossdomain.xml"); 38 36 Security.loadPolicyFile("http://farm2.static.flickr.com/crossdomain.xml"); … … 52 50 flc.setOnComplete(onFlickrImageComplete); 53 51 flc.loadImage(word, 0); 52 flc.addEventListener(FlickrConnector.NOT_FOUND, onNotFound); 54 53 searchbox.enabled = false; 55 54 CursorManager.setBusyCursor(); … … 71 70 searchbox.enabled = true; 72 71 board.showPhotoInfo(); 72 } 73 74 private function onNotFound(event:Event):void 75 { 76 Alert.show("No photo found by the keyword", "Photo Not Found"); 77 searchbox.enabled = true; 78 CursorManager.removeBusyCursor(); 73 79 } 74 80 -
lang/actionscript/FPazzle/trunk/src/net/suztomo/FPazzle/FBoard.as
r14396 r14400 6 6 import flash.events.Event; 7 7 import flash.events.EventDispatcher; 8 import flash.events.MouseEvent; 8 9 9 10 import mx.containers.Panel; … … 153 154 pieces.getInline(i).deactivate(); 154 155 } 156 157 for (i=0; i<groups.length; i++) { 158 (groups[i] as FPieceGroup).deactivate(); 159 } 155 160 } 156 161 -
lang/actionscript/FPazzle/trunk/src/net/suztomo/FPazzle/FPieceGroup.as
r14398 r14400 27 27 handle = new Sprite; 28 28 handle.graphics.beginFill(0x222222, 1); 29 handle.graphics.drawCircle(0, 0, 20);30 handle.alpha = 0. 4;29 handle.graphics.drawCircle(0, 0, 30); 30 handle.alpha = 0.0; 31 31 addChild(handle); 32 32 initHandleListener(); … … 120 120 { 121 121 if (pieces.length > 1) handle.alpha = 1; 122 e.stopPropagation(); 122 123 } 123 124 124 125 private function handleDisappear(e:Event):void 125 126 { 126 handle.alpha = 0.5; 127 handle.alpha = 0.0; 128 e.stopPropagation(); 127 129 } 128 130 … … 195 197 } 196 198 } 197 199 200 public function deactivate():void 201 { 202 handle.removeEventListener(MouseEvent.MOUSE_OVER, handleAppear); 203 handle.removeEventListener(MouseEvent.MOUSE_OUT, handleDisappear); 204 handle.removeEventListener(MouseEvent.MOUSE_DOWN, startDragGroup); 205 handle.removeEventListener(MouseEvent.MOUSE_UP, stopDragGroup); 206 } 198 207 } 199 208 } -
lang/actionscript/FPazzle/trunk/src/net/suztomo/FPazzle/FlickrConnector.as
r14397 r14400 5 5 import com.adobe.webapis.flickr.methodgroups.*; 6 6 7 import flash.display. Loader;7 import flash.display.*; 8 8 import flash.events.Event; 9 import flash.events.EventDispatcher; 10 import flash.events.IEventDispatcher; 9 11 import flash.net.URLRequest; 10 12 import flash.system.*; 11 13 12 14 import mx.controls.*; 13 15 import mx.core.*; 14 16 public class FlickrConnector 15 17 { … … 25 27 private var keywordCounter:Object; 26 28 private var keyword:String; 29 private var eventDispatcher:EventDispatcher; 30 27 31 public var tmpPhoto:Photo; 32 33 public static var NOT_FOUND:String = "searchNotFound"; 28 34 29 35 public function FlickrConnector() … … 34 40 keywords = new Array(); 35 41 keywordCounter = new Object(); 42 eventDispatcher = new EventDispatcher(); 36 43 } 37 44 … … 65 72 66 73 if (p == null) { 67 Alert.show("No photo found by the keyword : "+keywords[keywords.length-1]);68 74 keywords.pop(); 75 eventDispatcher.dispatchEvent(new Event(FlickrConnector.NOT_FOUND)); 69 76 } else { 70 77 req = new URLRequest(urls[req_index]); … … 92 99 { 93 100 } 101 102 // Event Listeners 103 public function addEventListener(type:String, listener:Function, useCapture:Boolean = false, priority:int = 0, useWeakReference:Boolean = false):void 104 { 105 eventDispatcher.addEventListener(type, listener, useCapture, priority, useWeakReference); 106 } 107 108 public function removeEventListener(type:String, listener:Function, useCapture:Boolean=false):void 109 { 110 eventDispatcher.removeEventListener(type, listener, useCapture); 111 } 112 113 public function hasEventListener(type:String):Boolean 114 { 115 return eventDispatcher.hasEventListener(type); 116 } 117 118 public function willTrigger(type:String):Boolean 119 { 120 return eventDispatcher.willTrigger(type); 121 } 122 123 public function dispatchEvent(event:Event):Boolean 124 { 125 return eventDispatcher.dispatchEvent(event); 126 } 94 127 } 95 128 }
![(please configure the [header_logo] section in trac.ini)](/share/chrome/site/your_project_logo.png)