keycode大全

每次写代码需要用到keycode都去网上搜索一次,这次搬家回来,方便以后使用。

keycode 8 = BackSpace BackSpace
keycode 9 = Tab Tab
keycode 12 = Clear
keycode 13 = Enter
keycode 16 = Shift_L
keycode 17 = Control_L
keycode 18 = Alt_L

Adobe Flash Builder Flash3D开发错误处理方法汇总



报错:VerifyError: Error #1014: 无法找到类 flash.display3D::Context3D。
处理方案:在项目属性的附加编译器参数中加入-swf-version=13。 注意要和前面的参数以空格分离。即:-locale zh_CN -swf-version=13

报错:Error #2044: 未处理的 ErrorEvent:。 text=Error #3702: Context3D 不可用。
处理方案:在生成的html页面中加入 params.wmode="direct";

有关 namespace 和 package 的概念

以前学习Java和C#的时候也碰到过着两个概念,但是都是稀里糊涂的。没有真正明白和了解其具体用法,感觉都是 一个范围的圈定或者一个框架。现在学习AS3.0又碰到这个问题。仔细看了英文帮助,还是不得要解啊(英文太烂啊)。

于是在网上查找相关资料,有如下收获:

package:它很类似我们Java程序的包(package),我们可以把每个模块定义成一个package,这一点与Struts的模块有些相似,但package的功能更强大,它可以继承在它上面的package,获得父package的global results、interceptor、interceptor-stack、action等所有配置.我们可以把每个package写成一个独立的配置文件,例如:module1-xwork.xml(文件的名称没有任何限制),在xwork.xml中只要通过
引用即可.
但要注意:WebWork的配置文件xwork.xml是安装文件内容顺序(从上到下)读取的,如果你的package继承了一个父package,那么这个父package必需在它之前定义.

namespace:它是package的命名空间,它用来分隔不同package定义的action,让这些action处于不同的命名空间(namespaces)。
这样,我们不同的package可以有相同的action命名,因为可以通过命名空间来区分。如果不指定namespace,默认的是空字符串。
命名空间也可以被用在安全控制方面,它可以根据不同的命名空间指定不同的访问权限。

原文地址:http://dogo.javaeye.com/blog/22828

在Jave中好像没有 namespace的概念,C#我还没入门,我就不知道了。但是可以肯定的是有namespace

目前我对package的理解就是 目录的概念。要使用Class,就需要指定是在哪个目录的哪个文件名。也就是指明详细的路径。

FLVPlayback Event 汇总

为了方便对flv视频播放的监听,将所有的flv的监听事件列了出来。其实在帮助中有,只是还没习惯帮助中的查找方式。

帮助中的位置是: ActionScript 3.0 / ActionScript 3.0 Language and Components Reference / All Classes / FLVPlayback class / Events

请注意后面的 Defined By 类型,有分别针对播放控制、视觉效果、事件触发等。

举例:
下面的代码检测myvideo的flv实例是否播放完,如果完成则输出“media is Finished”,通常我们只需要修改触发事件complete和flv实例名称即可。

//ActionScript 2.0 代码如下:
var myListener = new Object();
myListener.complete = function(eventObject) {
	trace("media is Finished");
};
myvideo.addEventListener("complete",myListener);

