动力男孩flash乐园

不抛弃、不放弃,梦想要迂回去实现~!
  • 首页
  • 我的座右铭
  • 我的作品
  • 留言聊天室
  • 动力男孩的诞生

存档

文章标签 ‘air’
623次浏览↓

给图像加水印

2009年10月30日 powerboy 6 条评论

  今天应朋友需求,写了一个简单的图像加水印小软件,这个姑且叫做1.0版本吧,以后还会陆续添加更多功能。

Get Adobe Flash player

分类: air学习笔记 标签: air, as3
1,174次浏览↓

我的AIR处女作——Mp3播放器

2009年2月25日 powerboy 12 条评论

我最近开发的mp3播放器!希望大家帮着测试一下,多多提意见,可以在下面跟帖!
这里提供了测试用的mp3和lrc文件:lrc&MP3.rar

————————— 版本 Beta4.3 —————————

更新日志:
1、更正了在开启“重复AB”模式下,切换歌曲时时间总长度刷新错误的bug
2、更正了当歌曲列表中音乐文件链接失效时不能读取下一首歌的bug

————————— 版本 Beta4.2 —————————

更新日志:
1、修改了加载歌曲算法
2、更正了滚动歌曲名称序号的显示错误
3、更正了清除列表后再添加歌曲但播放序号没有更新的bug
4、重新设计了滑竿样式

————————— 版本 Beta4.1 —————————

新增功能:
1、播放时间正反计时
2、播放模式:5种
3、支持歌曲文件夹拖拽
4、支持打开文件窗口和文件夹窗口(右上角的“+”)添加歌曲
5、文件列表全部清空按钮(右上角的“-”)
另:界面皮肤略有调整

————————— 版本 Beta3.0 —————————

新增功能:
1、添加歌曲:将mp3拖拽到界面内,支持多项拖拽
2、删除歌曲:选中歌曲按del,按住del不放再单击歌曲,则可以连续删除
3、重复ab:直接在重复ab面板拖拽选区
4、歌词同步:单击歌曲列表其中一项,然后拖拽lrc文件到主界面,然后重新播放该歌曲

Get Adobe Flash player

分类: air学习笔记 标签: air, as3, 实验室
511次浏览↓

一个关于AIR透明窗口的问题

2009年2月23日 powerboy 没有评论

经过一系列测试,如果在enterframe里如果做一个简单的效果,比如更新txt文字变化,正常状态下cpu是5%-12%之间,窗口透明的话,cpu在10%-18%之间。但是我做个mp3波形图动画,正常状态下是17%-25%,而透明状态下是37%-55% ,运算量越大,差异越明显。所以说,透明效果如果想要使用的话,还得根据项目需求三思而行。

分类: air学习笔记 标签: air, as3
759次浏览↓

Adobe AIR 1.5 Cookbook出版了

2009年1月13日 powerboy 没有评论

昨天在网上看到了oreilly官网发布AIR1.5 CookBook,太兴奋了,偶要想办法尽快搞到手。
oreilly url:http://oreilly.com/catalog/9780596522506/toc.html

分类: 我的新闻 标签: air, as3, 心情, 新闻
545次浏览↓

关于AIR的FileMode.UPDATE模式需要注意的问题

2009年1月11日 powerboy 没有评论

只要看过帮助文档的人都知道,FileMode里面包含了4种静态常量READ、WRITE、APPEND、UPDATE。前三种都很容易理解,但是UPDATE根据官方文档的意思,当没有外部文件的时候就生成外部文件,如果有的话,就对文件进行读写操作。在我看来它似乎就是一个READ、WRITE的集合,但是经过几次测试后发现,结果似乎和预期的不一样。仔细研究之后我才发现,原来这里面还有一个细节问题需要注意:当读取文件并获取到相应内容之后,如果你改变了其中某个字符或者在原有字符基础上追加了字符之后,在UPDATE的时候就会对文件相应字符进行改写。如果你仅仅是删除了部分字符的话,那就不会对原字符更新。举个例子:比如你生成一个txt文件,里面包含了abcde这几个字符,如果你把字符改为abbde或者abcdef的话,都可以成功进行UPDATE操作。但如果你想改为abcd或者abef的话,那将更新无效,但是并不会提示你操作错误或者失效之类的。然而这一点在官方文档中并没有提及到,今天在这里小记一下,留作备忘。

