关于flash builder 的api配置,天地会上已经有兄弟发了,可以参考这篇文章
下面我来说下fd的api配置
找到fd的安装目录
1.在这个目录: flashdevelop/tools/flexsdk/runtimes/player/下新建个11.2的目录,里面放上flashplayer11.2.exe,adobe网站上有下载
2.在这个目录:flashdevelop/tools/flexsdk/frameworks/libs/player/下新建11.2目录,里面放上fp11.2对应的playerglobal.swc
3.在项目属性output那行有个compiler options,点开advanced下面那个additional compiler options,弹出的框里面输入-swf-version=15
新建个as文件,点此获得代码
测试,enjoy it
package
{
import flash.display.Sprite;
import flash.events.Event;
import flash.events.MouseEvent;
import flash.text.TextField;
import flash.ui.ContextMenu;
public class TestRightMenu extends Sprite
{
private var _state:TextField;
public function TestRightMenu()
{
stage?init():addEventListener(Event.ADDED_TO_STAGE,init);
}
private function init(e:Event=null):void
{
removeEventListener(Event.ADDED_TO_STAGE,init);
_state=new TextField();
stage.addChild(_state);
stage.addEventListener(MouseEvent.RIGHT_CLICK,onRight);
stage.addEventListener(MouseEvent.MIDDLE_CLICK,onMiddle);
}
private function onRight(e:MouseEvent):void
{
_state.text="点击了右键";
_state.width=_state.textWidth+10;
}
private function onMiddle(e:MouseEvent):void
{
_state.text="点击了中键";
_state.width=_state.textWidth+10;
}
}
}
Comments are closed.