Flex读文本文件
布局:
<s:Group id="maskGroup" width="" height="" x="" y="">
<s:Rect width="100%" height="100%">
<s:fill>
<s:SolidColor color="#000000"/>
</s:fill>
</s:Rect>
</s:Group>
<mx:Canvas x="" y="" width="" height="" backgroundColor="#5976A4"
horizontalScrollPolicy="off" verticalScrollPolicy="off">
<s:Scroller id="scrollerId" width="100%" height="100%"
horizontalScrollPolicy="off" interactionMode="touch"
skinClass="skin.libraryIntroduce.ScrollerSkin">
<s:Group x="" y="" width="" height="">
<s:Label id="introTxt" x="" y="" width="" color="#FFFFFF" fontFamily="微软雅黑"
fontSize="" textAlign="left" verticalAlign="top"
mask="{maskGroup}"/>
</s:Group>
</s:Scroller>
</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/))+)*;
introTxt.text=fileStream.readMultiByte(fileStream.bytesAvailable,"gbk");
trace(introTxt.height);
scrollerId.verticalScrollBar.value=;
}
Flex读文本文件的更多相关文章
- vb.net 以读文本文件的方式对XML文件进行遍历
' 对XML文件按照文本文件的方式进行遍历 Private Sub checkFile_establishEntity(strFile As String) Dim reader AsTextR ...
- C++-文件【1】-按行读文本文件的两种方法
测试环境—— 系统:Win7 64bit 编译器:TDM-GCC 4.9.2 64-bit Release #include <iostream> #include <fstream ...
- spring boot + spring batch 读数据库文件写入文本文件&读文本文件写入数据库
好久没有写博客,换了一家新公司,原来的公司用的是spring,现在这家公司用的是spring boot.然后,项目组布置了一个任务,关于两个数据库之间的表同步,我首先想到的就是spring batch ...
- Python读文本文件中文乱问题
file_object = open('thefile.txt')try: all_the_text = file_object.read().decode("gb2312")fi ...
- Python读文本文件
file_object = open('thefile.txt') try: all_the_text = file_object.read() finally: file_object.close( ...
- 用Scanner读文本文件内容
import java.io.File; import java.util.Scanner; class Demo { public static void main(String[] args) t ...
- matlab文件操作及读txt文件(fopen,fseek,fread,fclose)
文件操作是一种重要的输入输出方式,即从数据文件读取数据或将结果写入数据文件.MATLAB提供了一系列低层输入输出函数,专门用于文件操作. 1.文件的打开与关闭 1)打开文件 在读写文件之前,必须先用f ...
- MATLAB文件操作及读txt文件
转自:http://blog.csdn.net/vblittleboy/article/details/8049748 文件操作是一种重要的输入输出方式,即从数据文件读取数据或将结果写入数据文件.MA ...
- 使用python操作json文本文件
使用python读写文本文件内容时,我们知道如果文本文件里的内容无规律,那么修改起来比较麻烦.但是如果文本文件存储是有规律的,比如JSON格式,在利用python内置的函数把JSON格式的数据转成py ...
随机推荐
- Code the Tree
Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 2292 Accepted: 878 Description A tree ...
- angular 项目回顾
从学习angular,到实际项目开发不到一周,完全是边写边学呀,都是为了项目,已使用angular 开发了两个项目了,有些技术当时只是会用,都没好好回顾一下,现在有时间回顾一下,项目中用到的一些指令, ...
- alfresco 5.0 document
http://docs.alfresco.com/community/tasks/imagemagick-config.html
- 两个UIView添加同一个手势只有最后一个有用
首先这个思路是不对的,因为每一个Gesture Recognizer关联一个View,但是一个View可以关联多个Gesture Recognizer,因为一个View可能还能响应多种触控操作方式.当 ...
- postgresql常用SQL
--查看数据库 select * from pg_database; --查看表空间 select * from pg_tablespace; --查看语言 select * from pg_lang ...
- HDU 1978 How many ways (DP)
How many ways Time Limit: 3000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Tot ...
- 【策略】UVa 278 - Chess
Chess Almost everyone knows the problem of putting eight queens on an chessboard such that no Quee ...
- 使用AccessibilityService模拟点击事件失败的分析
使用AccessibilityService模拟点击事件的方法: AccessibilityNodeInfo.performAction(AccessibilityNodeInfo.ACTION_CL ...
- sqlserver关于事务
事务的四个特性: 原子性,一致性,持久性,隔离性 原子性: 原子性:表示事务执行是作为原子,不可分割,整个语句要么执行,要么不执行sqlserver中每一个单独的语句可以看做是包含在事务中每一句本身具 ...
- 【SQLServer】使用T-SQL访问远程数据库:openrowset 和 openquery 以及连接服务器的创建
█ 启用/关闭Ad Hoc Distributed QueriesAd Hoc Distributed Queries服务默认是关闭的,要使用openrowset 和 openquery访问远程数据库 ...