分类: air学习笔记 标签: air, as3
484次浏览↓

用目录进行工作(Working with directories)

2009年1月9日 powerboy 没有评论

本文由powerboy翻译,转载请注明出处。

The runtime provides you with capabilities to work with directories on the local file system.
运行环境为你提供了在本地文件系统上管理目录的能力。

Pointing a File object to a directory
指向一个文件目录。

There are different ways to set a File object to point to a directory.
这里提供过了很多不同的方法来把文件对象指向一个目录。

Pointing to the user’s home directory
指向用户目录。

You can point a File object to the user’s home directory. On Windows, the home directory is the parent of the “My Documents” directory (for example, “C:\Documents and Settings\userName\My Documents”). On Mac OS, it is the Users/userName directory. The following code sets a File object to point to an AIR Test subdirectory of the home directory:

你可以把文件对象指向用户目录。在Windows系统上,指的也就是“My Documents”目录的父级(例如: “C:\Documents and Settings\userName\My Documents”)。在Mac系统上,目录是Users/userName。下面的代码设置文件对象指向用户目录的子目录AIR Test:

var file:File = File.userDirectory.resolvePath(”AIR Test”);

Pointing to the user’s documents directory
指向用户文档目录。

You can point a File object to the user’s documents directory. On Windows, this is typically the “My Documents” directory (for example, “C:\Documents and Settings\userName\My Documents”). On Mac OS, it is the Users/userName/Documents directory. The following code sets a File object to point to an AIR Test subdirectory of the documents directory:

你可以把文件对象指向用户目录。在Windows系统上,是典型的”My Documents”目录(例如:”C:\Documents and Settings\userName\My Documents”)。在Mac系统上,是Users/userName/Documents目录。下面的代码设置文件对象指向用户文档目录的子目录AIR Test:

var file:File = File.documentsDirectory.resolvePath(”AIR Test”);

Pointing to the desktop directory
指向用户桌面目录。

You can point a File object to the desktop. The following code sets a File object to point to an AIR Test subdirectory of the desktop:

你可以把文件对象指向桌面。下面的代码设置文件对象指向用户桌面目录的子目录AIR Test:

var file:File = File.desktopDirectory.resolvePath(”AIR Test”);

Pointing to the application storage directory
指向应用程序的专用存储目录。

You can point a File object to the application storage directory. For every AIR application, there is a unique associated path that defines the application storage directory. This directory is unique to each application and user. You may want to use this directory to store user-specific, application-specific data (such as user data or preferences files). For example, the following code points a File object to a preferences file, prefs.xml, contained in the application storage directory:

你可以把文件对象指向应用程序的专用存储目录。每个AIR应用程序,都有一个唯一的针对专用存储目录的关联路径。这个目录对每个应用程序和用户都是唯一的。你可能要用这个目录存储用户和应用程序特定的数据(例如用户数据或选择文件)。例如,下面的代码把文件对象指向一个被包含在专用存储目录的选择文件prefs.xml:

var file:File = File.applicationStorageDirectory;
file = file.resolvePath(”prefs.xml”);

The application storage directory location is based on the user name, the application ID, and the publisher ID:

应用程序专用存储目录位置是基于用户名字、应用程序ID和发布者ID组成:

•
On Mac OS—In:
/Users/
user name
/Library/Preferences/
applicationID
.
publisherID
/Local Store/
For example:
/Users/babbage/Library/Preferences/com.example.TestApp.02D88EEED35F84C264A183921344EEA353A629FD.1/Local Store
•
On Windows—In the documents and Settings directory, in:
user name
/Application Data/
applicationID
.
publisherID
/Local Store/
For example:
C:\Documents and Settings\babbage\Application Data\com.example.TestApp.02D88EEED35F84C264A183921344EEA353A629FD.1\Local Store

