PaperVision 3D 로 만든 SOAP 연동 3D Map

1.Main.mxml

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" xmlns:local="*" creationComplete="init()" width="669" height="519">
 <mx:states>
  <mx:State name="Loading">
   <mx:AddChild relativeTo="{MainCanvas}" position="lastChild">
    <mx:Canvas x="165.5" y="228" width="338" height="86" backgroundColor="#FFFFFF" backgroundAlpha="0.4">
     <mx:SWFLoader x="19" y="25" source="http://.../assets/loading.swf"/>
    </mx:Canvas>
   </mx:AddChild>
  </mx:State>
 </mx:states>
 <mx:Script>
  <![CDATA[
   import mx.controls.SWFLoader;
   import org.papervision3d.materials.utils.MaterialsList;
   import mx.core.UIComponent;
   import mx.controls.Alert;
   import mx.collections.ArrayCollection;
   import mx.rpc.events.*;
   import mx.rpc.soap.*;
   import mx.utils.ArrayUtil;
 
   import org.papervision3d.cameras.Camera3D;
   import org.papervision3d.core.geom.Lines3D;
   import org.papervision3d.core.geom.renderables.Line3D;
   import org.papervision3d.core.geom.renderables.Vertex3D;
   import org.papervision3d.events.InteractiveScene3DEvent;
   import org.papervision3d.materials.BitmapFileMaterial;
   import org.papervision3d.materials.special.LineMaterial;
   import org.papervision3d.objects.DisplayObject3D;
   import org.papervision3d.objects.primitives.Plane;
   import org.papervision3d.view.BasicView;
   
   import mx.managers.CursorManager;
 
   var m:Main;
   var ServerURL:String = "http://.../axis/";
   var StationArr:Array = new Array();
   var BusArr:Array = new Array();
   var BusCode:String = "";
   var BusType:String = "";
   var Buslines3D:Lines3D;
   var nCode:Number;
   var PosXMIN:Number = 0;
   var PosYMIN:Number = 0;
  
   public function init():void
   {
    CursorManager.setBusyCursor();
    
    m = new Main();
    var tUI:UIComponent = new UIComponent();
    tUI.addChild(m);
    m.compo.camera.zoom = 16;
    
    MainCanvas.addChildAt(tUI,0);
    MainCanvas.addEventListener(MouseEvent.MOUSE_WHEEL,onMouseWheel);
    MainCanvas.addEventListener(MouseEvent.MOUSE_DOWN, onMouseDown);  
             MainCanvas.addEventListener(MouseEvent.MOUSE_UP, onMouseUp);
             
             m.compo.viewport.containerSprite.x = 1000;
             PosXMIN = 177371 + 22000;
    PosYMIN = 468477 - 20000;
   
             BusCode = ExternalInterface.call("call");
             //Test용
             //BusCode = '3014000|0';
             //Test용
             var tArr:Array = BusCode.split("|");
             BusCode = tArr[0];
    BusType = tArr[1];
    
    if (BusCode != null && BusCode != '')
    {
     getBusData(BusCode);
       }
       else
       {
        CursorManager.removeBusyCursor();
       }
   }
   
   public function getBusData(Code:String):void
      {
       currentState = 'Loading';
       nCode = Number(Code);
       getBusLineDataByBusCode(nCode);
      }
      private function faultevent(e:FaultEvent):void
   {
    //Alert.show(e.message.toString());
   }
   /*Common Function*/
   /*Communication*/
   public function getBusStopDataByBusCode(BusCode:Number):void
   {
    var gateway:WebService = new WebService();
    
    gateway.wsdl = ServerURL + "Soap_RtofStn_Qry.jws?wsdl";
     gateway.loadWSDL();
     gateway.getRtofStnQry.addEventListener(ResultEvent.RESULT, getRtofStnQry_Result);
     gateway.addEventListener(FaultEvent.FAULT, faultevent);
    gateway.getRtofStnQry("",BusCode);
   }
   public function getBusLineDataByBusCode(BusCode:Number):void
   {
    var gateway:WebService = new WebService();
    
    gateway.wsdl = ServerURL + "Soap_RtofPline_Qry.jws?wsdl";
     gateway.loadWSDL();
     gateway.getRtofPlineQry.addEventListener(ResultEvent.RESULT, getRtofPlineQry_Result);
     gateway.addEventListener(FaultEvent.FAULT, faultevent);
    gateway.getRtofPlineQry("",BusCode);
   }
   public function getBusLocationDataByBusCode(BusCode:Number):void
   {
    var gateway:WebService = new WebService();
    
    gateway.wsdl = ServerURL + "Soap_BusLoct_Qry.jws?wsdl";
     gateway.loadWSDL();
     gateway.getBusLoctQry.addEventListener(ResultEvent.RESULT, getBusLoctQry_Result);
     gateway.addEventListener(FaultEvent.FAULT, faultevent);
    gateway.getBusLoctQry("",BusCode);
   }
   public function getInfoStation(routeid:String,ord:String,uniqueId:String):void
   {
    var gateway:WebService = new WebService();
    
    gateway.wsdl = ServerURL + "Soap_StnArr_Qry.jws?wsdl";
     gateway.loadWSDL();
     
     /*
     gateway.getStnArrQry.addEventListener(ResultEvent.RESULT, getInfoStation_Result);
     gateway.addEventListener(FaultEvent.FAULT, faultevent);
    gateway.getStnArrQry("",routeid,ord);
    */
    gateway.getStnArrQry.addEventListener(ResultEvent.RESULT, getInfoStation_Result);
     gateway.addEventListener(FaultEvent.FAULT, faultevent);
    gateway.getStnArrQry("",routeid,ord);
   }
   public function getInfoBus(busid:String):void
   {
    var gateway:WebService = new WebService();
    
    gateway.wsdl = ServerURL + "Soap_BusElsp_Qry.jws?wsdl";
     gateway.loadWSDL();
     
     gateway.getBusElspQry.addEventListener(ResultEvent.RESULT, getInfoBus_Result);
     gateway.addEventListener(FaultEvent.FAULT, faultevent);
    gateway.getBusElspQry("",busid);
   }
   
   var MsgString:String;
   import mx.controls.Alert;
   private function getInfoStation_Result(e:ResultEvent):void
   {
    try
    {
     var table:ArrayCollection;
     var recordAC:ArrayCollection;
     recordAC = (e.result.DATA is ArrayCollection) ?     e.result.DATA as ArrayCollection :     new ArrayCollection(ArrayUtil.toArray(e.result.DATA));
     
     
     MsgString = recordAC[0][0].STNAME + " (" + tUniqueId +")\n" + recordAC[0][0].ROUTENAME + "번 " + recordAC[0][0].STNAME +"\n";
     
     if (recordAC[0][0].LEFT != '' && recordAC[0][0].LEFT != null)
     {
      if (recordAC[0][0].LEFT == "0" || recordAC[0][0].LEFT == "1")
      {
       MsgString = MsgString + "첫번째 버스 전 정류소 ["+recordAC[0][0].STNAME1 +"]앞을 출발하였습니다.\n";
      }
      else
      {
       MsgString = MsgString + "첫번째 버스 "+recordAC[0][0].LEFT+"번째 전 정류소 ["+recordAC[0][0].STNAME1+"] "+recordAC[0][0].TRAVELTIME+"분후 도착예정\n";
      }
     }
     
     if (recordAC[0][0].LEFT2 != '' && recordAC[0][0].LEFT2 != null)
     {
      if (recordAC[0][0].LEFT2 == "0" || recordAC[0][0].LEFT2 == "1")
      {
       MsgString = MsgString + "두번째 버스 전 정류소 ["+recordAC[0][0].STNAME2 +"]앞을 출발하였습니다.\n";
      }
      else
      {
       MsgString = MsgString + "첫번째 버스 "+recordAC[0][0].LEFT2+"번째 전 정류소 ["+recordAC[0][0].STNAME2+"] "+recordAC[0][0].TRAVELTIME2+"분후 도착예정\n";
      }
     }
     MsgString = MsgString + "막차시간 : "+recordAC[0][0].LASTTIME+"\n";
     
     var gateway:WebService = new WebService();
     
     gateway.wsdl = ServerURL + "Soap_StnofRt_Qry.jws?wsdl";
      gateway.loadWSDL();
      
      gateway.getStnofRtQry.addEventListener(ResultEvent.RESULT, getInfoStationLast_Result);
      gateway.addEventListener(FaultEvent.FAULT, faultevent);
     gateway.getStnofRtQry("",tUniqueId);
     
    }catch(e:Error){}
   }
   var InfoStr:String = "";
   private function getInfoStationLast_Result(e:ResultEvent):void
   {
    try
    {
     var table:ArrayCollection;
     var recordAC:ArrayCollection;
     recordAC = (e.result.DATA is ArrayCollection) ?     e.result.DATA as ArrayCollection :     new ArrayCollection(ArrayUtil.toArray(e.result.DATA));
     
     IdPopupCanvas.visible = true;
     /*
     if (this.mouseX - 80>0)
     {IdPopupCanvas.x = this.mouseX - 80;}
     else
     {IdPopupCanvas.x = 0;}
     
     if (this.mouseY - 160>0)
     {IdPopupCanvas.y = this.mouseY - 160;}
     else
     {IdPopupCanvas.y = 0;}
     */
     MsgString += "경유노선 : " + recordAC[0][0].ROUTENAME;
     //IdPopupCanvas.x = 250;
     //IdPopupCanvas.y = 100;
     IdPopupText.text = MsgString;
    }
    catch(e:Error){}
   }
   
   private function getInfoBus_Result(e:ResultEvent):void
   {
    try
    {
     var table:ArrayCollection;
     var recordAC:ArrayCollection;
     recordAC = (e.result.DATA is ArrayCollection) ?     e.result.DATA as ArrayCollection :     new ArrayCollection(ArrayUtil.toArray(e.result.DATA));
     
     IdPopupCanvas.visible = true;
     /*
     if (this.mouseX - 80>0)
     {IdPopupCanvas.x = this.mouseX - 80;}
     else
     {IdPopupCanvas.x = 0;}
     
     if (this.mouseY - 160>0)
     {IdPopupCanvas.y = this.mouseY - 160;}
     else
     {IdPopupCanvas.y = 0;}
     */
     //IdPopupCanvas.x = 250;
     //IdPopupCanvas.y = 100;
     
     IdPopupText.text = "다음정류소 : 약 " + recordAC[0][0].MAINARRTM + "분 후 도착예정\n종점도착 : 약 " + recordAC[0][0].ENDARRTM + "분 후 도착예정\n진행방향 : "+recordAC[0][0].ARSMENT;
    }
    catch(e:Error){}
   }
   private function getRtofStnQry_Result(e:ResultEvent):void
   {
    var table:ArrayCollection;
    var recordAC:ArrayCollection;
    recordAC = (e.result.DATA is ArrayCollection) ?     e.result.DATA as ArrayCollection :     new ArrayCollection(ArrayUtil.toArray(e.result.DATA));
    
    try
    {
     for (var i:Number=0; i<10000;i++)
     {
      var ObjR:Object = new Object();
      ObjR.ALIASNM = recordAC[0][i].ALIASNM;
      ObjR.ARSMENT = recordAC[0][i].ARSMENT;
      ObjR.DOWNX = recordAC[0][i].DOWNX;
      ObjR.DOWNY = recordAC[0][i].DOWNY;
      ObjR.ORD = recordAC[0][i].ORD;
      ObjR.ROUTEID = recordAC[0][i].ROUTEID;
      ObjR.ROUTEKIND = recordAC[0][i].ROUTEKIND;
      ObjR.SECTIONID = recordAC[0][i].SECTIONID;
      ObjR.STATIONID = recordAC[0][i].STATIONID;
      ObjR.STATIONNAME = recordAC[0][i].STATIONNAME;
      ObjR.TRNYN = recordAC[0][i].TRNYN;
      ObjR.X = Number(recordAC[0][i].X);
      ObjR.Y = Number(recordAC[0][i].Y);
      ObjR.UNIQUEID = Number(recordAC[0][i].UNIQUEID);
      StationArr.push(ObjR);
     }
    }
    catch(e:Error)
    {}
    
    drawStation();
    
     getBusLocationDataByBusCode(nCode);
   }
   /*Communication*/
   /*Communication Result*/
   var planeGroupBus:DisplayObject3D;
   
   import org.papervision3d.objects.primitives.Cube;
   import org.papervision3d.materials.MovieMaterial;
   public function drawBus():void
   {
    
    planeGroupBus = new DisplayObject3D();
    planeGroupBus.name = "Bus";
    //BusUnique,tUniqueId
    for (var i:Number=0;i<BusArr.length;i++)
    {
     var PosX:Number = (BusArr[i].MATCH_X - PosXMIN)/10;
        var PosY:Number = (BusArr[i].MATCH_Y - PosYMIN)/10;
        
        //var material:BitmapFileMaterial = new BitmapFileMaterial( "http://.../assets/bus_b.png" );        
        var mc:MovieClip;
        mc = bus.content as MovieClip;
        
        var material:MovieMaterial = new MovieMaterial(bus,false,false);
        material.fillColor = 0xF4F4F4;
        material.smooth = true;
        material.fillAlpha = 0;
        material.doubleSided = true;
     material.animated = true;
     material.interactive = true;
/*
     material.doubleSided = true;
     material.smooth = true;
     material.lineAlpha = 0;
     material.lineColor = 0xFFFFFF;
     material.interactive = true;
*/
     
        /*
     var material_f:BitmapFileMaterial = new BitmapFileMaterial( "http://210.96.13.90/.../bus_b_f.png" );
     material_f.doubleSided = true;
     material_f.smooth = true;
     material_f.lineAlpha = 0;
     material_f.lineColor = 0xFFFFFF;
     material_f.interactive = true;
     
     var material_t:BitmapFileMaterial = new BitmapFileMaterial( "http://.../assets/bus_b_t.png" );
     material_t.doubleSided = true;
     material_t.smooth = true;
     material_t.lineAlpha = 0;
     material_t.lineColor = 0xFFFFFF;
     material_t.interactive = true;
     
     var material_b:BitmapFileMaterial = new BitmapFileMaterial( "http://.../assets/bus_b_b.png" );
     material_b.doubleSided = true;
     material_b.smooth = true;
     material_b.lineAlpha = 0;
     material_b.lineColor = 0xFFFFFF;
     material_b.interactive = true;
     
     var material_s:BitmapFileMaterial = new BitmapFileMaterial( "http://.../assets/bus_b_s.png" );
     material_s.doubleSided = true;
     material_s.smooth = true;
     material_s.lineAlpha = 0;
     material_s.lineColor = 0xFFFFFF;
     material_s.interactive = true;
     
     
     var materialsList:MaterialsList = new MaterialsList();
                 materialsList.addMaterial( material_t, "front" );
                 materialsList.addMaterial( material_t, "back" );
                 materialsList.addMaterial( material_s, "left" );
                 materialsList.addMaterial( material_s, "right" );
                 materialsList.addMaterial( material_b, "top" );
                 materialsList.addMaterial( material_f, "bottom" );
*/
     //create plane
     /*if (BusUnique != "" && BusUnique == BusArr[i].BUSID.toString())
     {
      tObjW = 60 * (100/m.compo.camera.zoom);
      tObjH = 60 * (100/m.compo.camera.zoom);
     }
     else
     {*/
     tObjW = 30 * (100/m.compo.camera.zoom);
     tObjH = 30 * (100/m.compo.camera.zoom);
     //}
     
     /*******3D Version********/
     /*
     var cube:Cube =new  Cube(materialsList, tObjW, tObjH, tObjH, 3, 3, 3);
     cube.x = PosX - m.compo.moveX;
     cube.y = PosY + m.compo.moveY;
     cube.rotationX = m.compo.camera.x;
     cube.rotationY = m.compo.camera.y;
     cube.name = BusArr[i].BUSID + "_" + PosX.toString() + "_" + PosY.toString() ;
     
     cube.addEventListener(InteractiveScene3DEvent.OBJECT_CLICK, bus_press);
     planeGroupBus.addChild(cube);
     */
     /*******3D Version********/
     
     var plane:Plane = new Plane( material, tObjW, tObjH, 1, 1);
     plane.x = PosX - m.compo.moveX;
     plane.y = PosY + m.compo.moveY;
     plane.name = BusArr[i].BUSID + "_" + PosX.toString() + "_" + PosY.toString() ;
     
     plane.addEventListener(InteractiveScene3DEvent.OBJECT_CLICK, bus_press);
     planeGroupBus.addChild(plane);
     
     
     }
     BusUnique = "";
     m.compo.scene.addChild( planeGroupBus );
   }
   var planeGroup:DisplayObject3D;
   public function drawStation():void
   {
    planeGroup = new DisplayObject3D();
    planeGroup.name = "Station";
    
    for (var i:Number=0;i<StationArr.length;i++)
    {
     var PosX:Number = (StationArr[i].X - PosXMIN)/10;
        var PosY:Number = (StationArr[i].Y - PosYMIN)/10;

     var mc:MovieClip;
        mc = station.content as MovieClip;
        
        var material:MovieMaterial = new MovieMaterial(station,false,false);
        material.fillColor = 0xF4F4F4;
        material.smooth = true;
        material.fillAlpha = 0;
        material.doubleSided = true;
     material.animated = true;
     material.interactive = true;
/*        
     var material:BitmapFileMaterial = new BitmapFileMaterial("http://.../assets/bus-stop.png" );
     material.doubleSided = true;
     material.smooth = true;
     material.lineAlpha = 0.1;
     material.lineColor = 0xFFFFFF;
     material.interactive = true;
*/     
     /*
     if (tUniqueId != "" && tUniqueId == StationArr[i].UNIQUEID.toString())
     {
      tObjW = 84 * (100/m.compo.camera.zoom);
      tObjH = 84 * (100/m.compo.camera.zoom);
     }
     else
     {*/
      tObjW = 42 * (100/m.compo.camera.zoom);
      tObjH = 42 * (100/m.compo.camera.zoom);
     //}
     
     var plane:Plane = new Plane( material, tObjW, tObjH, 1, 1);
     plane.x = PosX - m.compo.moveX;
     plane.y = PosY + m.compo.moveY; 
     plane.name = StationArr[i].ROUTEID + "_" + StationArr[i].ORD + "_" + StationArr[i].UNIQUEID + "_" + PosX.toString() + "_" + PosY.toString() ;;
     
     plane.addEventListener(InteractiveScene3DEvent.OBJECT_CLICK, stop_press);
     
     planeGroup.addChild(plane);
     }
     tUniqueId = "";
     m.compo.scene.addChild(planeGroup);
     currentState = '';
   }
   public function drawBusLine():void
   {
    var Buslines3D:Lines3D = new Lines3D();
    Buslines3D.name = "BusLine";
    for (var i:Number=0;i<LineArr.length;i++)
    {
     if (Number(LineArr[i].PREV_POSY)!=0&&Number(LineArr[i].PREV_POSX)!=0&&Number(LineArr[i].POSY)!=0&&Number(LineArr[i].POSX)!=0)
     {
      var PosX:Number = (LineArr[i].POSX - PosXMIN)/10;
         var PosY:Number = (LineArr[i].POSY - PosYMIN)/10;
         var PPosX:Number = (LineArr[i].PREV_POSX - PosXMIN)/10;
         var PPosY:Number = (LineArr[i].PREV_POSY - PosYMIN)/10;
         
      var BusLineMaterial:LineMaterial = new LineMaterial(0xFF0000);
      
      var v1:Vertex3D = new Vertex3D(PPosX-m.compo.moveX, PPosY+m.compo.moveY,0);
      var v2:Vertex3D = new Vertex3D(PosX-m.compo.moveX, PosY+m.compo.moveY,0);
      
      var Busline:Line3D = new Line3D(Buslines3D, BusLineMaterial, 2, v1, v2);
        
      Buslines3D.addLine(Busline);
     }
       }
     m.compo.scene.addChild(Buslines3D);
   }
   
   var tUniqueId:String = "";
   private function stop_press(e:InteractiveScene3DEvent):void
   {
    var tStr:String = e.target.name.toString();
    var tArr:Array = tStr.split("_");
    var routeid:String = tArr[0];
    var ord:String = tArr[1];
    tUniqueId = tArr[2];
    getInfoStation(routeid,ord,tUniqueId);
    fnChangeZoomSmooth(60,Number(tArr[3]),Number(tArr[4]));
   }
   private function getBusLoctQry_Result(e:ResultEvent):void
   {
    var table:ArrayCollection;// = e.result.DATA;
    var recordAC:ArrayCollection;
    recordAC = (e.result.DATA is ArrayCollection) ?     e.result.DATA as ArrayCollection :     new ArrayCollection(ArrayUtil.toArray(e.result.DATA));
    
    try
    {
     for (var i:Number=0; i<10000;i++)
     {
      if (BusType == recordAC[0][i].BUSTYPE.toString())
      {
       var ObjR:Object = new Object();
       ObjR.BUSID = recordAC[0][i].BUSID;
       ObjR.BUSNUM = recordAC[0][i].BUSNUM;
       ObjR.BUSTYPE = recordAC[0][i].BUSTYPE;
       ObjR.ENDARRTM = recordAC[0][i].ENDARRTM;
       ObjR.MATCH_X = recordAC[0][i].MATCH_X;
       ObjR.MATCH_Y = recordAC[0][i].MATCH_Y;
       ObjR.OFFER_TIME = recordAC[0][i].OFFER_TIME;
       ObjR.ROUTE_DISTANCE = recordAC[0][i].ROUTE_DISTANCE;
       ObjR.STATION_STOP_FLAG = recordAC[0][i].STATION_STOP_FLAG;
       ObjR.UNIT_DISTANCE = recordAC[0][i].UNIT_DISTANCE;
       ObjR.UNIT_ID = recordAC[0][i].UNIT_ID;
       ObjR.UNIT_ORD = Number(recordAC[0][i].UNIT_ORD);
       
       BusArr.push(ObjR);
      }
     }
    }
    catch(e:Error)
    {}
    drawBus();
    CursorManager.removeBusyCursor();
   }
   var BusUnique:String = "";
   private function bus_press(e:InteractiveScene3DEvent):void
   {
    var tStr:String = e.target.name.toString();
    var tArr:Array = tStr.split("_");
    getInfoBus(tArr[0]);
    BusUnique = tArr[0];
    fnChangeZoomSmooth(60,Number(tArr[1]),Number(tArr[2]));
   }
   var LineArr:Array = new Array();
   //var Buslines3D:Lines3D;
   
   private function getRtofPlineQry_Result(e:ResultEvent):void
   {
    var table:ArrayCollection;
    var recordAC:ArrayCollection;
    recordAC = (e.result.DATA is ArrayCollection) ?     e.result.DATA as ArrayCollection :     new ArrayCollection(ArrayUtil.toArray(e.result.DATA));
    
    try
    {
     for (var i:Number=0; i<10000;i++)
     {
      var ObjR:Object = new Object();
      
      ObjR.POSX = Number(recordAC[0][i].POSX);
      ObjR.POSY = Number(recordAC[0][i].POSY);
      ObjR.PREV_POSX = Number(recordAC[0][i].PREV_POSX);
      ObjR.PREV_POSY = Number(recordAC[0][i].PREV_POSY);
      
      LineArr.push(ObjR);
     }
    }
    catch(e:Error)
    {}
    
    drawBusLine();
     getBusStopDataByBusCode(nCode);
   }
  
   private function onMouseDown(e:MouseEvent):void{  
    m.compo.stage_mouseDown();
    if (IdPopupCanvas.visible == true)
    {
     IdPopupCanvas.visible = false;
    }
         }  
        
         private function onMouseUp(e:MouseEvent):void{
          m.compo.stage_mouseUp();
         }
   private function onMouseWheel(e:MouseEvent):void{
             if (e.delta > 0)
             {fnChangeZoom(10);}
             else
             {fnChangeZoom(-10);}
            
             if (IdPopupCanvas.visible == true)
    {
     IdPopupCanvas.visible = false;
    }
         }
        
         var tObjW:Number = 0;
         var tObjH:Number = 0;
         public function fnChangeZoom(varVal:Number):void
   {
    if(m.compo.camera.zoom + varVal>0)
    {
     m.compo.camera.zoom = m.compo.camera.zoom + varVal;
     
     //일단 지우고 시작.
     m.compo.scene.removeChildByName("Bus");
     m.compo.scene.removeChildByName("Station");
     m.compo.scene.removeChildByName("Estimate");
     m.compo.scene.removeChildByName("mapLine");
     m.compo.scene.removeChildByName("BusLine");
     
     m.compo.drawMap();
     m.compo.drawEstimate();
     
     drawBusLine();
     drawBus();
     drawStation(); 
     
     if (m.compo.ObjRotationZ > 0)
     {
      fnAutoChangeZ(m.compo.ObjRotationZ);
      //m.compo.ObjRotationZ = 0;
     }
    }
   }
   var ZoomTimer:Timer = new Timer(20);
   var DestZoom:Number = 0;
   var oriX:Number = 0;
   var oriY:Number = 0;
   var StepX:Number = 0;
   var StepY:Number = 0;
   var DestX:Number = 0;
   var DestY:Number = 0;
   public function fnChangeZoomSmooth(varVal:Number,DestXPos:Number,DestYPos:Number):void
   {
    /*
    fnReset(); // 중심점 잡고
    
    //기준 = 24 Step
    var oObj:DisplayObject3D = m.compo.scene.getChildByName("Station");
    oriX = oObj.x;
    oriY = oObj.y;
    
    StepX = (Math.abs(0 - oriX) + Math.abs(0 - DestXPos));
    StepY = (Math.abs(0 - oriY) + Math.abs(0 - DestYPos));
    
    m.compo.moveX = StepX;
    m.compo.moveY = StepY;
    
    StepX = StepX/(varVal - m.compo.camera.zoom);
    StepY = StepY/(varVal - m.compo.camera.zoom);
    
    DestZoom = varVal;
    
    DestX = DestXPos;
    DestY = DestYPos;
    ZoomTimer.addEventListener(TimerEvent.TIMER,fnChangeZoomSmoothActive);
    ZoomTimer.start();
    */
    fnReset(); // 중심점 잡고
    
    //기준 = 24 Step
    var oObj:DisplayObject3D = m.compo.scene.getChildByName("Station");
    oriX = oObj.x;
    oriY = oObj.y;
    
    StepX = (Math.abs(0 - oriX) + Math.abs(0 - DestXPos));
    StepY = (Math.abs(0 - oriY) + Math.abs(0 - DestYPos));
    
    m.compo.moveX = StepX;
    m.compo.moveY = StepY;
    
    StepX = StepX/(varVal - m.compo.camera.zoom);
    StepY = StepY/(varVal - m.compo.camera.zoom);
    
    DestZoom = varVal;
    
    DestX = DestXPos;
    DestY = DestYPos;
    
    //-----------------------------------------------
    //for (var i:Number = 0;i<varVal;i++)
    //{
     m.compo.camera.zoom += 1 * 60;
     var tArr:Array = [{data:"mapLine"},{data:"Estimate"},{data:"BusLine"},{data:"Station"},{data:"Bus"}];
     for (var i:Number=0;i<tArr.length;i++)
     {
      try
      {
       var oObj:DisplayObject3D = m.compo.scene.getChildByName(tArr[i].data);
        if(DestX>0)
        {
         oObj.x = oObj.x + StepX*60;
        }
        else
        {
         oObj.x = oObj.x - StepX*60;
        }
        if(DestY>0)
        {
         oObj.y = oObj.y - StepY*60;
        }
        else
        {
         oObj.y = oObj.y + StepY*60;
        }
       }
       catch(e:Error){}
      }
    //}
    var oObjt:DisplayObject3D = m.compo.scene.getChildByName("Station");
    var resX:Number = oObjt.x;
    var resY:Number = oObjt.y;
    
    m.compo.moveX = resX;
    m.compo.moveY = resY;
    
    m.compo.scene.removeChildByName("Bus");
    m.compo.scene.removeChildByName("Station");
    m.compo.scene.removeChildByName("Estimate");
    m.compo.scene.removeChildByName("mapLine");
    m.compo.scene.removeChildByName("BusLine");
    
    m.compo.drawMap();
    m.compo.drawEstimate();
    
    drawBusLine();
    drawBus();
    drawStation();
   }
   private function fnChangeZoomSmoothActive(e:TimerEvent):void
   {
    if (m.compo.camera.zoom<DestZoom)
    {
     m.compo.camera.zoom += 1;
     var tArr:Array = [{data:"mapLine"},{data:"Estimate"},{data:"BusLine"},{data:"Station"},{data:"Bus"}];
     for (var i:Number=0;i<tArr.length;i++)
     {
      try
      {
       var oObj:DisplayObject3D = m.compo.scene.getChildByName(tArr[i].data);
        if(DestX>0)
        {
         oObj.x = oObj.x + StepX;
        }
        else
        {
         oObj.x = oObj.x - StepX;
        }
        if(DestY>0)
        {
         oObj.y = oObj.y - StepY;
        }
        else
        {
         oObj.y = oObj.y + StepY;
        }
       }
       catch(e:Error){}
      }
    }
    else
    {
     ZoomTimer.stop();
     
     var oObj:DisplayObject3D = m.compo.scene.getChildByName("Station");
     var resX:Number = oObj.x;
     var resY:Number = oObj.y;
     
     m.compo.moveX = resX;
     m.compo.moveY = resY;
     
     m.compo.scene.removeChildByName("Bus");
     m.compo.scene.removeChildByName("Station");
     m.compo.scene.removeChildByName("Estimate");
     m.compo.scene.removeChildByName("mapLine");
     m.compo.scene.removeChildByName("BusLine");
     
     m.compo.drawMap();
     m.compo.drawEstimate();
     
     drawBusLine();
     drawBus();
     drawStation();
    }
   }
   
   import org.papervision3d.cameras.Camera3D;
   public function fnChangeYAxis(varVal:Number):void
   {
    m.compo.fnchangeYAxis(varVal);
   }
   public function fnChangeXAxis(varVal:Number):void
   {
    m.compo.fnchangeXAxis(varVal);
   }
   public function fnChangeZ(varVal:Number):void
   {
    m.compo.fnChangeZAxis(varVal);
   }
   public function fnAutoChangeZ(varVal:Number):void
   {
    m.compo.fnAutoChangeZAxis(varVal);
   }
   
   public function fnReset():void
   {
    m.compo.camera.zoom = 16;
    m.compo.fnSetChangeXAxis(0);
    m.compo.fnSetChangeYAxis(60);
    m.compo.fnSetZAxisInit();
    m.compo.fnSetChangeYAxis(-360);
    m.compo.fnResetXYAxisPoint();
    m.compo.moveX = 0;
    m.compo.moveY = 0;
    
    m.compo.fnForceRender();
    
    MainCanvas.addEventListener(MouseEvent.MOUSE_WHEEL,onMouseWheel);
    MainCanvas.addEventListener(MouseEvent.MOUSE_DOWN, onMouseDown);  
             MainCanvas.addEventListener(MouseEvent.MOUSE_UP, onMouseUp);
   }
   
  ]]>
 </mx:Script>
 <mx:Style source="style/style.css"/>
 <mx:Canvas width="669" height="519" id="MainCanvas" backgroundColor="#FFFFFF">
  <mx:Canvas id="IdRemoteCanvas" width="326" height="55" alpha="0.4" mouseOver="IdRemoteCanvas.alpha=1;" mouseOut="IdRemoteCanvas.alpha=0.4;" x="171.5">
    <mx:Button x="272" y="9" click="fnChangeZoom(10);" styleName="Zoom"/>
    <mx:Button x="11" y="9" click="fnChangeZoom(-10);" styleName="Out"/>
    <mx:Button x="184" y="9" click="fnChangeYAxis(-150);" styleName="ThirdDUp"/>
    <mx:Button x="98" y="9" click="fnChangeZ(25);" styleName="RotateL"/>
    <mx:Button x="141" y="9" click="fnChangeZ(-25);" styleName="RotateR"/>
    <mx:Button x="228" y="9" click="fnChangeYAxis(150);" styleName="ThirdDDown"/>
    <mx:Button x="55" y="9" click="fnReset();" styleName="Home"/>
  </mx:Canvas>
  <mx:Canvas x="219" y="58" width="212" height="204" styleName="PopupCanvas" id="IdPopupCanvas" click="IdPopupCanvas.visible=false;" visible="false">
   <mx:TextArea x="11" y="13" width="187" height="154" id="IdPopupText" borderStyle="none" fontSize="12"/>
  </mx:Canvas>
  <mx:SWFLoader id="bus" source="http://.../assets/bus_b.swf" visible="false"/>
  <mx:SWFLoader id="station" source="http://.../assets/bus_stop.swf" visible="false"/>
 </mx:Canvas>
