flex 开发的照片书二

来源:互联网 发布:魔兽大脚 mac 编辑:程序博客网 时间:2024/05/09 14:25
 
  1.             import code.*;
  2.             
  3.             import common.PhotoEdit;
  4.             import common.TextEdit;
  5.             
  6.             import data.*;
  7.             
  8.             import flash.display.*;
  9.             import flash.events.MouseEvent;
  10.             import flash.net.URLRequest;
  11.             
  12.             import mx.containers.Canvas;
  13.             import mx.controls.Image;
  14.             import mx.controls.Label;
  15.             import mx.core.Container;
  16.             import mx.core.ScrollPolicy;
  17.             public var currentPhoto:Number = 0  ;//当前的图片
  18.               
  19.             public var currentPageNum:int = 0 ;//当前页码
  20.              
  21.             public var albumdata:XML ;//照片书所有数据 
  22.             public var cmb:String ;//当前模版名称 
  23.                
  24.             public var sourceurl:XML ;//当前资源图片路径
  25.                
  26.             public var currentText:XML ;//当前的文字信息
  27.               
  28.             //public var currentTextArea:TextArea ;//当前所编辑的文本控件
  29.             public var currentLabel:Label ;//======当前文本编辑控件
  30.               
  31.             public static var MAIN:photobook68  ;
  32.             
  33.             public var c:Container ;//加入透明背景
  34.              
  35.              
  36.             public var currentBj:Image = new Image() ;//当前的背景
  37.             
  38.             private var _state:Number= 0 ;//=====图片导入状态,是否为更换版式导入,还是单击图片导入,还是上一页或下一页的导入
  39.             
  40.             public var pid:String ;//==========已保存产品的ID
  41.             public var subject:Canvas ;//==============当前的主题
  42.             public var xmlList:XMLList ;//===============  模板对应的数据
  43.             
  44.             private var labelTip:String ="单击此处,输入文字";//========默认输入文字提示
  45.             
  46.             private var objImgs:Object = new Object () ;//=====image 对象列表
  47.         
  48.             public var _stylename:String ;//            每个主题下面有3种风格
  49.                
  50.             public var _productName:String; //=========保存作品名称
  51.             
  52.             public var productid : Number //===========产品ID
  53.             //==========产品价格
  54.             //[Bindable]
  55.             public var price:Number ;
  56.             public var pagePrice:Number ; 
  57.             
  58.             public var typeFlag:int = 0 ;
  59.              
  60.             //=============用户标识
  61.             public var userID:Number ;
  62.             
  63.             internal function initUI():void{
  64.                 MAIN = this ;   
  65.                 //=============初始化外部参数
  66.                 this.initParams();
  67.                 //=============初始化封面 模板 风格定义的数据
  68.                 this.initXMLData() ;
  69.                  
  70.                 //==========请求获取相册信息
  71.                 this.sendAlbumInfo() ;
  72.                 //=============加载照片书数据
  73.                 this.initXML(pid); 
  74.                 //=============监听模版
  75.                 this.initListener() ;
  76.             }
  77.              
  78.             
  79.             /**============请求获取相册信息================================*/
  80.             private function sendAlbumInfo():void{
  81.                 
  82.                 var obj:Object = new Object() ;
  83.                 obj.random = Math.random() ;
  84.                 obj.handlertype = 1 ; 
  85.                 obj.userID = this.userID ;
  86.                 this.photoselectID.albumNameListId.send(obj);
  87.             }
  88.             
  89.             
  90.             /**==============监听模版====================================*/   
  91.             private function initListener():void{
  92.                 this.currentBj.addEventListener(MouseEvent.CLICK,photoClickHandler);
  93.                 this.currentBj.addEventListener(MouseEvent.DOUBLE_CLICK,doubleClickPhotoHandler);
  94.                 this.currentBj.doubleClickEnabled = true ;
  95.             }
  96.             
  97.             /**==============得到照片书每一页的数据==========================*/    
  98.             public function initXML(pid:String):void{
  99.                 
  100.                 if(pid==null||pid=="null"||pid==""){
  101.                     createDefaultXML() ;
  102.                 }else{
  103.                     var params:Object = new Object() ;
  104.                     params.handlertype = 7 ;
  105.                     params.productrecordid = pid ;
  106.                     productInfoId.send(params);
  107.                 }
  108.             }   
  109.             
  110.              /**加载当前页所需要的数据
  111.              * true :更换版式加载照片时要,要重新计算
  112.              * false: 从xml中获取数据 。
  113.              */
  114.             public function loaderCurrentPageInfo(b:Boolean):void{
  115.                    
  116.                 this.currentPhoto =  0 ;   
  117.                 cmb = this.albumdata.item.bs[this.currentPageNum];//获取当前的版式 
  118.                 sourceurl  = this.albumdata.item.photo[this.currentPageNum]; //当前页所有图片xml
  119.                 this.currentText = this.albumdata.item.txt[this.currentPageNum]; //当前页所有文本信息
  120.                  
  121.                 //tip_txt.text = sourceurl ;
  122.                 this.console.removeAllChildren();
  123.                  
  124.                 var a1:Array = cmb.split("/"); 
  125.             
  126.                    
  127.                 var subject:String = a1[a1.length-3];//=====主题
  128.                 //var mb:String =  a1[a1.length-2] ;   //=====模版或者封面
  129.                 var picname:String = a1[a1.length-1];//=====图片名称
  130.                 
  131.                   
  132.                 //==========得到当前的版式的数据
  133.                 xmlList = this.getXMLData(subject,picname,this.currentPageNum) ;
  134.                 
  135.                 this.subject = new Canvas() ;
  136.                 this.subject.verticalScrollPolicy = ScrollPolicy.OFF ;
  137.                 this.subject.horizontalScrollPolicy = ScrollPolicy.OFF ;
  138.                 
  139.                   
  140.                  
  141.                 //this.subject.width =  564  ;
  142.                 //this.subject.height = 209 ; 
  143.                 this.console.addChild(this.subject) ;
  144.                 
  145.                 initMoBan();   //===============初始化模版
  146.                  
  147.                  
  148.                 for(var i:int=0;i<xmlList.pic.length();i++){
  149.                     
  150.                     var c1:Canvas = new Canvas() ;
  151.                     c1.verticalScrollPolicy = ScrollPolicy.OFF ;
  152.                     c1.horizontalScrollPolicy = ScrollPolicy.OFF ;
  153.                     c1.x = xmlList.pic[i].@x ;
  154.                     c1.y = xmlList.pic[i].@y  ; 
  155.                     c1.width= xmlList.pic[i].@width ;
  156.                     c1.height = xmlList.pic[i].@height ;
  157.                       
  158.                     this.subject.addChild(c1);
  159.                     var _img1:Image = new Image() ;
  160.                     
  161.                     _img1.id = "img"+i;
  162.                     _img1.name = "img"+i;
  163.                     _img1.width = c1.width ;
  164.                     _img1.height = c1.height ; 
  165.                     _img1.scaleContent = true ;
  166.                     this.objImgs["img"+i] = _img1 ;//=======放入数组当中  
  167.                     if(b==true){
  168.                         this.reLoaderPhotoByChangeBs(_img1,i);
  169.                     }else{
  170.                         this.loadPhoto(_img1,i);
  171.                     }
  172.                     
  173.                     c1.addChild(_img1) ;                    
  174.                 }   
  175.                 
  176.                 //========加载文字信息
  177.                 initTextInfo();
  178.                 
  179.                 //========突出当前页数字体
  180.                 this.pagefalgcomId.changeFontStyle();
  181.                  
  182.                 //========切换标签显示
  183.                 this.changembID.changeTab(this.currentPageNum);
  184.                  
  185.                 //========更新滚动条位置
  186.                 this.pagefalgcomId.changeScrollPostition();
  187.             }   
  188.             
  189.             /**===============初始化模板===========================*/
  190.             private function initMoBan():void{
  191.                 //this.currentBj.source = this.albumdata.item.bs[this.currentPageNum] ; 
  192.                 //this.console.addChild(this.currentBj);
  193.                 this.currentBj.source =cmb ;
  194.                 
  195.                 this.console.addChild(this.currentBj); 
  196.                 
  197.             }
  198.             
  199.             private function photoClickHandler(e:MouseEvent):void{
  200.                 var img :Image = null ;
  201.                 for(var i:int=0;i<this.xmlList.pic.length();i++){
  202.                     img = this.objImgs["img"+i];
  203.                     if(img.source==""){
  204.                         continue ;
  205.                     }
  206.                     var b:Boolean =img.hitTestPoint(mouseX,mouseY);
  207.                     if(b==true){
  208.                         //this.photoClickHandler(img) ;
  209.                          
  210.                         this.alphaHandler() ;
  211.                         //var n:Number = Number(img.id.charAt(3)) ;
  212.                                 
  213.                         this.currentPhoto = i ;//当前照片的号码
  214.                         img.alpha = 0.5 ;
  215.                         break ;
  216.                     }
  217.                 }    
  218.                 
  219.             }
  220.               
  221.              /**==============更改背景=============================*/ 
  222.             public function changeFM(fm:String):void
  223.                 //=======修改对于xml数据
  224.                 this.currentPageNum = 0 ;
  225.                 this.albumdata.item.bs[this.currentPageNum] = fm ;
  226.                 this.currentPhoto = 0 ;  
  227.                   
  228.                 this.loaderCurrentPageInfo(true);
  229.                 
  230.             }
  231.              
  232.             /**==============更改版式=============================*/    
  233.             public function changeCurrentBs(bs:String):void{
  234.                  
  235.                 //=======修改对于xml数据
  236.                 this.albumdata.item.bs[this.currentPageNum] = bs ;
  237.                 this.currentPhoto = 0 ;  
  238.                 
  239.                 this.loaderCurrentPageInfo(true);
  240.             }
  241.             
  242.             
  243.             
  244.                         
  245.             /**==============加载已保存产品信息=============================*/    
  246.             public function loadProductInfo():void{
  247.                 albumdata = new XML(productInfoId.lastResult);
  248.                   
  249.                 //tip_txt.text = albumdata.productname ; 
  250.                 //=====得到产品名称 
  251.                 //this._productName = albumdata.productname ;
  252.                 
  253.                 //=====导入当前页的数据
  254.                 this.loaderCurrentPageInfo(false); 
  255.                 //=====初始化选择页列表
  256.                 photobook68.MAIN.pagefalgcomId.initUI() ;
  257.                 this.initPrice() ;
  258.             }       
  259.              
  260.             
  261.             /******========点击右侧照片处理===============================*/   
  262.             public function choosePhotoHandler(e:MouseEvent):void{
  263.                 var i:Image = Image(e.currentTarget) ;
  264.                 var m :String = i.source.toString() ;   
  265.                 m = m.replace("_2","_1") ;     
  266.                   
  267.                 //======当前模板的图片个数  
  268.                 var t:Number = xmlList.pic.length();
  269.                 
  270.                         
  271.                 if(this.currentPhoto>t-1){
  272.                     this.currentPhoto = 0 ;
  273.                 }    
  274.                  
  275.                 //========恢复透明度
  276.                 this.alphaHandler();
  277.                 
  278.                 var img:Image = Image(this.objImgs["img"+this.currentPhoto]);
  279.                 changePhoto(img,m,this.currentPhoto) ; 
  280.             } 
  281.              
  282.             /**
  283.              * 导入图片,对图片进行处理
  284.              * @param img:版式上对应的图片 
  285.              * @photourl:图片地址
  286.              * tx:Number,ty:Number,tw:Number,th:Number
  287.              */   
  288.             public function loadPhoto(img:Image,num:Number):void{
  289.                 var w1:Number, h1:Number, x1:Number,y1:Number,purl:String ; 
  290.                 x1 = this.sourceurl.img[num].@x ;
  291.                 y1 = this.sourceurl.img[num].@y ;
  292.                 w1 = this.sourceurl.img[num].@width ;
  293.                 h1 = this.sourceurl.img[num].@height ;
  294.                 purl = this.sourceurl.img[num].@url ; 
  295.                 
  296.                 if(purl==null||purl==""){
  297.                     return ;
  298.                 } 
  299.                 
  300.                 //=======自动填充时,重新导入照片
  301.                 if(x1==-1){
  302.                     this.reLoaderPhotoByChangeBs(img,num) ;
  303.                     return ;
  304.                 } 
  305.                 var _loader:Loader = new Loader();   
  306.                  
  307.                 _loader.contentLoaderInfo.addEventListener(Event.COMPLETE,function(e:Event):void{
  308.                     var _bitmap:Bitmap = new Bitmap() ;
  309.                     var l:Loader = e.target.loader as Loader;  
  310.          
  311.                     var _bitmapdata:BitmapData = new  BitmapData (l.width,l.height) ;
  312.                     _bitmapdata.draw(l); 
  313.                     var temp:BitmapData  = new BitmapData(w1,h1);
  314.                     //坐标转化,把坐标移到裁剪区域的位置,宽度和高度在cutbitmapdata里指定。  
  315.                     var matrix:Matrix = new Matrix(1, 0, 0, 1, -x1, -y1);   
  316.                     temp.draw(_bitmapdata, matrix);    
  317.                     //_bitmap.   
  318.                     _bitmap.bitmapData = temp ;    
  319.                     img.source = _bitmap ; 
  320.                     img.scaleContent  = true ;
  321.                     photobook68.MAIN.currentPhoto++ ;
  322.                     }); 
  323.                 _loader.load(new URLRequest(purl)); 
  324.             } 
  325.             /**========改变版式时候,重新计算照片位置=========*/
  326.             private function reLoaderPhotoByChangeBs(_img:Image,num:Number):void{
  327.                var photourl:String = sourceurl.img[num].@url ;
  328.                 if(photourl==null||photourl==""){ 
  329.                     return ;
  330.                 } 
  331.                 var w1:Number, h1:Number, x1:Number,y1:Number ;  
  332.                 var p:photobook68 = this ;
  333.                 var _loader:Loader = new Loader();    
  334.                 _loader.load(new URLRequest(photourl));
  335.                  
  336.                 _loader.contentLoaderInfo.addEventListener(Event.COMPLETE,function(e:Event):void{
  337.                     var _bitmap:Bitmap = new Bitmap() ;
  338.                     var l:Loader = e.target.loader as Loader;  
  339.          
  340.                     var _bitmapdata:BitmapData = new  BitmapData (l.width,l.height) ;
  341.                     _bitmapdata.draw(l);  
  342.                     // var s:Number =imgW/imgH ;//模板比例  
  343.                      var s:Number =_img.width/_img.height ;//模板比例  
  344.                     var h2:Number = l.width/s ;//对于在中图上的高     
  345.                     if(h2<=l.height){
  346.                         h1 = h2 ; 
  347.                         w1 = l.width ;
  348.                     }else{    
  349.                         h1 = l.height ; 
  350.                         w1 = h1*s ;
  351.                     }
  352.                      /*缩略图的x ,y*/
  353.                     x1 = (l.width-w1)/2 ; 
  354.                     y1 = (l.height-h1)/2;   
  355.                         
  356.                   
  357.                     var temp:BitmapData  = new BitmapData(w1,h1);
  358.                     //坐标转化,把坐标移到裁剪区域的位置,宽度和高度在cutbitmapdata里指定。  
  359.                     var matrix:Matrix = new Matrix(1, 0, 0, 1, -x1, -y1);   
  360.                     temp.draw(_bitmapdata, matrix);    
  361.                     _bitmap.bitmapData = temp ;   
  362.                      
  363.                     _img.source = _bitmap ; 
  364.                     p.sourceurl.img[num].@x = x1 ;  
  365.                     p.sourceurl.img[num].@y = y1 ; 
  366.                     p.sourceurl.img[num].@width = w1 ;  
  367.                     p.sourceurl.img[num].@height =h1 ; 
  368.                     p.sourceurl.img[num].@url = photourl ;//修改对于xml数据*/
  369.                     photobook68.MAIN.currentPhoto++ ;
  370.                     });             
  371.             }
  372.             /**==============右侧点击改变当前照片===============**/
  373.             private function changePhoto(_img:Image,photourl:String,num:Number):void{
  374.             
  375.              
  376.                //this.tip_txt.text = "photourl=="+photourl+"num=="+num ;
  377.                 var w1:Number, h1:Number, x1:Number,y1:Number ;  
  378.                 var p:photobook68 = this ;
  379.                 var _loader:Loader = new Loader();    
  380.                 _loader.load(new URLRequest(photourl));
  381.                  
  382.                 _loader.contentLoaderInfo.addEventListener(Event.COMPLETE,function(e:Event):void{
  383.                     var _bitmap:Bitmap = new Bitmap() ;
  384.                     var l:Loader = e.target.loader as Loader;  
  385.          
  386.                     var _bitmapdata:BitmapData = new  BitmapData (l.width,l.height) ;
  387.                     _bitmapdata.draw(l); 
  388.                      var s:Number =_img.width /_img.height ;//模板比例 
  389.                 
  390.                     var h2:Number = l.width/s ;//对于在中图上的高     
  391.                     if(h2<=l.height){
  392.                         h1 = h2 ; 
  393.                         w1 = l.width ;
  394.                     }else{    
  395.                         h1 = l.height ; 
  396.                         w1 = h1*s ;
  397.                     }
  398.                      /*缩略图的x ,y*/
  399.                     x1 = (l.width-w1)/2 ; 
  400.                     y1 = (l.height-h1)/2;   
  401.                     var temp:BitmapData  = new BitmapData(w1,h1);
  402.                     //坐标转化,把坐标移到裁剪区域的位置,宽度和高度在cutbitmapdata里指定。  
  403.                     var matrix:Matrix = new Matrix(1, 0, 0, 1, -x1, -y1);   
  404.                     temp.draw(_bitmapdata, matrix);    
  405.                     _bitmap.bitmapData = temp ;   
  406.                     _img.source = _bitmap ; 
  407.                     _img.scaleContent  = true ;
  408.                     p.sourceurl.img[num].@x = x1 ;  
  409.                     p.sourceurl.img[num].@y = y1 ; 
  410.                     p.sourceurl.img[num].@width = w1 ;  
  411.                     p.sourceurl.img[num].@height =h1 ; 
  412.                     p.sourceurl.img[num].@url = photourl ;//修改对于xml数据*/
  413.                     
  414.                     photobook68.MAIN.currentPhoto++ ;
  415.                     }); 
  416.             } 
  417.             
  418.             
  419.             /**==========初始化文字===========*/
  420.             private function initTextInfo():void{
  421.                 for(var i:int=0;i<xmlList.txt.length();i++){
  422.                     var lable:Label = new Label() ;
  423.                     lable.setStyle("fontSize","12"); 
  424.                     //lable.
  425.                     lable.id = "txt"+i ;
  426.                     lable.x = xmlList.txt[i].@x ;
  427.                     lable.y = xmlList.txt[i].@y  ; 
  428.                     lable.width= xmlList.txt[i].@width ;
  429.                     lable.height = xmlList.txt[i].@height ;
  430.                         
  431.                     if(this.currentText.info[i]==""||this.currentText.info[i]==null){
  432.                         lable.text = this.labelTip;
  433.                     }else
  434.                         lable.htmlText = this.currentText.info[i] ;
  435.                     }
  436.                     lable.addEventListener(MouseEvent.CLICK,openRichText) ;
  437.                     this.console.addChild(lable); 
  438.                 } 
  439.             }           
  440.              
  441.             /**==========保存用户输入的文字===========*/
  442.             public function saveTextInfo(t:String,t2:String):void{
  443.                 this.currentLabel.htmlText = t ;  //给文本区域赋值 
  444.                 var tname:String = this.currentLabel.id ;
  445.                 tname = tname.charAt(3) ;   
  446.                if(t2==null||t2.length==0||t2==""){
  447.                    this.currentLabel.text= this.labelTip;   
  448.                } 
  449.                 this.currentText.info[Number(tname)] = this.currentLabel.htmlText;
  450.             }
  451.             
  452.             /**==========打开文字编辑窗口===========*/ 
  453.             public function openRichText(e:MouseEvent):void{
  454.                 var label:Label = Label(e.currentTarget);
  455.                 var rte :TextEdit = new TextEdit() ; 
  456.                 rte.x = 100  ; 
  457.                 rte.y = 100  ;   
  458.                 this.currentLabel = label ;//得到当前编辑文本空间的引用
  459.                 c = new Container() ;
  460.                 c.graphics.beginFill(0x000000); 
  461.                 c.graphics.drawRect(this.x,this.y,this.width,this.height) ;
  462.                 c.graphics.endFill();     
  463.                 c.alpha = 0.3 ;  
  464.                 this.addChild(c);                
  465.                 this.addChild(rte) ;  
  466.                 
  467.                 if(label.text== this.labelTip){
  468.                     rte.my_rte.htmlText ="" ;
  469.                 }else{
  470.                     rte.my_rte.htmlText = label.htmlText ;
  471.                 } 
  472.                 
  473.             } 
  474.             
  475.             /**==========打开照片编辑窗口===========*/ 
  476.             public function editPhotoHandler(_img:Image,url:String,_x:Number,_y:Number,_w:Number,_h:Number):void{
  477.                 /*加入透明效果*/
  478.                 this.addAlphaBackgroud();
  479.                 var photoEdit:PhotoEdit = new PhotoEdit();
  480.                 this.addChild(photoEdit);  
  481.                    
  482.                 photoEdit.x = (this.width  - photoEdit.width)/2 ;
  483.                 photoEdit.y = (this.height - photoEdit.height)/2 ;
  484.                   
  485.                 photoEdit.setParams(_img,_x,_y,_w,_h) ;       
  486.                 photoEdit.img.source = url ;
  487.             } 
  488.             
  489.             
  490.             /*************加入透明背景效果**************************/
  491.             public function addAlphaBackgroud():void{
  492.                 c = new Container() ;
  493.                 c.graphics.beginFill(0x000000); 
  494.                 c.graphics.drawRect(this.x,this.y,this.width,this.height) ;     
  495.                 c.graphics.endFill();     
  496.                 c.alpha = 0.3 ;  
  497.                 this.addChild(c);  
  498.             }
  499.             
  500.             /*************删除透明背景效果**************************/
  501.             public function deleteAlphaBackground():void{
  502.                  
  503.                 this.removeChild(c);
  504.             }
  505.             
  506.             
  507.             /***============鼠标双击照片================*/
  508.             public function doubleClickPhotoHandler(e:MouseEvent):void
  509.                 
  510.                //var img :Image= Image(e.currentTarget) ;   
  511.                //this.photoClickHandler(e) ;
  512.                
  513.                 var img :Image = null ;
  514.                 for(var i:int=0;i<this.xmlList.pic.length();i++){
  515.                     img = this.objImgs["img"+i];
  516.                     if(img.source==""){
  517.                         continue ;
  518.                     }
  519.                     var b:Boolean =img.hitTestPoint(mouseX,mouseY);
  520.                     if(b==true){
  521.                         //this.photoClickHandler(img) ;
  522.                           
  523.                         this.alphaHandler() ;
  524.                         //var n:Number = Number(img.id.charAt(3)) ;
  525.                                  
  526.                         this.currentPhoto = i ;//当前照片的号码
  527.                         //img.alpha = 0.5 ;
  528.                          
  529.                        var url:String = photobook68.MAIN.sourceurl.img[this.currentPhoto].@url ;
  530.                        var x:Number = photobook68.MAIN.sourceurl.img[this.currentPhoto].@x ;
  531.                        var y:Number = photobook68.MAIN.sourceurl.img[this.currentPhoto].@y ;
  532.                        var width:Number = photobook68.MAIN.sourceurl.img[this.currentPhoto].@width ;
  533.                        var height:Number = photobook68.MAIN.sourceurl.img[this.currentPhoto].@height ;
  534.                        
  535.                        photobook68.MAIN.editPhotoHandler(img,url,x,y,width,height); 
  536.                         
  537.                         break ;
  538.                     }
  539.                 }   
  540.             }  
  541.             
  542.             /**================获取当前页的照片张数==============**/
  543.             public function getCurrentPhotoNum(i:Number):Number{
  544.                     var cmb:String = photobook68.MAIN.albumdata.item.bs[i] ;
  545.                     var a1:Array = cmb.split("/");  
  546.                     var subject:String = a1[a1.length-3];//=====主题
  547.                     //var mb:String =  a1[a1.length-2] ;   //=====模版或者封面
  548.                     var picname:String = a1[a1.length-1];//=====图片名称
  549.                     //var xmlList:XMLList = this.getXMLData(subject,picname,i) ; ;
  550. //                  if(i==0){
  551. //                      xmlList=(fengmiandat.mbData.subject.(@name ==subject))..fm.(@picname ==picname);    
  552. //                  } else{  
  553. //                      xmlList=(mobandata68.mbData.subject.(@name ==subject))..mb.(@picname ==picname);
  554. //                  }
  555.                   
  556.                     return  this.getXMLData(subject,picname,i).pic.length();        
  557.             }
  558.   
  559.   
  560.                
  561.             /**================恢复透明度==============**/
  562.             private function alphaHandler():void{
  563.                 var img:Image = null ;
  564.                 for(var i:int=0;i<this.xmlList.pic.length();i++){
  565.                     img =  (this.objImgs["img"+i]);
  566.                     if(img==null||img.source==null){
  567.                         continue ;
  568.                     } 
  569.                     if(img.alpha==0.5){
  570.                         img.alpha = 1 ;
  571.                         break ; 
  572.                     }    
  573.                     //tip_txt.text ="imgname=="+ img.name ;
  574.                 }                                           
  575.             }
  576.             include "XmlDataHandler.as" ;
原创粉丝点击