The URL (and url property) for a File object created with File.applicationStorageDirectory uses the app-storage URL scheme (see “Supported URL schemes” on page 101), as in the following:

URL为了实现File.applicationStorageDirectory创建文件对象,而使用了app-storage URL方案,如下所示:

var dir:File = File.applicationStorageDirectory;
dir = dir.resolvePath(”preferences”);
trace(dir.url); // app-storage:/preferences

Pointing to the application directory
指向应用程序目录。

You can point a File object to the directory in which the application was installed, known as the application directory. You can reference this directory using the File.applicationDirectory property. You may use this directory to examine the application descriptor file or other resources installed with the application. For example, the following code points a File object to a directory named images in the application directory:

你可以把文件对象指向应用程序被安装的目录,就是通常所说的应用程序目录。你可以使用File.applicationDirectory属性来引用它。你可以使用安装目录来检查应用程序的描述文件或者其他资源。例如,下面的代码把文件对象指向应用程序目录下名为images的目录。

var dir:File = File.applicationDirectory;
dir = dir.resolvePath(”images”);

The URL (and url property) for a File object created with File.applicationDirectory uses the app URL scheme (see “Supported URL schemes” on page 101), as in the following:

URL为了实现File.applicationDirectory创建文件对象,而使用了app URL方案,如下所示:

var dir:File = File.applicationDirectory;
dir = dir.resolvePath(”images”);
trace(dir.url); // app:/images

Pointing to the filesystem root
指向文件系统根目录

The File.getRootDirectories() method lists all root volumes, such as C: on a Windows computer. On Mac, this method always returns the unique root directory for the machine (the “/” directory).

File.getRootDirectories()方法列出所有根目录卷标,例如windows电脑的c:。在Mac上,这个方法返回唯一的根目录(”/”目录)

Pointing to an explicit directory
指向具体的目录

You can point the File object to an explicit directory by setting the nativePath property of the File object, as in the following example (on Windows):

你可以通过设置文件的nativePath属性使文件对象指向具体目录,就像下面的例子(在windows上):

var file:File = new File();
file.nativePath = “C:\\AIR Test\”;

分类: air学习笔记, 我翻译的英文资料 标签: air, as3, 翻译
626次浏览↓

利用air打开文件并改变目录

2009年1月7日 powerboy 1 条评论
下载: Test.as
  1. package {
  2.  
  3. import flash.display.Sprite;
  4. import flash.events.Event;
  5. import flash.filesystem.File;
  6. import flash.net.FileFilter;
  7.  
  8. public class Test extends Sprite {
  9.  
  10. var file:File = new File();
  11. var txtFilter:FileFilter=new FileFilter("Text","*.as;*.css;*.html;*.txt;*.xml");
  12.  
  13. public function Test():void {
  14. file.addEventListener(Event.SELECT, dirSelected);
  15. file.browseForOpen("打开一个文件",[txtFilter]);
  16. }
  17. private function dirSelected(e:Event):void {
  18. trace(file.nativePath);
  19. file=File.desktopDirectory;
  20. file=file.resolvePath("AIR Test");
  21. trace(file.nativePath);
  22.  
  23. var file2:File=File.desktopDirectory;
  24. file2=file2.resolvePath("..");
  25. trace(file2.nativePath);
  26.  
  27. var file3:File=File.desktopDirectory;
  28. file3.nativePath+="/subdirectory";
  29. trace(file3.nativePath);
  30.  
  31. var file4:File = new File();
  32. file4.url="file:///c:/AIR Test/test.txt";
  33. trace(file4.nativePath);
  34.  
  35. var file5:File=File.documentsDirectory;
  36. file5=file5.resolvePath("AIR Test");
  37.  
  38. var file6:File=File.documentsDirectory;
  39. file6=file6.resolvePath("AIR Test/bob/test.txt");
  40.  
  41. var file7:File=File.documentsDirectory;
  42. file7=file7.resolvePath("AIR Test/susan/test.txt");
  43.  
  44. trace(file6.getRelativePath(file5,true));// file1位于file2的  ../..  目录下
  45. trace(file7.getRelativePath(file6,true));// file2位于file3的  ../../bob/test.txt  目录下
  46. }
  47. }
  48. }