</mx:Application>

2. Component : Comp.mxml

package com
{
 import flash.events.Event;
 import flash.geom.Point;
 
 import mx.rpc.events.*;
 import mx.rpc.soap.*;
 
 import org.papervision3d.cameras.Camera3D;
 import org.papervision3d.core.geom.Lines3D;
 import org.papervision3d.core.geom.renderables.Line3D;
 import org.papervision3d.core.geom.renderables.Vertex3D;
 import org.papervision3d.core.math.Number3D;
 import org.papervision3d.materials.BitmapFileMaterial;
 import org.papervision3d.materials.special.LineMaterial;
 import org.papervision3d.objects.DisplayObject3D;
 import org.papervision3d.objects.primitives.Plane;
 import org.papervision3d.view.BasicView;
 
 [SWF(width='100%',height='100%',backgroundColor='0xF4F4F4',frameRate='300')]
 
 public class Seoul3DCom extends BasicView
 {
  protected var SeoulLineMaterial:LineMaterial;
  public var lines3D:Lines3D;
  private var cam:Camera3D;
  var PosXMIN:Number = 0;
  var PosYMIN:Number = 0;
  var EstimateArr:Array = [{X:198174,Y:452592},{X:205575,Y:461000},{X:196248,Y:439678},{X:208670,Y:445678},{X:199607,Y:453478}];
  var planeGroupEstimate:DisplayObject3D;
  
  public function Seoul3DCom()
  {
   //배경색상
   this.opaqueBackground = 0xF4F4F4;
   super(1, 1, true, true);
   initScene();
   
   startRendering();
      addEventListener(Event.ENTER_FRAME, onEnterFrame);
  }
  
  private var isMouseDown:Boolean = false;
  
  public function stage_mouseDown():void
  {
   isMouseDown = true;
  }
 
  public function stage_mouseUp():void
  {
   isMouseDown = false; 
  }

  function onEnterFrame(e:Event):void
        {
         renderer.renderScene(scene, camera, viewport);
        }
  public function fnForceRender():void
  {
   renderer.renderScene(scene, camera, viewport);
  }
  protected function initScene():void
  {
   
   
   this._camera.y = -360;
   
   PosXMIN = 177371 + 22000;
   PosYMIN = 468477 - 20000;
   
   drawMap();
   drawEstimate();
  }
  
  private var previousMousePoint:Point = new Point();
  private static const FORWARD:Number3D = new Number3D(0, 0, 1);
  public var moveX:Number = 0;
  public var moveY:Number = 0;

  override protected function onRenderTick(event:Event=null):void
  {
   var currentMousePoint:Point = new Point(viewport.containerSprite.mouseX, viewport.containerSprite.mouseY);
 
   if(isMouseDown)
   {
    var distance:Number = Point.distance(currentMousePoint, previousMousePoint);
     
     var oObj:DisplayObject3D = this.scene.getChildByName("mapLine");
     oObj.x = oObj.x - (previousMousePoint.x - currentMousePoint.x)*3;
     oObj.y = oObj.y + (previousMousePoint.y - currentMousePoint.y)*3;
     
     var oObj2:DisplayObject3D = this.scene.getChildByName("Estimate");
     oObj2.x = oObj2.x - (previousMousePoint.x - currentMousePoint.x)*3;
     oObj2.y = oObj2.y + (previousMousePoint.y - currentMousePoint.y)*3;
     
     try{
      var oObj3:DisplayObject3D = this.scene.getChildByName("BusLine");
      oObj3.x = oObj3.x - (previousMousePoint.x - currentMousePoint.x)*3;
      oObj3.y = oObj3.y + (previousMousePoint.y - currentMousePoint.y)*3;
     }
     catch(e:Error){}
     try{
      var oObj4:DisplayObject3D = this.scene.getChildByName("Station");
      oObj4.x = oObj4.x - (previousMousePoint.x - currentMousePoint.x)*3;
      oObj4.y = oObj4.y + (previousMousePoint.y - currentMousePoint.y)*3;
     }
     catch(e:Error){}
     try{
      var oObj5:DisplayObject3D = this.scene.getChildByName("Bus");
      oObj5.x = oObj5.x - (previousMousePoint.x - currentMousePoint.x)*3;
      oObj5.y = oObj5.y + (previousMousePoint.y - currentMousePoint.y)*3;
     }
     catch(e:Error){}
     
     moveX = moveX + (previousMousePoint.x - currentMousePoint.x)*3;
    moveY = moveY + (previousMousePoint.y - currentMousePoint.y)*3;
   }
 
   previousMousePoint = currentMousePoint;
   
   super.onRenderTick(event);
  }
  
  public function fnchangeXAxis(varVal:Number):void
  {
   this._camera.x = this._camera.x + varVal;
  }
  public function fnSetChangeXAxis(varVal:Number):void
  {
   this._camera.x = varVal;
  }
  public function fnchangeYAxis(varVal:Number):void
  {
   this._camera.y = this._camera.y + varVal;
  }
  public function fnSetChangeYAxis(varVal:Number):void
  {
   this._camera.y = varVal;
  }
  public var ObjRotationZ:Number = 0;
  public function fnChangeZAxis(varVal:Number):void
  {
   try
   {
    this.planeGroupEstimate.rotationZ += varVal;
    this.lines3D.rotationZ += varVal;
    var tObjBusLine:DisplayObject3D = scene.getChildByName("BusLine");
    tObjBusLine.rotationZ += varVal;
    var tObjStation:DisplayObject3D = scene.getChildByName("Station");
    tObjStation.rotationZ += varVal;
    var tObjBus:DisplayObject3D = scene.getChildByName("Bus");
    tObjBus.rotationZ += varVal;
    
    ObjRotationZ += varVal;
   }
   catch(e:Error){}
  }
  public function fnAutoChangeZAxis(varVal:Number):void
  {
   try
   {
    this.planeGroupEstimate.rotationZ += varVal;
    this.lines3D.rotationZ += varVal;
    var tObjBusLine:DisplayObject3D = scene.getChildByName("BusLine");
    tObjBusLine.rotationZ += varVal;
    var tObjStation:DisplayObject3D = scene.getChildByName("Station");
    tObjStation.rotationZ += varVal;
    var tObjBus:DisplayObject3D = scene.getChildByName("Bus");
    tObjBus.rotationZ += varVal;
   }
   catch(e:Error){}
  }
  public function fnSetZAxisInit():void
  {
   try
   {
    this.planeGroupEstimate.rotationZ =0;
    this.lines3D.rotationZ =0;
    var tObjBusLine:DisplayObject3D = scene.getChildByName("BusLine");
    tObjBusLine.rotationZ =0;
    var tObjStation:DisplayObject3D = scene.getChildByName("Station");
    tObjStation.rotationZ =0;
    var tObjBus:DisplayObject3D = scene.getChildByName("Bus");
    tObjBus.rotationZ =0;
    
    ObjRotationZ = 0;
   }
   catch(e:Error){}
  }
  
  
  public function fnResetXYAxisPoint():void
  {
   var tArr:Array = [{data:"mapLine"},{data:"Estimate"},{data:"BusLine"},{data:"Station"},{data:"Bus"}];
   for (var i:Number=0;i<tArr.length;i++)
   {
    try
    {
     var oObj:DisplayObject3D = this.scene.getChildByName(tArr[i].data);
      oObj.x = 0;// oObj.x + moveX;
     oObj.y = 0;// oObj.y - moveY;
     }
     catch(e:Error){}
    }
    
  }
  
  public function drawMap():void
  {
   var mapArr:Array = getMap();
   
   lines3D = new Lines3D();
   lines3D.name = "mapLine";
   
   for (var p:Number = 0;p<mapArr.length;p++)
   {
    mapArr[p].x1 = (Number(mapArr[p].x1) - PosXMIN)/10;
    mapArr[p].y1 = (Number(mapArr[p].y1) - PosYMIN)/10;
    mapArr[p].x2 = (Number(mapArr[p].x2) - PosXMIN)/10;
    mapArr[p].y2 = (Number(mapArr[p].y2) - PosYMIN)/10;
   }
   
   for (var i:Number = 0;i<mapArr.length;i++)//100;i++)//mapArr.length;i++)
   {
    SeoulLineMaterial = new LineMaterial(0xDADADA);
    
    var v1:Vertex3D = new Vertex3D(mapArr[i].x1 - moveX, mapArr[i].y1 + moveY, 0);
    var v2:Vertex3D = new Vertex3D(mapArr[i].x2 - moveX, mapArr[i].y2 + moveY, 0);
    
    var line:Line3D = new Line3D(lines3D, SeoulLineMaterial, 2, v1, v2);
      
    lines3D.addLine(line);
   }
   scene.addChild(lines3D);
  }
  
  public function drawEstimate():void
  {
   planeGroupEstimate = new DisplayObject3D();
   planeGroupEstimate.name = "Estimate";
   
   for (var i:Number=0;i<EstimateArr.length;i++)
   {
    var PosX:Number = (EstimateArr[i].X - PosXMIN)/10;
       var PosY:Number = (EstimateArr[i].Y - PosYMIN)/10;
       
    var material:BitmapFileMaterial = new BitmapFileMaterial( "http://.../assets/icon"+(i+1).toString()+".png" );
    material.doubleSided = true;
    material.smooth = true;
    material.lineAlpha = 0;
    material.lineColor = 0xFFFFFF;
    material.interactive = true;
    
    var Height:Number = 150;//195 - (camera.zoom*1.3);
    var Width:Number = 150;//105 - (camera.zoom*1.3); 
    
    var plane:Plane = new Plane( material, Width, Height, 1, 1);
    plane.x = PosX - moveX;
    plane.y = PosY + moveY; 
    
    planeGroupEstimate.addChild(plane);
    }
    scene.addChild(planeGroupEstimate);
  }
  
  public function getMap():Array
  {
   var tStr:String = "197860^459048^198580^459768||198580^459768^200740^465368||200740^465368^201780^466808||201780^466808^204660^465048||204660^465048^208500^465368||208500^465368^208580^460648||208580^460648^209300^457848||209300^457848^210420^455288||210420^455288^208900^452648||208900^452648^210180^450808||210180^450808^215540^453528||215540^453528^216180^449688||216180^449688^212580^446488||212580^446488^213940^444408||213940^444408^210980^440968||210980^440968^208500^439768||208500^439768^205700^436648||205700^436648^203220^438008||203220^438008^202820^440648||202820^440648^201140^439528||201140^439528^200180^440968||200180^440968^199060^440088||199060^440088^196820^438088||196820^438088^195380^437768||195380^437768^193700^438968||193700^438968^191540^437208||191540^437208^188740^443048||188740^443048^188420^443928||188420^443928^193220^443288||193220^443288^185460^441848||185460^441848^183620^442008||183620^442008^184340^443608||184340^443608^183620^444168||183620^444168^184500^445608||184500^445608^184420^449048||184420^449048^182100^449048||182100^449048^179620^450568||179620^450568^181620^453368||181620^453368^182420^454568||182420^454568^182660^456168||182660^456168^187220^452408||187220^452408^189700^454568||189700^454568^191300^454808||191300^454808^192260^460568||192260^460568^195780^461848||195780^461848^196580^458968||196580^458968^197860^459048||209460^457848^207780^457768||207780^457768^206340^457368||206340^457368^205540^457208||205540^457208^204500^458168||204500^458168^203780^459048||203780^459048^204340^460568||204340^460568^204820^459928||204820^459928^204660^462168||204660^462168^204180^463528||204180^463528^204580^465128||200740^465048^201700^463528||201700^463528^201060^461448||201060^461448^203060^460088||203060^460088^203780^459048||203780^459048^204500^458168||204500^458168^203060^456888||203060^456888^200900^457608||200900^457608^200580^458408||200580^458408^199620^459048||199620^459048^198660^459688||206340^457368^206340^456328||206340^456328^206260^455128||206260^455128^206420^453928||206420^453928^206900^452408||206900^452408^208100^452248||208100^452248^208900^452808||206340^456328^205380^455768||205380^455768^204580^455608||204580^455608^203700^454808||203700^454808^202180^453288||202180^453288^200900^453448||200900^453448^200660^454088||200660^454088^200180^454648||200180^454648^198820^454968||198820^454968^198340^455928||198340^455928^199060^456808||199060^456808^198580^458008||198580^458008^198020^459128||||||210340^450808^209700^449368||209700^449368^208660^448008||208660^448008^206980^446968||206980^446968^206020^447208||206020^447208^205060^447688||205060^447688^206580^451048||206580^451048^206900^452408||||||212580^446568^210580^447688||210580^447688^210900^448728||210900^448728^209700^449368||||||210820^440808^209380^443608||209380^443608^206180^444968||206180^444968^206020^447208||||||206580^451048^205220^451448||205220^451448^204340^452168||204340^452168^203380^452488||203380^452488^202100^452408||202100^452408^202180^453288||||||205060^447688^203940^448328||203940^448328^201700^448408||201700^448408^200740^449448||200740^449448^201620^450728||201620^450728^202260^451448||202260^451448^202100^452408||||||208420^439608^207300^441688||207300^441688^204500^440888||204500^440888^203620^442808||203620^442808^202980^442888||202980^442888^201540^446808||201540^446808^200900^447448||200900^447448^201700^448408||||||198980^440008^198340^442008||198340^442008^198420^445128||198420^445128^200900^447448||||||196500^458888^195700^458408||195700^458408^195620^456728||195620^456728^194180^455048||194180^455048^192500^454168||192500^454168^191300^452968||191300^452968^189220^454168||||||195620^456728^196020^455528||196020^455528^196020^453208||196020^453208^197060^451768||197060^451768^197380^451288||197380^451288^196740^450968||196740^450968^194260^450568||194260^450568^193700^451208||193700^451208^193700^451688||193700^451688^191300^452968||||||202100^452408^200420^452168||200420^452168^199300^452008||199300^452008^197940^452328||197940^452328^197060^451768||||||200740^449448^199780^449928||199780^449928^198420^450328||198420^450328^196900^450328||196900^450328^196740^450968||||||196900^450328^195380^448248||195380^448248^194180^448968||194180^448968^191700^449128||191700^449128^191140^449768||191140^449768^189460^450808||189460^450808^187140^452568||||||198420^445128^195620^446568||195620^446568^195380^448248||||||189460^450808^189380^449848||189380^449848^188980^449768||188980^449768^188180^450168||188180^450168^188020^448008||188020^448008^185940^447688||185940^447688^185060^449608||185060^449608^184340^448888||||||189380^449848^190420^448088||190420^448088^189460^447448||189460^447448^189300^446648||189300^446648^188900^445128||188900^445128^187700^445528||187700^445528^185700^444968||185700^444968^184500^445608||||||189300^446648^190420^445688||190420^445688^190660^443528||190660^443528^191380^442888||191380^442888^191060^442088||191060^442088^190100^442408||190100^442408^189460^442968||189460^442968^188820^443048||||||195620^446568^193620^446248||193620^446248^192900^444408||192900^444408^192260^444248||192260^444248^191380^442888||||||198340^442008^197540^441848||197540^441848^196660^442568||196660^442568^196500^443848||196500^443848^195460^443768||195460^443768^194260^443688||194260^443688^193620^444008||193620^444008^193300^443448||193300^443448^192180^443048||192180^443048^191380^442888||||||193780^438968^193060^439768||193060^439768^192500^439928||192500^439928^192180^441528||192180^441528^192100^442328||192100^442328^191060^442088";
   var tArr:Array = tStr.split("||");
   var mapArr:Array = new Array();
   for (var a:Number = 0;a<tArr.length;a++)
   {
    var sArr:Array = tArr[a].toString().split("^");
    var Obj:Object = new Object();
    Obj.x1 = sArr[0];
    Obj.y1 = sArr[1];
    Obj.x2 = sArr[2];
    Obj.y2 = sArr[3];
    mapArr.push(Obj);
   }
   return mapArr;
  }
 }
}

