昨天Adobe发布了 Flash Player 11.2 RC版 ,这意味着伴随着我们十几年的FlashPlayer右键菜单终于可以取消了。

随之而来的还有鼠标坐标锁定功能,睡眠事件支持等等,详细列表看这里:http://labs.adobe.com/technologies/flashplatformruntimes/flashplayer11-2/

下面这个例子演示了右键支持以及到底什么是鼠标坐标锁定。点击鼠标左键全屏观察鼠标锁定效果。右键取消全屏。

这个例子需要Flash Player 11.2支持,请在这里下载:http://labs.adobe.com/downloads/flashplayer11-2.html

文档支持:http://help.adobe.com/en_US/FlashPlatform/beta/reference/actionscript/3/index.html

泪奔中……

您的浏览器不支持JavaScript,或者您禁用了JavaScript。

请启用浏览器的JavaScript支持。

如果您确认启用了JavaScript,请使用下面的链接升级Flash Player到最新版本:

安装最新的Flash Player插件

源码:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
package
{
import flash.display.Sprite;
import flash.display.StageDisplayState;
import flash.events.MouseEvent;
import flash.text.TextField;
/**
* Flash Player鼠标右键支持
* @author zrong(zengrong.net)
* 创建日期:2012-02-28
*/
[SWF(width=500,height=400)]
public class RightClick extends Sprite
{
public function RightClick()
{
_traceTF = createTF();
_traceTF.width = this.stage.stageWidth*.5;
_traceTF.height = this.stage.stageHeight;
_traceTF.text = '左键全屏观察鼠标锁定效果。右键取消全屏。\n';
this.addChild(_traceTF);
_locTF = createTF();
_locTF.width = 100;
_locTF.height = this.stage.stageHeight;
_locTF.x = 400;
this.addChild(_locTF);
this.stage.doubleClickEnabled = true;
this.stage.addEventListener(MouseEvent.CLICK, handler_mouseEvent);
this.stage.addEventListener(MouseEvent.RIGHT_CLICK, handler_mouseEvent);
this.stage.addEventListener(MouseEvent.MOUSE_MOVE, handler_mouseMove);
}
private var _traceTF:TextField;
private var _locTF:TextField;
private function createTF():TextField
{
var __tf:TextField = new TextField();
__tf.selectable = false;
__tf.mouseEnabled = false;
__tf.wordWrap = true;
return __tf;
}
private function handler_mouseMove($evt:MouseEvent):void
{
showLoc($evt.movementX, $evt.movementY);
}
private function handler_mouseEvent($evt:MouseEvent):void
{
showTrace($evt.type);
if($evt.type == MouseEvent.CLICK)
{
this.stage.displayState = StageDisplayState.FULL_SCREEN;
this.stage.mouseLock = true;
}
else
{
this.stage.displayState = StageDisplayState.NORMAL;
}
showTrace('fullscreen:'+this.stage.displayState);
}
private function showTrace($msg:String):void
{
_traceTF.appendText($msg + '\n');
_traceTF.scrollV = _traceTF.maxScrollV;
}
private function showLoc($x:Number, $y:Number):void
{
_locTF.appendText($x+','+$y+'\n');
_locTF.scrollV = _locTF.maxScrollV;
}
}
}

留言

2012-02-28
次访问