Changeset 7052
- Timestamp:
- 02/23/08 03:49:15 (5 years ago)
- Location:
- lang/actionscript/metro-map
- Files:
-
- 1 added
- 3 modified
-
ArrowSprite.as (added)
-
FadeController.as (modified) (1 diff)
-
SpritePool.as (modified) (1 diff)
-
Viewer.as (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
-
lang/actionscript/metro-map/FadeController.as
r7049 r7052 56 56 57 57 mTarget.alpha = Number(t) / Number(mDivs); 58 mTarget.visible = (mTarget.alpha > 0.1); 58 59 } 59 60 } -
lang/actionscript/metro-map/SpritePool.as
r7032 r7052 16 16 s.visible = false; 17 17 mPool.push(s); 18 } 19 20 public function getAt(i:int):Sprite 21 { 22 return mPool[i]; 18 23 } 19 24 -
lang/actionscript/metro-map/Viewer.as
r7049 r7052 83 83 mTextInput.width = 200; 84 84 mTextInput.addEventListener(Event.CHANGE, onSearchBoxChanged); 85 mTextInput.addEventListener(KeyboardEvent.KEY_DOWN, onSearchBoxKeyDown);85 addEventListener(KeyboardEvent.KEY_DOWN, onSearchBoxKeyDown); 86 86 87 87 mCanvas = new MCanvas(900, 500, false, false); … … 126 126 private function onArrowClick(e:MouseEvent):void 127 127 { 128 128 if (e.target is ArrowSprite) 129 { 130 mSelectedStation = StationData(ArrowSprite(e.target).userObject); 131 highlightStationList([mSelectedStation]); 132 } 129 133 } 130 134 … … 215 219 private function onSearchBoxKeyDown(e:KeyboardEvent):void 216 220 { 217 mSelectedStation = null;218 221 if (e.keyCode == 27) 219 222 { … … 228 231 private function onSearchBoxChanged(e:Event):void 229 232 { 233 mSelectedStation = null; 230 234 mOut.text = ""; 231 235 var res:Array = mSearch.search(romkan.to_kana(mTextInput.text)); … … 254 258 { 255 259 var poslist:Array = null; 260 var highlighted_list:Array = null; 256 261 257 262 if (stations != null) … … 260 265 261 266 if (stations.length <= 10) 267 { 262 268 poslist = []; 269 highlighted_list = []; 270 } 263 271 } 264 272 else … … 287 295 poslist.push(label.x); 288 296 poslist.push(label.y + label.top); 297 highlighted_list.push(toHighlight[label.title]); 289 298 } 290 299 label.transform.colorTransform = mNoTransform; … … 318 327 319 328 mArrowPool.show_bulk(poslist); 329 if (highlighted_list) 330 for (var i:int = 0;i < highlighted_list.length;i++) 331 ArrowSprite(mArrowPool.getAt(i)).userObject = highlighted_list[i]; 320 332 } 321 333 322 334 private function makeArrowSprite():Sprite 323 335 { 324 var s:Sprite = new Sprite();336 var s:Sprite = new ArrowSprite(); 325 337 var g:Graphics = s.graphics; 326 338
![(please configure the [header_logo] section in trac.ini)](/share/chrome/site/your_project_logo.png)