zoukankan      html  css  js  c++  java
  • Flex读文本文件

    布局:

    1 <s:Group id="maskGroup" width="503" height="332" x="657" y="165">
    2         <s:Rect width="100%" height="100%">
    3             <s:fill>
    4                 <s:SolidColor color="#000000"/>
    5             </s:fill>
    6         </s:Rect>
    7     </s:Group>
     1 <mx:Canvas x="626" y="151" width="565" height="360" backgroundColor="#5976A4"
     2                horizontalScrollPolicy="off" verticalScrollPolicy="off">
     3         <s:Scroller id="scrollerId" width="100%" height="100%"
     4                     horizontalScrollPolicy="off" interactionMode="touch"
     5                     skinClass="skin.libraryIntroduce.ScrollerSkin">
     6             <s:Group x="0" y="0" width="565" height="360">
     7                 <s:Label id="introTxt" x="31" y="14" width="503" color="#FFFFFF" fontFamily="微软雅黑"
     8                          fontSize="20" textAlign="left" verticalAlign="top"
     9                          mask="{maskGroup}"/>
    10             </s:Group>
    11         </s:Scroller>
    12     </mx:Canvas>

    AS:

    var file:File=new File("文本文件的绝对路径");
    if(file2.exists)
                        {
                            var fileStream:FileStream=new FileStream();
                            fileStream.open(file,FileMode.READ);
        //算高度仅供参考                    
    introTxt.height=(Math.floor(Number(fileStream.bytesAvailable/45))+5)*30;
                            introTxt.text=fileStream.readMultiByte(fileStream.bytesAvailable,"gbk");
                            trace(introTxt.height);
                            scrollerId.verticalScrollBar.value=0;
                        }
  • 相关阅读:
    一句话开启XP_CMDSHELL
    CF14B Young Photographer 题解
    sql 存储过程与函数区别
    sql索引
    分区表中毒,重装系统
    面试
    XML范例的应用(转载)
    数据结构题目
    网页加载速度的方法和技巧
    设计模式分类
  • 原文地址:https://www.cnblogs.com/dongyl/p/4021711.html
Copyright © 2011-2022 走看看