by 애매모애 | 2009/11/13 17:33 | Flex | 트랙백 | 덧글(0)

낙화(落花) / 이형기



낙화(落花) / 이형기

  

가야 할 때가 언제인가를
분명히 알고 가는 이의
뒷모습은 얼마나 아름다운가.

봄 한철
격정을 인내한
나의 사랑은 지고 있다

분분한 낙화......
결별이 이룩하는 축복에 싸여
지금은 가야 할 때

무성한 녹음과 그리고
머지 않아 열매 맺는
가을을 향하여
나의 청춘은 꽃답게 죽는다.

헤어지자
섬세한 손길을 흔들며
하롱하롱 꽃잎이 지는 어느 날

나의 사랑, 나의 결별
샘터에 물 고인 듯 성숙하는
내 영혼의 슬픈 눈

by 애매모애 | 2008/12/15 11:43 | 트랙백 | 덧글(0)

새로운 그릴

옵션으로 나온 에어로 파츠중에서 그릴만 바꿨습니다....
31,400엔 이지만...실제 혼코에서 가져온 가격은 11만원대?

by 애매모애 | 2008/11/17 14:04 | About Life | 트랙백 | 덧글(2)

차량 방음!

대전에서 차량 방음 했습니다.!
총알 120 소요...ㅠ_ㅠ
엔진룸, 하체, 대시보드 1열 앞문짝 두개!...
흑...조용은 해졌습니다.
우찌된게 그랜져TG보다 연비나 힘은 좋은데....너무 시끄럽고 편의 기능이 없는게...
아 이차는 정말 커스텀 차구나...하는 느낌이 드는 차입니다. -_-;;