//ActionScript 3.0 代码如下:
function myListener(event:complete):void {
	trace("media is Finished");
}
myvideo.addEventListener("complete",myListener);
Event Summary Defined By
Dispatched when Flash Player gains operating system focus and becomes active. EventDispatcher
Dispatched when a display object is added to the display list. DisplayObject
Dispatched when a display object is added to the on stage display list, either directly or through the addition of a sub tree in which the display object is contained. DisplayObject
Dispatched when the video player is resized or laid out automatically. FLVPlayback
Dispatched when the playhead is moved to the start of the video player because the autoRewind property is set to true. FLVPlayback
Dispatched when the FLVPlayback instance enters the buffering state. FLVPlayback
Dispatched when a user presses and releases the main button of the user's pointing device over the same InteractiveObject. InteractiveObject
Dispatched when the event object closes the NetConnection, by timing out or through a call to the closeVideoPlayer() method or when you call the load() or play() methods or set the source property and cause the RTMP connection to close as a result. FLVPlayback
Dispatched when playing completes because the player reached the end of the FLV file. FLVPlayback
Dispatched when a cue point is reached. FLVPlayback
Dispatched when Flash Player loses operating system focus and is becoming inactive. EventDispatcher
Dispatched when a user presses and releases the main button of a pointing device twice in rapid succession over the same InteractiveObject when that object's doubleClickEnabled flag is set to true. InteractiveObject
Dispatched when the playhead is entering a new frame. DisplayObject
Dispatched when the location of the playhead moves forward by a call to the seek() method or by clicking the ForwardButton control. FLVPlayback
Dispatched after a display object gains focus. InteractiveObject
Dispatched after a display object loses focus. InteractiveObject
Dispatched when the user presses a key. InteractiveObject
Dispatched when the user attempts to change focus by using keyboard navigation. InteractiveObject
Dispatched when the user releases a key. InteractiveObject
Dispatched when the video player is resized or laid out. FLVPlayback
Dispatched the first time the FLV file's metadata is reached. FLVPlayback
Dispatched when a user presses the pointing device button over an InteractiveObject instance in the Flash Player window. InteractiveObject
Dispatched when the user attempts to change focus by using a pointer device. InteractiveObject
Dispatched when a user moves the pointing device while it is over an InteractiveObject. InteractiveObject
Dispatched when the user moves a pointing device away from an InteractiveObject instance. InteractiveObject
Dispatched when the user moves a pointing device over an InteractiveObject instance in the Flash Player window. InteractiveObject
Dispatched when a user releases the pointing device button over an InteractiveObject instance in the Flash Player window. InteractiveObject
Dispatched when a mouse wheel is spun over an InteractiveObject instance in the Flash Player window. InteractiveObject
Dispatched when the player enters the paused state. FLVPlayback
Dispatched while the FLV file is playing at the frequency specified by the playheadUpdateInterval property or when rewinding starts. FLVPlayback
Dispatched when the playing state is entered. FLVPlayback
Indicates progress made in number of bytes downloaded. FLVPlayback
Dispatched when an FLV file is loaded and ready to display. FLVPlayback
Dispatched when a display object is about to be removed from the display list. DisplayObject
Dispatched when a display object is about to be removed from the display list, either directly or through the removal of a sub tree in which the display object is contained. DisplayObject
Dispatched when the display list is about to be updated and rendered. DisplayObject
Dispatched when the location of the playhead moves backward by a call to seek() or when an autoRewind call is completed. FLVPlayback
Dispatched when the user moves a pointing device away from an InteractiveObject instance. InteractiveObject
Dispatched when the user moves a pointing device over an InteractiveObject instance. InteractiveObject
Dispatched when the user stops scrubbing the FLV file with the seek bar. FLVPlayback
Dispatched when the user begins scrubbing the FLV file with the seek bar. FLVPlayback
Dispatched when the location of the playhead is changed by a call to seek() or by setting the playheadTime property or by using the SeekBar control. FLVPlayback
Dispatched when an error occurs loading a skin SWF file. FLVPlayback
Dispatched when a skin SWF file is loaded. FLVPlayback
Dispatched when sound changes by the user either moving the handle of the volumeBar control or setting the volume or soundTransform property. FLVPlayback
Dispatched when the playback state changes. FLVPlayback
Dispatched when entering the stopped state. FLVPlayback

Flash AS3 中类的定义不再要求一个类一个文件了

Unlike previous ActionScript versions, ActionScript 3.0 does not have the one file, one class restriction that limits you to using only one class per file. Using ActionScript 3.0, you can save the source code for more than one class in a single .as file.

but in general, this is considered a bad programming practice, for a couple of reasons:

It is difficult to reuse individual classes if they are packed together into a single large file.
It is difficult to locate the source code for a specific class when its filename does not correspond to the class name.
For these reasons, Adobe recommends that you always save the source code for each individual class in its own file, and give the file the same name as the class.

Flash AS3 中类的定义不再要求一个类一个文件了,可以多个类在同一个.as文件中。

但是,Adobe又说由于以前的一些习惯等原因,现在还是推荐一个类一个文件,并且 类文件的名字最好和文件中的类的名字一致。

Flash AS 疑难问题悬赏:1037: Packages cannot be nested.

1037: Packages cannot be nested.
package {

上面是我编译一点代码时出现的错误信息,现在还没有解决办法。 :(

网上也还没有找到解决方案,只找到一段类似的,说是 自定义的Class,必须放在外部as文件中。
我也依照如此修改。但是还是得到这样的错误提示。

不知道我又犯了什么很简单但又很愚蠢的问题,麻烦又知道的朋友给俺说一声。

又错误详细描述:
编译窗口出现的信息内容:

Script-1.as,Line 1 1037: Packages cannot be nested. package {

我检测过语法,没有任何错误。

flash加载外部变量时,中文乱码的解决办法

加载变量前,加入如下代码:
System.useCodepage=true;即可以解决。
官方帮助解释如下: