Flex 复制内容到粘贴板 Set System Clipboard

Categories: Flex; Tagged with: ; @ October 16th, 2010 12:02

Use:  System.setClipboard(lastShortUrl);

直接Call时, 报错:

Error #2176: Certain actions, such as those that display a pop-up window, may only be invoked upon user interaction, for example by a mouse click or button press.
    at flash.system::System$/setClipboard()

只好加一个"复制"按钮, 在ButtonHandler中set clipboard – 不友好啊不友好…

Flex中使用鼠标状态忙 Set Cursor Busy in Flex

Categories: Flex; Tagged with: ; @ October 16th, 2010 11:43

一直没用过鼠标状态, 都是在忙的时候disable控制UI, 忙完了再enable.  某天看Flex Test Drive, 看上去很好啊:
但是虽然鼠标忙, 但仍旧可以使用, 因此说看上去很美 —- 所以你还是要对控制UI进行Enable/Disable

设置鼠标忙: CursorManager.setBusyCursor();
重置忙状态: CursorManager.removeBusyCursor();

See API: http://help.adobe.com/zh_CN/AS3LCR/Flex_4.0/mx/managers/CursorManager.html

Opensource.adobe.com宕机 恢复时间未定

Categories: Flex; Tagged with: ; @ October 15th, 2010 19:26

今天Adobe高级产品经理Deepa Subramaniam在Flex Team Blog上称"Adobe Open Source 已经宕机一段时间了…"

Some of you may have noticed that Adobe Open Source has been down for some time. The service is currently unavailable as we investigate a critical issue with our server infrastructure. We currently do not have an ETA on restoring service, but I will share more information as it becomes available. I sincerely apologize for this inconvenience.

大概feeds.adobe.com与open source也在一个服务器上, 前几天发现博客上引用的logo断了…What Happened?

无独有偶, 下午看国内Flex开发社区 纬度网 http://wedoswf.com/ 竟然也宕机, 费解. 纬度网的宕机说明:

We’re sorry, but something went wrong.
We’ve been notified about this issue and we’ll take a look at it shortly.

更让人费解的是我平时基本上很少上这些技术站, 最近我发奋图强更新了点知识, 这些网站就扛不住了, 纷纷宕机,  成年人学习点新东西真不容易啊….

使用独立于系统的换行符 System Independent Newline Characters

Categories: Java; Tagged with: ; @ October 14th, 2010 22:42

这几天在写一段处理’代码’的代码, 过程简单: 读取.java源文件的代码, 处理, 写入目标文件.

为了测试简单, 直接使用’\n’作为换行符, Eclipse控制台打印出来无误. 随后写入文件, Windows记事本打开, 空行变多, 不解, 于是拖入Eclipse查看, 显示无误. 但记事本会无端增加空行若干. 极其不解.

Unix. The ‘\n’ character represents the single Unicode character with the value 10 (‘\u000A’) and is used to separate lines in Unix files. This character is also sometimes called linefeed.

Windows. Windows programs often process a ‘\n’ separated text file correctly (NotePad is a exception), but many expect a pair of characters (carriage return followed by line feed = "\r\n") Use the method below to get the newline string that is appropriate for your system.

Mac. In the past, the Apple Mac requirse lines to be separated by ‘\r’, but their move toward Unix (System X) probably means they also accept ‘\n’. I haven’t used a Mac in quite a while tho, so I’m not positive.

我处理的方式是按照Unix换行符’\n’来处理的, 因此在Windows上不管是输入还是输出都会有问题.

System independent value. You can get the value for the system your Java program is running on from the system properties. It is essential to do this with portable programs, and you should always assume your program is portable, eg, that it might run as an applet or using Webstart.

为了保证可移植性, 务必使用: System.getProperty("line.separator")来取得当前系统的换行符.

public static String newline = System.getProperty("line.separator");

See: http://www.ensta.fr/~diam/java/online/notes-java/io/10file/sys-indep-newline.html

Using Ant Zip File 使用Ant打包zip文件

Categories: Flex; Tagged with: ; @ October 14th, 2010 20:05

    <!– =================================
          target:  buildATDZipFile – 指定参与打包的目录或具体文件 – 适用于打包指定的具体目录/文件.
         ================================= –>
    <target name="buildATDZipFile" description="Build Drive zip file.">
          <zip destfile="${DIR_ROOT}/Drive.zip">
            <zipfileset dir="${DIR_ROOT}/src" prefix="${ROOT_NAME}/src" excludes="**/.svn"/>
            <zipfileset dir="${DIR_ROOT}/libs" prefix="${ROOT_NAME}/libs" excludes="**/.svn"/>
            <zipfileset dir="${DIR_ROOT}" includes="OpenInBrowser.bat" fullpath="${ROOT_NAME}/OpenInBrowser.bat"/>
        </zip>
    </target>

Or:

    <!– =================================
          target: buildZipTest 指定排除列表, 直接打包 – 适用于排出部分打包全部.
         ================================= –>
    <target name="buildZipTest" description="description">
        <zip destfile="TestAnt.zip" basedir="${basedir}" excludes="
            *.zip,
            **/.svn/**,
            tomcat/logs/**,
              build/**"></zip>
    </target>

Newer Posts <-> Older Posts



// Proudly powered by Apache, PHP, MySQL, WordPress, Bootstrap, etc,.