| 1 | | <?xml version="1.0" encoding="utf-8"?> |
| 2 | | <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute"> |
| 3 | | |
| | 1 | <?xml version="1.0"?> |
| | 2 | <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" |
| | 3 | creationComplete="initVars()" fontSize="20"> |
| | 4 | <mx:Script> |
| | 5 | <![CDATA[ |
| | 6 | |
| | 7 | //声明变量 |
| | 8 | [Bindable] |
| | 9 | private var restaurantName:String; |
| | 10 | //纬度 latitude |
| | 11 | [Bindable] |
| | 12 | private var lat:Number=0; |
| | 13 | //经度 longitude |
| | 14 | [Bindable] |
| | 15 | private var lng:Number=0; |
| | 16 | |
| | 17 | // Assign values to new properties. |
| | 18 | private function initVars():void { |
| | 19 | restaurantName = Application.application.parameters.restaurantName; |
| | 20 | lat = Application.application.parameters.lat; |
| | 21 | lng = Application.application.parameters.lng; |
| | 22 | if(isNaN(lat)){ |
| | 23 | lat = 0; |
| | 24 | } |
| | 25 | if(isNaN(lng)){ |
| | 26 | lng = 0; |
| | 27 | } |
| | 28 | } |
| | 29 | ]]> |
| | 30 | </mx:Script> |
| | 31 | |
| | 32 | <mx:VBox> |
| | 33 | <mx:HBox> |
| | 34 | <mx:Label text="餐馆名: "/> |
| | 35 | <mx:Label text="{restaurantName}" fontWeight="bold"/> |
| | 36 | </mx:HBox> |
| | 37 | <mx:HBox> |
| | 38 | <mx:Label text="经度: "/> |
| | 39 | <mx:Label text="{lng}" fontWeight="bold"/> |
| | 40 | </mx:HBox> |
| | 41 | <mx:HBox> |
| | 42 | <mx:Label text="纬度: "/> |
| | 43 | <mx:Label text="{lat}" fontWeight="bold"/> |
| | 44 | </mx:HBox> |
| | 45 | </mx:VBox> |