分类: air学习笔记 标签: air, as3
RSS 订阅
  • Google
  • 有道
  • 鲜果
  • 抓虾
  • My Yahoo!
  • newsgator
  • Bloglines
  • 哪吒

分类列表

  • actionscript3.0学习笔记 (16)
  • air学习笔记 (6)
  • alternativa3D (3)
  • AS2疑难杂症 (1)
  • Box2D (3)
  • flash教程 (5)
  • flex学习笔记 (3)
  • 心情驿站 (24)
  • 我收集的flash 8.0资料 (3)
  • 我收集的flash 9.0资料 (3)
  • 我收集的文章 (21)
  • 我的AS2实验室 (4)
  • 我的AS3实验室 (9)
  • 我的新闻 (17)
  • 我的相册 (6)
  • 我翻译的英文资料 (7)
  • 日语学习 (2)
  • 英语学习 (2)

最近发表

  • 浅谈工具的意义
  • “小小便利店”终于上线啦
  • 禁止按tab时焦点从flash切换到地址栏
  • 隐藏Flex滚动条的箭头和滑竿
  • 为asdoc设定example
  • 一个测试睡眠的例子
  • Box2D——入门教程
  • Box2D——shoot Demo
  • 一个由单例模式引发的问题
  • 给图像加水印

最近评论

  • 空谷的回响 发表于 一个测试睡眠的例子
    我的QQ:373131285,希... »
  • manyu 发表于 一个测试睡眠的例子
    请给我发一份吧~我也在学习~谢谢... »
  • Brooks 发表于 mp3播放器 beta2.0(开源)
    好像不能下啊,楼主给我发一份吧,... »
  • velika 发表于 Box2D——shoot Demo
    刚开始学Box2d。发一份源码来... »
  • velika 发表于 一个测试睡眠的例子
    我也想要一份源码,谢谢15337... »
  • velika 发表于 一个测试睡眠的例子
    正在学BOX2D,楼主帮了我大忙... »
  • sky 发表于 一个测试睡眠的例子
    房主,你太强了,非常值得我学习,... »
  • GGGG 发表于 Box2D——shoot Demo
    zswrhua@163.com ... »
  • kirahua 发表于 Box2D——shoot Demo
    我也正在学习用BOX2D 做游戏... »
  • sans 发表于 Box2D——shoot Demo
    楼主很厉害哦,正在学box2d呢... »
  • 下一页 »

存档

  • 2010年五月 (2)
  • 2010年二月 (1)
  • 2009年十二月 (2)
  • 2009年十一月 (4)
  • 2009年十月 (1)
  • 2009年九月 (2)
  • 2009年八月 (2)
  • 2009年七月 (4)
  • 2009年五月 (3)
  • 2009年三月 (3)
  • 2009年二月 (2)
  • 2009年一月 (8)
  • 2008年十二月 (10)
  • 2008年十一月 (7)
  • 2008年十月 (4)
  • 2008年九月 (7)
  • 2008年八月 (8)
  • 2008年七月 (4)
  • 2008年六月 (5)
  • 2008年五月 (11)
  • 2008年四月 (14)
  • 2008年三月 (8)
  • 2008年二月 (12)

友情链接

  • alan新浪博客
  • sunbright
  • 云风Blog
  • 嘎嘎在东京
  • 张毅君/工长君
  • 永明则名
  • 海峡IT网
  • 闪界
  • 雷晟的新浪博客
  • 鼠标炸弹
置顶 WordPress
版权所有 © 2008-2010 动力男孩flash乐园 京ICP备09048608号
主题由 NeoEase 提供, 通过 XHTML 1.1 和 CSS 3 验证.Powered by WordPress