by 애매모애 | 2008/11/16 01:12 | About Life | 트랙백 | 덧글(2)

Flex3/AIR 펜션 예약 시스템

예약 시스템입니다.
ASP.Net 2.0 C#용 WebService 사용합니다.
이쪽 소스 얻으실분은 따로 연락주세요~
oracle80@hanmail.net~
DB는 MS-SQL 2005인데...별다른 특정 문법 안 썼으니 일반 SQL이라고 생각하시면 될겁니다.
자주 쓰는것을 펑션화 시켰습니다.
그리고...이건 컴퍼넌트로 AIR용 컨버스 입니다.(하지만 컴퍼넌트이니 상관 없으려나?...ㅋ)
그럼 공부하실 때 참고하세요^^

자 소스 뿌립니다.~~~~~~~~~~

------------------------------------------------------------------------------------------------------------------

<?xml version="1.0" encoding="utf-8"?>
<mx:Canvas xmlns:mx="http://www.adobe.com/2006/mxml" width="1440" height="833" backgroundImage="@Embed(source='img/ReservationBack.png')" creationComplete="initReservation();">
 <mx:states>
  <mx:State name="getDetail">
   <mx:AddChild position="lastChild">
    <mx:Canvas x="554" y="214" width="309" height="543" backgroundImage="@Embed(source='img/pnlReservationDetail.png')" id="RoomEditPanel" visible="false">
     <mx:Button x="232" y="23" width="60" height="19" overSkin="@Embed(source='img/btnClose_1.png')" upSkin="@Embed(source='img/btnClose_1.png')" downSkin="@Embed(source='img/btnClose_2.png')"/>
     <mx:Button x="30" y="491" width="59" height="39" overSkin="@Embed(source='img/btnEdit_1.png')" upSkin="@Embed(source='img/btnEdit_1.png')" downSkin="@Embed(source='img/btnEdit_2.png')"/>
     <mx:Button x="95" y="491" width="59" height="39" overSkin="@Embed(source='img/btnRoom_1.png')" upSkin="@Embed(source='img/btnRoom_1.png')" downSkin="@Embed(source='img/btnRoom_2.png')"/>
     <mx:Button x="162" y="491" width="59" height="39" overSkin="@Embed(source='img/btnOption_1.png')" upSkin="@Embed(source='img/btnOption_1.png')" downSkin="@Embed(source='img/btnOption_2.png')"/>
     <mx:Button x="227" y="491" width="59" height="39" overSkin="@Embed(source='img/btnCalc_1.png')" upSkin="@Embed(source='img/btnCalc_1.png')" downSkin="@Embed(source='img/btnCalc_2.png')"/>
     <mx:DateChooser x="31" y="293" width="255" height="181" styleName="ReservationDC" dayNames="[일,월,화,수,목,금,토]" yearSymbol="년" monthNames="[1월,2월,3월,4월,5월,6월,7월,8월,9월,10월,11월,12월]"/>
     <mx:Label x="31" y="50" text="객실명 : " styleName="ReservationDetail" fontSize="12"/>
     <mx:Label x="81" y="50" styleName="ReservationDetail" fontSize="12" width="211" id="IdDtRoomName"/>
     <mx:Label x="31" y="69" text="투숙기간 : " styleName="ReservationDetail" fontSize="12"/>
     <mx:Label x="93" y="69" styleName="ReservationDetail" fontSize="12" width="216" id="IdDtRoomDuration"/>
     <mx:Label x="31" y="88" text="예약자 : " styleName="ReservationDetail" fontSize="12"/>
     <mx:Label x="83" y="88" styleName="ReservationDetail" fontSize="12" width="209" id="IdDtRoomPatient"/>
     <mx:Label x="31" y="107" text="숙박인원 : " styleName="ReservationDetail" fontSize="12"/>
     <mx:Label x="94" y="107" styleName="ReservationDetail" fontSize="12" width="149" id="IdDtRoomPerson"/>
     <mx:Label x="33" y="144" text="객실료" styleName="ReservationDetailTitle"/>
     <mx:Label x="94" y="144" styleName="ReservationDetailTitle" textAlign="right" width="180" id="IdRoomPrice"/>
     <mx:Label x="94" y="170" styleName="ReservationDetailTitle" textAlign="right" width="180" id="IdRoomOption"/>
     <mx:Label x="33" y="170" text="선택사항" styleName="ReservationDetailTitle"/>
     <mx:DataGrid x="36" y="196" width="238" height="53" styleName="OrderedMenu" id="OptionDG">
      <mx:columns>
       <mx:DataGridColumn dataField="OptionName"/>
       <mx:DataGridColumn dataField="OptionPrice"/>
      </mx:columns>
     </mx:DataGrid>
    </mx:Canvas>
   </mx:AddChild>
   <!--Basic-->
  </mx:State>
  <mx:State name="Cash">
   <mx:AddChild position="lastChild">
    <mx:Panel x="143" y="239" width="303" height="176" layout="absolute" title="Cash Receipt" styleName="Cafe" backgroundImage="@Embed(source='img/pnlCash.png')">
     <mx:Label x="235" y="48" text="원" fontSize="14" styleName="ReservationDetail"/>
     <mx:Label x="235" y="101" text="원" fontSize="14" styleName="ReservationDetail"/>
     <mx:Label x="91" y="47" fontSize="14" width="141" textAlign="right" id="IdCashTotPrice"/>
     <mx:Label x="91" y="101" fontSize="14" width="141" textAlign="right" id="IdCashReserve"/>
     <mx:Label x="235" y="75" text="원" fontSize="14" styleName="ReservationDetail"/>
     <mx:TextInput x="91" y="73" width="141" id="IdCashRecPrice" enter="calcReserve();" change="changePrice('IdCashRecPrice');" restrict="0-9" textAlign="right"/>
     <mx:Button x="111" y="122" click="ActReceipt('Cash');" upSkin="@Embed(source='img/btnConfirm_1.png')" overSkin="@Embed(source='img/btnConfirm_1.png')" downSkin="@Embed(source='img/btnConfirm_2.png')"/>
    </mx:Panel>
   </mx:AddChild>
  </mx:State>
  <mx:State name="Card">
   <mx:AddChild position="lastChild">
    <mx:Panel x="143" y="239" width="303" height="177" layout="absolute" title="Card Receipt" styleName="Cafe" backgroundImage="@Embed(source='img/pnlCard.png')">
     <mx:Label x="250" y="56" text="원" fontSize="14" styleName="ReservationDetail"/>
     <mx:Label x="96" y="56" fontSize="14" width="151" textAlign="right" id="IdCardTotPrice" styleName="ReservationDetail"/>
     <mx:Button x="110.5" y="126" click="ActReceipt('Card');"  upSkin="@Embed(source='img/btnConfirm_1.png')" overSkin="@Embed(source='img/btnConfirm_1.png')" downSkin="@Embed(source='img/btnConfirm_2.png')"/>
    </mx:Panel>
   </mx:AddChild>
  </mx:State>
 </mx:states>
 <mx:Style source="Main.css"/>
 <mx:Script source="ArrayLib.as"/>
 <mx:Script>
  <![CDATA[
  
  import mx.events.DateChooserEvent;
  import mx.events.ItemClickEvent;
  import mx.events.MenuEvent;
  import mx.core.Window;
  import mx.containers.Panel;
  import mx.events.MenuEvent;
  import mx.rpc.Fault;
     import mx.containers.Canvas;
     import mx.core.IFlexDisplayObject;
     import mx.core.UIComponent;
     import mx.collections.ArrayCollection;
     import mx.controls.*;
     import mx.rpc.http.HTTPService;
     import mx.rpc.events.*;
     import mx.utils.ArrayUtil;
     import flash.external.*;
     import flash.events.Event;
     import mx.core.IUIComponent;
     import mx.rpc.soap.*;
     import flash.display.DisplayObject;
     import flash.display.Graphics;
     import flash.display.Shape;
     import flash.display.Sprite;
    
     public var gateway:WebService = new WebService();
        public var SUrl:String = "";
        public var PartId:String = "";

  public function initReservation():void
  {
   SUrl = parentDocument.getURL();
         PartId = parentDocument.getPartID();
         setRoomInfo();
         var nDate:Date = new Date();
         setRoomList(fnFlexDateToSqlDate(nDate));
  }       
  public function calcReserve():void
     {
      var tTotPrice:Number = 0;//Number(TablePrice[Number(SelectedTable)].Price.toString());
      if(IdCashRecPrice.text!='')
      {
       if(tTotPrice > changeFormattedPriceToNum(IdCashRecPrice.text))
       {
        Alert.show("받은돈이 낼돈보다 적다...-_- \n 더 받아...");
        IdCashRecPrice.text = "";
        IdCashRecPrice.setFocus();
       }
       else
       {
        var tIdCashReserve:Number = changeFormattedPriceToNum(IdCashRecPrice.text) - tTotPrice
        IdCashReserve.text = currFormatter.format(tIdCashReserve);
       }
      }
     }
//Common
  private function faultevent(e:FaultEvent):void {
      try{
       Alert.show(e.message.toString());
      }
   catch (err:Error) {
    Alert.show(err.message.toString());
   }
     }
     public function changeFormattedPriceToNum(strFormatted:String):Number
     {
      var pattern:RegExp = /,/gi;
      var tNum:Number = Number(strFormatted.replace(pattern,""));
      return tNum;
     }
     public function changeNumToFormattedPrice(Num:Number):String
     {
      var tStr:String = currFormatter.format(Num).toString();
      return tStr;
     }
     public function changePrice(targetId:String):void
     {
      if (this[targetId].text.length > 0){
       var pattern:RegExp = /,/gi;
       this[targetId].text = currFormatter.format(Number(this[targetId].text.toString().replace(pattern,"")));
      }
      else
      {
       this[targetId].text = this[targetId].text;
      }
     }
     //지정된 DateChooser에서 SelectedDate를 flex Date형태로 반환
     public function fnGetSelectedDateFromTargetDC(DC:DateChooser):Date
     {
      var tYear:String = DC.selectedDate.fullYearUTC.toString();
         var tMonth2:Number = Number(DC.selectedDate.month.toString())+1;
         var tMonth:String = tMonth2.toString();
         var tDate:String = DC.selectedDate.date.toString();
         var TString:String = tMonth + "/" + tDate + "/" + tYear;
         var SelectedDate:Date = new Date(TString);
         
         return SelectedDate;
     }
     //flex형식의 date를 SQL 형식의 날짜로 반환
     public function fnFlexDateToSqlDate(fDate:Date):String
     {
      var tYear:String = fDate.fullYearUTC.toString();
         var tMonth2:Number = Number(fDate.month.toString())+1;
         var tMonth:String = tMonth2.toString();
         var tDate:String = fDate.date.toString();
         var TString:String = tMonth + "/" + tDate + "/" + tYear;
         var SelectedDate:Date = new Date(TString);
         
         var sqlSDate:String = tYear + "-" + tMonth + "-" + tDate;
         
         return sqlSDate;
     }
     //flex형식의 date에 지정한 날짜를 증가하여 SQL 형식의 날짜로 반환
     public function fnFlexDateToSqlDateDateAdd(fDate:Date,Add:Number):String
     {
      var tYear:String = fDate.fullYearUTC.toString();
         var tMonth2:Number = Number(fDate.month.toString())+1;
         var tMonth:String = tMonth2.toString();
         var tDate:String = fDate.date.toString();
         var TString:String = tMonth + "/" + tDate + "/" + tYear;
         var SelectedDate:Date = new Date(TString);
         var milliseconds:Number = Date.parse(SelectedDate);
         var EndMilli:Number = milliseconds + (Add * 86400000);
         var EndDate:Date = new Date(EndMilli);
         
         return fnFlexDateToSqlDate(EndDate);
     }
     public function fnSQLDateToPrineDate(strDate:String):String
     {
      var ArrDate:Array = strDate.split("-");
      return ArrDate[0].toString() + "년 " + ArrDate[1].toString() + "월 " +ArrDate[2].toString()+ "일"
     }
//Common 
  public function setRoomList(targetDate:String):void
  {
   gateway.wsdl = SUrl + "Reservation.asmx?wsdl";
    gateway.loadWSDL();
    gateway.GetReservationStatusByDate.addEventListener(ResultEvent.RESULT, setRoomList_Result);
    gateway.addEventListener(FaultEvent.FAULT, faultevent);
    gateway.GetReservationStatusByDate(targetDate,PartId);
  }
  public var RoomListArr:Array = new Array();
  private function setRoomList_Result(e:ResultEvent):void
  {
   RoomListArr = new Array();
   var table:* = e.result.Tables.dt0.Rows;
   for (var i:Number=0;i<table.length;i++)
   {
    var Obj:Object = new Object();
    Obj.idx = table[i].IDX;
    Obj.RoomIDX = table[i].RoomIDX;
    RoomListArr.push(Obj);
   }
   setDetailBtnPosition();
  }
  public function setDetailBtnPosition():void
  {
   try
   {
    for (var i:Number = 0 ; i <TableLength ; i++)
       { 
        var btnFlag:Boolean = true;
        for (var j:Number = 0 ;j<RoomListArr.length;j++)
        {
         var t1:String = RoomInfoArr[i].idx.toString();
         var t2:String = RoomListArr[j].RoomIDX.toString();
         if (RoomInfoArr[i].idx.toString() == RoomListArr[j].RoomIDX.toString())
         {
          btnFlag = false;
         }
        }
        if (btnFlag)
        {
         var PosX:Number = (i%5)*57;
         var PosY:Number = Math.floor(i/5)*27; 
         var TableBtn:Button = new Button();
         TableBtn.x = PosX;
         TableBtn.y = PosY;
         TableBtn.label = RoomInfoArr[i].RoomName.toString();
         TableBtn.width = 55;//ControlWidth;
         TableBtn.height = 25;//ControlHeight;
         TableBtn.name = "DetailBtn"+RoomInfoArr[i].idx.toString();
         TableBtn.id = i.toString();
         TableBtn.styleName = "MiniRoom";
         TableBtn.addEventListener(MouseEvent.CLICK,fnSetRoomSelect);
         IdRoomList.addChildAt(TableBtn,0);
        }
       }
      }
      catch(e:Error){}
  }
  public var RoomInfoArr:Array = new Array();
  public function setRoomInfo():void
  {
   gateway.wsdl = SUrl + "Reservation.asmx?wsdl";
    gateway.loadWSDL();
    gateway.GetRoomInfo.addEventListener(ResultEvent.RESULT, setRoomInfo_Result);
    gateway.addEventListener(FaultEvent.FAULT, faultevent);
    gateway.GetRoomInfo(PartId);
  }
  private function setRoomInfo_Result(e:ResultEvent)
  {
   var table:* = e.result.Tables.dt0.Rows;
   for (var i:Number=0;i<table.length;i++)
   {
    var Obj:Object = new Object();
    Obj.idx = table[i].idx;
    Obj.PartId = table[i].PartId;
    Obj.RoomName = table[i].RoomName;
    Obj.MaxCapacity = table[i].MaxCapacity;
    Obj.PriceNormalWeekday = table[i].PriceNormalWeekday;
    Obj.PriceNormalWeekend = table[i].PriceNormalWeekend;
    Obj.PriceBusyWeekday = table[i].PriceBusyWeekday;
    Obj.PriceBusyWeekend = table[i].PriceBusyWeekend;
    RoomInfoArr.push(Obj);
   }
   setPositionBtn();
  }
  public var TableLength:Number = 13;//parentDocument.getTableLength();
  public function setPositionBtn():void
  {
   var ControlWidth:Number = 156;
      var ControlHeight:Number = 83;
       
      for (var i:Number = 0 ; i <TableLength ; i++)
      { 
       var PosX:Number = (i%7)*176;
       var PosY:Number = Math.floor(i/7)*116; 
       var TableBtn:Button = new Button();
       TableBtn.x = PosX;
       TableBtn.y = PosY;
       TableBtn.label = RoomInfoArr[i].RoomName.toString();
       TableBtn.width = ControlWidth;
       TableBtn.height = ControlHeight;
       TableBtn.name = "TblBtn"+RoomInfoArr[i].idx.toString();
       TableBtn.id = i.toString();
       TableBtn.styleName = "btnReservation";
       TableBtn.addEventListener(MouseEvent.CLICK, RoomClick);
       
    var DetScn:Label = new Label();
    DetScn.text = "";//i.toString();
    DetScn.name = "PriceLbl"+RoomInfoArr[i].idx.toString();
    DetScn.x = PosX+30;
    DetScn.y = PosY+ControlHeight/2;
    DetScn.width = ControlWidth;
    DetScn.styleName = "ReservationDetail";
    IdCanvasBtn.addChild(DetScn);
    
    var DetScn2:Label = new Label();
    DetScn2.text = "";//i.toString();
    DetScn2.name = "PatientLbl"+RoomInfoArr[i].idx.toString();
    DetScn2.x = PosX+30;
    DetScn2.y = PosY+ControlHeight/2+15;
    DetScn2.width = ControlWidth;
    DetScn2.styleName = "ReservationDetail";
    IdCanvasBtn.addChild(DetScn2);
    
       IdCanvasBtn.addChildAt(TableBtn,0);
      }
  }      
     public function getStatusByDate():void
     {
      var SDate:Date = fnGetSelectedDateFromTargetDC(DC);
         var SQLSDate:String = fnFlexDateToSqlDate(SDate);
         var SQLEDate:String = fnFlexDateToSqlDateDateAdd(SDate,1);
         var DateArr:Array = SQLSDate.split("-");
         IdReservationTitle.text = DateArr[0].toString()+"년 "+DateArr[1].toString()+"월 "+DateArr[2].toString()+"일 예약현황";
         
         gateway.wsdl = SUrl + "Reservation.asmx?wsdl";
    gateway.loadWSDL();
    gateway.GetDateTotalStatusByDate.addEventListener(ResultEvent.RESULT, getStatusByDate_Result);
    gateway.addEventListener(FaultEvent.FAULT, faultevent);
    gateway.GetDateTotalStatusByDate(SQLSDate, SQLEDate);
     }
     private function getStatusByDate_Result(e:ResultEvent):void
     {
      //상단 정보 가져오기
      var table:* = e.result.Tables.dt0.Rows;
      var todayCnt:Number = 0;
      var todayPrice:Number = 0;
      var todayWaitCnt:Number = 0;
      var todayWaitPrice:Number = 0;
      var todayOptCnt:Number = 0;
      var todayOptPrice:Number = 0;
      for (var i:Number=0;i<table.length;i++)
      {
       if (Number(table[i].iSTATUS.toString()) == 1)
       {
        todayCnt = Number(table[i].CNT.toString());
        todayPrice = Number(table[i].TOTPRICE.toString());
        todayOptCnt = Number(table[i].OPCNT.toString());
        todayOptPrice = Number(table[i].OPSUM.toString());
       }
       if (Number(table[i].iSTATUS.toString()) == 2)
       {
        todayWaitCnt = Number(table[i].CNT.toString());
        todayWaitPrice = Number(table[i].TOTPRICE.toString());
       }
      }
      IdTodayReservation.text = todayCnt.toString()+"건 ("+changeNumToFormattedPrice(todayPrice)+") / 대기현황 :"+todayWaitCnt.toString()+"건 (미입금:"+changeNumToFormattedPrice(todayWaitPrice)+")";
      IdTodayReservationOption.text = todayOptCnt.toString()+"건 ("+changeNumToFormattedPrice(todayOptPrice)+")";
      
      //하단 버튼 정보 가져오기.
      getDetailStatusByDate();
     }
    
     public function getDetailStatusByDate():void
     {
      var SDate:Date = fnGetSelectedDateFromTargetDC(DC);
         var SQLSDate:String = fnFlexDateToSqlDate(SDate);
         
         gateway.wsdl = SUrl + "Reservation.asmx?wsdl";
    gateway.loadWSDL();
    gateway.GetReservationStatusByDate.addEventListener(ResultEvent.RESULT, getDetailStatusByDate_Result);
    gateway.addEventListener(FaultEvent.FAULT, faultevent);
    gateway.GetReservationStatusByDate(SQLSDate, PartId);
     }
     private function getDetailStatusByDate_Result(e:ResultEvent):void
     {
      RemoveRoomInfo();
      //정보 가져오기
      var table:* = e.result.Tables.dt0.Rows;
      for (var i:Number=0;i<table.length;i++)
      {
       for (var j:Number=0;j<RoomInfoArr.length;j++)
       {
        if ( Number(RoomInfoArr[j].idx.toString()) == Number(table[i].RoomIDX.toString()) )
        {
         var Obj:Object = IdCanvasBtn.getChildByName("PriceLbl"+table[i].RoomIDX.toString());
         var Obj2:Object = IdCanvasBtn.getChildByName("PatientLbl"+table[i].RoomIDX.toString());
         Obj.text = changeNumToFormattedPrice(Number(table[i].TotPrice.toString())) + "원";
         Obj2.text = table[i].NMName.toString();
        }
       }
      }
     }
     public function RemoveRoomInfo():void
     {
      for (var i:Number = 0 ; i <TableLength ; i++)
      {
       var Obj:Object = IdCanvasBtn.getChildByName("PriceLbl"+RoomInfoArr[i].idx.toString());
    var Obj2:Object = IdCanvasBtn.getChildByName("PatientLbl"+RoomInfoArr[i].idx.toString());
    Obj.text = "";
    Obj2.text = "";
      }
     }
     private function RoomClick(e:MouseEvent):void
     {
      fnRefreshData();
      ClickProcess(e.target.name.toString());
     }
     public function fnRefreshData():void
     {
      try
      {
       ArrIdOptionGrid = new Array();
    ArrIdMiniBarGrid = new Array();
    ArrIdCelerbrateGrid = new Array();
    IdOptionGrid.dataProvider = ArrIdOptionGrid;
    IdMiniBarGrid.dataProvider = ArrIdMiniBarGrid;
    IdCelerbrateGrid.dataProvider = ArrIdCelerbrateGrid;
      }
      catch(e:Error){}
     }
     public function ClickProcess(id:String):void
     {
      var RoomIdx:String = id.replace("TblBtn","");
      DetailBasic.visible = true;
      getRoomInfoPanel(RoomIdx,fnFlexDateToSqlDate(fnGetSelectedDateFromTargetDC(DC)));
     }
     public function getRoomInfoPanel(RoomIdx:String,TargetDate:String):void
     {
      gateway.wsdl = SUrl + "Reservation.asmx?wsdl";
    gateway.loadWSDL();
    gateway.GetRoomInfoByDateAndRoom.addEventListener(ResultEvent.RESULT, getRoomInfoPanel_Result);
    gateway.addEventListener(FaultEvent.FAULT, faultevent);
    gateway.GetRoomInfoByDateAndRoom(TargetDate,RoomIdx, PartId);
     }
     public var pTotPrice:Number = 0;
     private function getRoomInfoPanel_Result(e:ResultEvent):void
     {
      var table:* = e.result.Tables.dt0.Rows;
      var TotPrice:Number = 0;
      var OptionPrice:Number = 0;
      var RoomPrice:Number = 0;
      if (table.length>0)
      {
       for (var i:Number=0;i<table.length;i++)
       {
        IdDtRoomNameBasic.text = table[0].ROOMNAME.toString();
     IdDtRoomDurationBasic.text = fnSQLDateToPrineDate(table[0].SDATE.toString())+"~"+fnSQLDateToPrineDate(table[0].EDATE.toString());
     IdDtRoomPatientBasic.text = table[0].NAME.toString();
     IdDtRoomPersonBasic.text = table[0].MaxCapacity.toString()+"명";
     TotPrice = Number(table[0].TOTPRICE.toString());
     try
        {
         OptionPrice = OptionPrice + Number(table[i].OPTIONPRICE.toString());
         
         var Obj:Object = new Object();
         Obj.MenuName = table[i].OPTIONNAME.toString();
         Obj.PriceEA = changeNumToFormattedPrice(Number(table[i].OPTIONPRICE.toString()));
         Obj.Quantity = "1";
         Obj.Price = changeNumToFormattedPrice(Number(table[i].OPTIONPRICE.toString()));
         ArrIdOptionGrid.push(Obj);
        }
        catch(e:Error){}
       }
       //IdOptionGrid.dataProvider = ArrIdOptionGrid;
       IdRoomPriceBasic.text = changeNumToFormattedPrice(TotPrice-OptionPrice)+"원";
    IdRoomOptionBasic.text = changeNumToFormattedPrice(OptionPrice)+"원";
    IdTotPriceBasic.text = changeNumToFormattedPrice(TotPrice)+"원";
    pTotPrice = TotPrice;
    
    vRoomPrice = TotPrice-OptionPrice;
    vTotalPrice = TotPrice;
    vOptionPrice = OptionPrice;
    
    calcDetail();
      }
  }
  
  public var vRoomPrice:Number = 0;
     public var vTotalPrice:Number = 0;
     public var vOptionPrice:Number = 0;
     public var vBarPrice:Number = 0;
     public var vCelePrice:Number = 0;
    
  public var MemFlag:String = "";
  public function getMenuAdd(strPartID:String,strFlag:String):void
     {
      
      gateway.wsdl = SUrl + "Reservation.asmx?wsdl";
    gateway.loadWSDL();
    gateway.GetCafeMenuList.addEventListener(ResultEvent.RESULT, GetCafeMenuList_Result);
    gateway.addEventListener(FaultEvent.FAULT, faultevent);
    gateway.GetCafeMenuList(strPartID,strFlag);
    
    MemFlag = strFlag;
     }
     private function GetCafeMenuList_Result(e:ResultEvent):void
     {
      var table:* = e.result.Tables.dt0.Rows;
      DGMenu.dataProvider = table;
     }
     [Bindable]
     public var ArrIdOptionGrid:Array = new Array();
     [Bindable]
     public var ArrIdMiniBarGrid:Array = new Array();
     [Bindable]
     public var ArrIdCelerbrateGrid:Array = new Array();
     public function RemoveSelectedMenu(Flag:String):void
     {
      var tString:String = "";
      if (Flag=='option')
      {
       tString = "IdOptionGrid";
      }
      if (Flag=='MiniBar')
      {
       tString = "IdMiniBarGrid";
      }
      if (Flag=='Cele')
      {
       tString = "IdCelerbrateGrid";
      }
      var IdMenuGrid:DataGrid = this[tString];
      var tArr:Array = this["Arr"+tString];
      if (IdMenuGrid.selectedIndex.toString()!="-1")
      {
       var selectedMenuIdx:Number = Number(IdMenuGrid.selectedIndex.toString());//선택된 행 가져오기
       //선택된 행 Remove
       tArr.splice(selectedMenuIdx,1);
       this[tString].dataProvider = tArr;
      }
      else
      {
       Alert.show("메뉴를 선택하신 후 삭제버튼을 눌러주세요.");
      }
      calcDetail();
     }
     public function SelectMenu():void
        { 
         var tString:String = "";
         if (MemFlag=='option')
      {
       tString = "IdOptionGrid";
      }
      if (MemFlag=='MiniBar')
      {
       tString = "IdMiniBarGrid";
      }
      if (MemFlag=='Cele')
      {
       tString = "IdCelerbrateGrid";
      }
      
         var tArr:Array = this["Arr"+tString];//AnalysisArrToMenuGrid(Number(SelectedTable));
         var Obj:Object = new Object();
   Obj.MenuName = DGMenu.selectedItem.MenuName.toString();
   Obj.PriceEA = DGMenu.selectedItem.Price.toString();
   Obj.Quantity = IdMenuQuantity.text;
   Obj.Price = Number(DGMenu.selectedItem.Price.toString()) * Number(IdMenuQuantity.text);
   Obj.MenuId = DGMenu.selectedItem.Idx.toString();
   //Obj.Option = Option;
   tArr.push(Obj);
   this[tString].dataProvider = tArr;
   calcDetail();
        }
        public function calcDetail():void
        {
         vOptionPrice=0;
         for(var i:Number=0;i<ArrIdOptionGrid.length;i++)
         {
          vOptionPrice = vOptionPrice + changeFormattedPriceToNum(ArrIdOptionGrid[i].Price);
         }
         vBarPrice=0;
         for(var i:Number=0;i<ArrIdMiniBarGrid.length;i++)
         {
          vBarPrice = vBarPrice + Number(ArrIdMiniBarGrid[i].Price);
         }
         vCelePrice=0;
         for(var i:Number=0;i<ArrIdCelerbrateGrid.length;i++)
         {
          vCelePrice = vCelePrice + Number(ArrIdCelerbrateGrid[i].Price);
         }
         vTotalPrice = vRoomPrice + vOptionPrice + vBarPrice + vCelePrice;
         IdRoomPriceBasic.text = changeNumToFormattedPrice(vRoomPrice) + " 원";
         IdRoomOptionBasic.text = changeNumToFormattedPrice(vOptionPrice) + " 원";
         IdRoomMini.text = changeNumToFormattedPrice(vBarPrice) + " 원";
         IdRoomCele.text = changeNumToFormattedPrice(vCelePrice) + " 원";
         IdTotPriceBasic.text = changeNumToFormattedPrice(vTotalPrice) + " 원";
        }
       

//예약모듈

        public function getScheduleCheck():void{
         try{
          var Duration:Number = Number(IdDuration.selectedItem["data"]);
          var tYear:String = dc1.selectedDate.fullYearUTC.toString();
          var tMonth2:Number = Number(dc1.selectedDate.month.toString())+1;
          var tMonth:String = tMonth2.toString();
          var tDate:String = dc1.selectedDate.date.toString();
          var TString:String = tMonth + "/" + tDate + "/" + tYear;
          var SelectedDate:Date = new Date(TString);
          
          var milliseconds:Number = Date.parse(SelectedDate);
          //Alert.show(milliseconds.toString())
          
          var Reservationable:Boolean = true;
          if (Duration > 1){
           for (var i:int=0; i<Duration; i++)
           {
            var CheckDate:Number = milliseconds + (i*86400000);
            var dateTypeDate:Date = new Date(CheckDate);
            
            if (ReservationStatusString.indexOf(dateTypeDate.toString())>0 && Reservationable == true)
            {
             Alert.show("이미 예약이 완료된 일정입니다. \n 다른 일정을 예약하십시요.");
             IdDuration.setFocus();
             Reservationable = false;
            }
           }
          }
          //예약 계산
          calc();
         }
   catch (err:Error) {
   }
        }
       
        public function calc():void
        {
         try{
          
          var Duration:Number = IdDuration.selectedItem.data;
          //Person = parseInteger(IdPerson.selectedItem["data"].toString());
          
          //1.선택일 가져오기
          var selDate:Date = new Date(dc1.selectedDate.toString());
          var milliseconds:Number = Date.parse(selDate);
          var EndDateMilli:Number = milliseconds + (Duration*86400000);
          var EndDate:Date = new Date(EndDateMilli);
          
          gateway.wsdl = SUrl + "Reservation.asmx?wsdl";
     gateway.loadWSDL();
     gateway.GetReservationHLByMonth.addEventListener(ResultEvent.RESULT, calc2);
     gateway.addEventListener(FaultEvent.FAULT, faultevent);
     gateway.GetReservationHLByMonth(fnFlexDateToSqlDate(selDate), fnFlexDateToSqlDate(EndDate));
          
         }catch(e:Error){}
        }
        private function calc2(e:ResultEvent):void{
         var table:* = e.result.Tables.dt0.Rows;
         var RoomPrice:Number = 0;
         var Person:Number = Number(IdPerson.selectedItem["data"].toString());
         for (var i:Number=0;i<table.length;i++)
         {
          if (table[i].HL.toString() == "1")
          {
           //최하
           var TPrice:Number = Number(RoomInfoArr[SelectedRoomIdx].PriceNormalWeekday.toString());
          }
          if (table[i].HL.toString() == "2")
          {
           //중간
           var TPrice:Number = Number(RoomInfoArr[SelectedRoomIdx].PriceNormalWeekend.toString());
          }
          if (table[i].HL.toString() == "3")
          {
           //최고
           var TPrice:Number = Number(RoomInfoArr[SelectedRoomIdx].PriceBusyWeekend.toString());
          }
          RoomPrice = RoomPrice + TPrice;
          RoomPrice = RoomPrice + (25000*(Person-2));
         }
         vRoomPrice = RoomPrice;
         calcDetail();
        }
        public var SelectedRoomIdx:Number = 0;
        private function fnSetRoomSelect(e:MouseEvent):void{
         var Idx:Number = e.target.id.toString();
         var ArrIdx:Number = 0;
         for (var i:Number=0;i<RoomInfoArr.length;i++)
         {
          if (Number(RoomInfoArr[i].idx.toString()) == Idx)
          {ArrIdx = i;SelectedRoomIdx=i;}
         }
         
         var varMaxPerson:Number = Number(RoomInfoArr[ArrIdx].MaxCapacity.toString());
         var TempArr:Array = new Array();
         for (var j:int = 2; j<varMaxPerson + 1;j++)
         {
          var Obj:Object = new Object();
          Obj.label = j.toString() + "명";
          Obj.data = j;
          TempArr.push(Obj);
         }
         IdPerson.dataProvider = TempArr;
        
         gateway.wsdl = SUrl + "Reservation.asmx?wsdl";
    gateway.loadWSDL();
    gateway.GetRoomReservationStatusByRoomID.addEventListener(ResultEvent.RESULT, GetRoomReservationStatusByRoomID_Result);
    gateway.addEventListener(FaultEvent.FAULT, faultevent);
    gateway.GetRoomReservationStatusByRoomID(Idx, PartId);
        }
        public var ReservationStatusArray:ArrayCollection = new ArrayCollection();
        public var ReservationStatusString:String = "";
        private function GetRoomReservationStatusByRoomID_Result(e:ResultEvent):void
        {
         var table:* = e.result.Tables.dt0.Rows;
         ReservationStatusArray = table;
         
         ReservationStatusString = "";
   var dateRanges:Array = [];
   for (var i:int=0; i<ReservationStatusArray.length; i++) {
    var SDate:Date = new Date(ReservationStatusArray[i].SDate);
    var EDate:Date = new Date(ReservationStatusArray[i].EDate);
    var cDateObject:Object = {rangeStart:SDate, rangeEnd:EDate};
    dateRanges.push(cDateObject);
    
    if(SDate.toString() == EDate.toString())
    {
     ReservationStatusString = ReservationStatusString + "|" + SDate.toString();
    }
    else
    {
     var SDateMilli:Number = Date.parse(SDate);
     var EDateMilli:Number = Date.parse(EDate);
     for (var milli:Number = SDateMilli;milli<EDateMilli+1;milli=milli+86400000)
     {
      var ConvertedDate:Date = new Date(milli);
      ReservationStatusString = ReservationStatusString + "|" + ConvertedDate.toString();
     }
    }
   }
        }
        public function getRoomStatus():void
        {
         setRoomList(fnFlexDateToSqlDate(fnGetSelectedDateFromTargetDC(dc1)));
        }
        public function ActReceipt(Method:String):void
     {
      /*
      gateway.wsdl = SUrl + "CafePOS.asmx?wsdl";
    gateway.loadWSDL();
    gateway.ActReceiptReservation.addEventListener(ResultEvent.RESULT, ActReceipt_Result);
    gateway.addEventListener(FaultEvent.FAULT, faultevent);
    for(var i:Number=0;i<ArrIdOptionGrid.length;i++)
         {
          vOptionPrice = vOptionPrice + changeFormattedPriceToNum(ArrIdOptionGrid[i].Price);
         }
         vBarPrice=0;
         for(var i:Number=0;i<ArrIdMiniBarGrid.length;i++)
         {
          vBarPrice = vBarPrice + Number(ArrIdMiniBarGrid[i].Price);
         }
         vCelePrice=0;
         for(var i:Number=0;i<ArrIdCelerbrateGrid.length;i++)
         {
          vCelePrice = vCelePrice + Number(ArrIdCelerbrateGrid[i].Price);
         }
    //gateway.ActReceiptReservation(ReservationIdx,Price,Menu,Room,PartId);
    */
     }
     private function ActReceipt_Result(e:ResultEvent):void
     {
      /*
      currentState = '';
      TablePrice[Number(SelectedTable)].Menu = "";
      TablePrice[Number(SelectedTable)].Room = "";
      TablePrice[Number(SelectedTable)].RoomName = "";
      TablePrice[Number(SelectedTable)].Price = "";
      TableUIProcess(Number(SelectedTable));
      //버튼 적용
      setPricePrint(Number(SelectedTable));
      //updateUI();
      */
     }
  ]]>
 </mx:Script>
 <mx:DateChooser x="86" y="187" width="400" height="273" styleName="ReservationDC" dayNames="[일,월,화,수,목,금,토]"
  yearSymbol="년" monthNames="[1월,2월,3월,4월,5월,6월,7월,8월,9월,10월,11월,12월]"  cornerRadius="16" borderColor="#E5E8EB"
   change="getStatusByDate();" id="DC"/>
 <mx:Label x="806" y="198" text="2008년 11월 11일 예약현황" id="IdReservationTitle" styleName="ReservationTitle" fontSize="20"/>
 <mx:Label x="554" y="255" text="당일손님 : " styleName="ReservationDetail"/>
 <mx:Label x="636" y="254.95" text=" / 대기현황 :" id="IdTodayReservation" styleName="ReservationDetail" width="678"/>
 <mx:Label x="636" y="288" text="" id="IdTodayReservationOption" styleName="ReservationDetail" width="678"/>
 <!--mx:Label x="702" y="321" text="앤,잔느,로테,알리사" id="IdNextReservationable" styleName="ReservationDetail" width="612"/-->
 <mx:Label x="554" y="288" text="부가옵션 : " styleName="ReservationDetail"/>
 <!--mx:Label x="554" y="321" text="익일 예약가능 객실 : " styleName="ReservationDetail"/-->
 <!--Common-->
 <mx:CurrencyFormatter id="currFormatter" alignSymbol="right" 
     currencySymbol=""
     decimalSeparatorFrom="."
     decimalSeparatorTo="."
     precision="-1"
     rounding="none"
     thousandsSeparatorFrom=","
     thousandsSeparatorTo=","
     useNegativeSign="true"
     useThousandsSeparator="true"
  />   
 <!--Common-->
 <mx:Button x="65" y="78" upSkin="@Embed(source='img/btnGoCafe_Reservation.png')" downSkin="@Embed(source='img/btnGoCafe_Reservation.png')" overSkin="@Embed(source='img/btnGoCafe_Reservation.png')" click="parentDocument.currentState='Cafe';"/>
 <mx:Canvas x="108" y="527" width="1269" height="254" id="IdCanvasBtn">
 </mx:Canvas>
 <mx:Canvas x="86" y="187" width="665" height="574" id="DetailBasic" visible="false" backgroundImage="@Embed(source='img/DetailPnlBack.png')">
  <mx:Button x="579" y="23" width="60" height="19" overSkin="@Embed(source='img/btnClose_1.png')" upSkin="@Embed(source='img/btnClose_1.png')" downSkin="@Embed(source='img/btnClose_2.png')" click="DetailBasic.visible=false;"/>
  <mx:Label x="31" y="97" text="객실명 : " styleName="ReservationDetail" fontSize="12"/>
  <mx:Label x="81" y="97" styleName="ReservationDetail" fontSize="12" width="211" id="IdDtRoomNameBasic"/>
  <mx:Label x="31" y="123" text="투숙기간 : " styleName="ReservationDetail" fontSize="12"/>
  <mx:Label x="93" y="123" styleName="ReservationDetail" fontSize="12" width="216" id="IdDtRoomDurationBasic"/>
  <mx:Label x="31" y="148" text="예약자 : " styleName="ReservationDetail" fontSize="12"/>
  <mx:Label x="83" y="148" styleName="ReservationDetail" fontSize="12" width="209" id="IdDtRoomPatientBasic"/>
  <mx:Label x="31" y="173" text="숙박인원 : " styleName="ReservationDetail" fontSize="12"/>
  <mx:Label x="94" y="173" styleName="ReservationDetail" fontSize="12" width="149" id="IdDtRoomPersonBasic"/>
  <mx:Label x="31" y="232" text="객실료" styleName="ReservationDetailTitle"/>
  <mx:Label x="31" y="258" text="선택사항" styleName="ReservationDetailTitle"/>
  <mx:Label x="95" y="232" styleName="ReservationDetailTitle" textAlign="right" width="180" id="IdRoomPriceBasic"/>
  <mx:Label x="95" y="260" styleName="ReservationDetailTitle" textAlign="right" width="180" id="IdRoomOptionBasic"/>
  <mx:Label x="31" y="289" text="미니바" styleName="ReservationDetailTitle"/>
  <mx:Label x="95" y="290" styleName="ReservationDetailTitle" textAlign="right" width="180" id="IdRoomMini"/>
  <mx:Label x="31" y="321" text="기념품" styleName="ReservationDetailTitle"/>
  <mx:Label x="95" y="322" styleName="ReservationDetailTitle" textAlign="right" width="180" id="IdRoomCele"/>
  <mx:Label x="95" y="440" fontSize="24" width="182" id="IdTotPriceBasic" text="0" color="#840101" textAlign="right"/>
  <mx:Button x="196" y="484" width="90" height="39" overSkin="@Embed(source='img/BtnCardDT_1.png')" upSkin="@Embed(source='img/BtnCardDT_1.png')" downSkin="@Embed(source='img/BtnCardDT_2.png')"/>
  <mx:Button x="99" y="484" width="90" height="39" overSkin="@Embed(source='img/BtnCashDT_1.png')" upSkin="@Embed(source='img/BtnCashDT_1.png')" downSkin="@Embed(source='img/BtnCashDT_2.png')"/>
  <mx:Accordion x="332" y="55" width="307" height="487" styleName="Detail">
   <mx:Canvas label="객실료" width="100%" height="100%" id="IdAccordian">
    <mx:DateChooser id="dc1" x="10" y="6" styleName="ReservationDC" width="285" height="240.6" dayNames="[일,월,화,수,목,금,토]"
     yearSymbol="년" monthNames="[1월,2월,3월,4월,5월,6월,7월,8월,9월,10월,11월,12월]" change="getRoomStatus"/>
    <mx:ComboBox x="10" y="356" dataProvider="{ArrDuration}" id="IdDuration" width="84"/><!-- change="getScheduleCheck();calc();"></mx:ComboBox-->
    <mx:ComboBox x="102" y="356" id="IdPerson" width="72.5"/><!-- change="calc();"/-->
    <mx:Button x="244" y="355" label="예약" click="getScheduleCheck();"/>
    <mx:Canvas x="8" y="250.6" width="289" height="103.4" id="IdRoomList">
    </mx:Canvas>
   </mx:Canvas>
   <mx:Canvas label="선택사항" width="100%" height="100%" id="canvas1" x="-6" y="342">
    <mx:DataGrid x="10" y="44" width="275" id="IdOptionGrid" styleName="OrderedMenu" height="332" dataProvider="{ArrIdOptionGrid}">
     <mx:columns>
      <mx:DataGridColumn headerText="메뉴" dataField="MenuName" width="130"/>
      <mx:DataGridColumn headerText="-" dataField="PriceEA" width="60"/>
      <mx:DataGridColumn headerText="-" dataField="Quantity" width="20"/>
      <mx:DataGridColumn headerText="가격" dataField="Price" width="60"/>
     </mx:columns>
    </mx:DataGrid>
    <mx:Button x="149" y="10" click="IdMenupan.visible=true;getMenuAdd(PartId,'option');" width="64" height="26"  upSkin="@Embed(source='img/btnMenuAdd_1.png')" overSkin="@Embed(source='img/btnMenuAdd_1.png')" downSkin="@Embed(source='img/btnMenuAdd_2.png')"/>
    <mx:Button x="221" y="10" click="RemoveSelectedMenu('option');" width="64" height="26"  upSkin="@Embed(source='img/btnMenuDel_1.png')" overSkin="@Embed(source='img/btnMenuDel_1.png')" downSkin="@Embed(source='img/btnMenuDel_2.png')"/>
   </mx:Canvas>
   <mx:Canvas label="미니바" width="100%" height="100%">
    <mx:DataGrid x="10" y="44" width="275" id="IdMiniBarGrid" styleName="OrderedMenu" height="332" dataProvider="{ArrIdMiniBarGrid}">
     <mx:columns>
      <mx:DataGridColumn headerText="메뉴" dataField="MenuName" width="130"/>
      <mx:DataGridColumn headerText="-" dataField="PriceEA" width="60"/>
      <mx:DataGridColumn headerText="-" dataField="Quantity" width="20"/>
      <mx:DataGridColumn headerText="가격" dataField="Price" width="60"/>
     </mx:columns>
    </mx:DataGrid>
    <mx:Button x="149" y="10" click="IdMenupan.visible=true;getMenuAdd(PartId,'MiniBar');" width="64" height="26"  upSkin="@Embed(source='img/btnMenuAdd_1.png')" overSkin="@Embed(source='img/btnMenuAdd_1.png')" downSkin="@Embed(source='img/btnMenuAdd_2.png')"/>
    <mx:Button x="221" y="10" click="RemoveSelectedMenu('MiniBar');" width="64" height="26"  upSkin="@Embed(source='img/btnMenuDel_1.png')" overSkin="@Embed(source='img/btnMenuDel_1.png')" downSkin="@Embed(source='img/btnMenuDel_2.png')"/>
   </mx:Canvas>
   <mx:Canvas label="기념품" width="100%" height="100%">
    <mx:DataGrid x="10" y="44" width="275" id="IdCelerbrateGrid" styleName="OrderedMenu" height="332" dataProvider="{ArrIdCelerbrateGrid}">
     <mx:columns>
      <mx:DataGridColumn headerText="메뉴" dataField="MenuName" width="130"/>
      <mx:DataGridColumn headerText="-" dataField="PriceEA" width="60"/>
      <mx:DataGridColumn headerText="-" dataField="Quantity" width="20"/>
      <mx:DataGridColumn headerText="가격" dataField="Price" width="60"/>
     </mx:columns>
    </mx:DataGrid>
    <mx:Button x="149" y="10" click="IdMenupan.visible=true;getMenuAdd(PartId,'Cele');" width="64" height="26"  upSkin="@Embed(source='img/btnMenuAdd_1.png')" overSkin="@Embed(source='img/btnMenuAdd_1.png')" downSkin="@Embed(source='img/btnMenuAdd_2.png')"/>
    <mx:Button x="221" y="10" click="RemoveSelectedMenu('Cele');" width="64" height="26"  upSkin="@Embed(source='img/btnMenuDel_1.png')" overSkin="@Embed(source='img/btnMenuDel_1.png')" downSkin="@Embed(source='img/btnMenuDel_2.png')"/>
   </mx:Canvas>
  </mx:Accordion>
 </mx:Canvas>
 
 <mx:Panel x="743" y="226" width="303" height="500" layout="absolute" title="Menu" styleName="Cafe" backgroundImage="@Embed(source='img/pnlMenu.png')"
  id="IdMenupan" visible="false">
  <mx:DataGrid x="18" y="76" width="275" height="251" id="DGMenu"  styleName="getMenu"><!--change="SelectMenuOption();"-->
   <mx:columns>
    <mx:DataGridColumn headerText="메뉴" width="300" dataField="MenuName"/>
    <mx:DataGridColumn headerText="가격" width="200" dataField="Price"/>
    <mx:DataGridColumn headerText="Idx" dataField="idx" visible="false"/>
    <mx:DataGridColumn headerText="IsOption" dataField="IsOption" visible="false"/>
   </mx:columns>
  </mx:DataGrid>
  <mx:Button x="137" y="431" width="81" height="41" click="SelectMenu();IdMenupan.visible=false;" upSkin="@Embed(source='img/btnConfirm_1.png')" overSkin="@Embed(source='img/btnConfirm_1.png')" downSkin="@Embed(source='img/btnConfirm_2.png')"/>
  <mx:Button x="213" y="431.2" click="IdMenupan.visible=false;" width="81" height="41" upSkin="@Embed(source='img/btnCancel_1.png')" overSkin="@Embed(source='img/btnCancel_1.png')" downSkin="@Embed(source='img/btnCancel_2.png')"/>
  
  
  <mx:Button x="128" y="345"  width="33" height="33" click="IdMenuQuantity.text='1';"  upSkin="@Embed(source='img/1_1.png')" overSkin="@Embed(source='img/1_1.png')" downSkin="@Embed(source='img/1_2.png')"/>
  <mx:Button x="169" y="345"  width="33" height="33" click="IdMenuQuantity.text='2';"  upSkin="@Embed(source='img/2_1.png')" overSkin="@Embed(source='img/2_1.png')" downSkin="@Embed(source='img/2_2.png')"/>
  <mx:Button x="210" y="345"  width="33" height="33" click="IdMenuQuantity.text='3';" upSkin="@Embed(source='img/3_1.png')" overSkin="@Embed(source='img/3_1.png')" downSkin="@Embed(source='img/3_2.png')"/>
  <mx:Button x="251" y="345" width="33" height="33" click="IdMenuQuantity.text='4';"  upSkin="@Embed(source='img/4_1.png')" overSkin="@Embed(source='img/4_1.png')" downSkin="@Embed(source='img/4_2.png')"/>
  <mx:Button x="128" y="383" width="33" height="33" click="IdMenuQuantity.text='5';"   upSkin="@Embed(source='img/5_1.png')" overSkin="@Embed(source='img/5_1.png')" downSkin="@Embed(source='img/5_2.png')"/>
  <mx:Button x="169" y="383" width="33" height="33" click="IdMenuQuantity.text='6';"   upSkin="@Embed(source='img/6_1.png')" overSkin="@Embed(source='img/6_1.png')" downSkin="@Embed(source='img/6_2.png')"/>
  <mx:Button x="210" y="383" width="33" height="33" click="IdMenuQuantity.text='7';"  upSkin="@Embed(source='img/7_1.png')" overSkin="@Embed(source='img/7_1.png')" downSkin="@Embed(source='img/7_2.png')"/>
  <mx:Button x="251" y="383" width="33" height="33" click="IdMenuQuantity.text='8';"  upSkin="@Embed(source='img/8_1.png')" overSkin="@Embed(source='img/8_1.png')" downSkin="@Embed(source='img/8_2.png')"/>
  <mx:Label x="30" y="383" styleName="ReservationTitle" id="IdMenuQuantity" width="35" textAlign="center"/>
  <mx:Label x="73" y="383" styleName="ReservationTitle" width="35" textAlign="center" text="개"/>
 </mx:Panel>
</mx:Canvas>

by 애매모애 | 2008/11/16 01:08 | Flex | 트랙백 | 덧글(0)

◀ 이전 페이지          다음 페이지 ▶