Changeset 193 for trunk

Show
Ignore:
Timestamp:
06/18/08 16:50:51 (5 months ago)
Author:
silver
Message:
 
Location:
trunk/flexbook/chapter9/chapter9_flex
Files:
2 added
2 modified

Legend:

Unmodified
Added
Removed
  • trunk/flexbook/chapter9/chapter9_flex/.settings/org.eclipse.core.resources.prefs

    r189 r193  
    1 #Wed Jun 11 18:11:23 CST 2008 
     1#Wed Jun 18 15:23:24 CST 2008 
    22eclipse.preferences.version=1 
    33encoding/<project>=utf-8 
  • trunk/flexbook/chapter9/chapter9_flex/src/sample2.mxml

    r191 r193  
    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> 
    446</mx:Application>