air之小功能杂记

来源:互联网 发布:爱荷华大学 知乎 编辑:程序博客网 时间:2024/04/30 23:32

第一:隐藏鼠标的光标显示。

/**
   *隐藏鼠标
   */  
  public static function displayCursor():void{
   Mouse.hide();  
  }

 

第二:让应用全屏:

function initFullScreen():void{
     stage.displayState = StageDisplayState.FULL_SCREEN_INTERACTIVE;
     }


第三:退出当前应用

 private function exitApp():void
   {
    this.nativeApplication.exit(0);
   }

 

 

flex中获取系统分辨率:
宽:Capabilities.screenResolutionX
高:Capabilities.screenResolutionY
这里获取的分辨率是系统启动时设备的分辨率,并不会动态的修改
----------------------------
flex 中调用系统exe文件
public var process:NativeProcess;
protected function textInput_search_focusInHandler(event:FocusEvent):void
{
 trace("获取到焦点");
 var npsi:NativeProcessStartupInfo = new NativeProcessStartupInfo;
 var file:File = File.applicationDirectory.resolvePath("C://Windows//System32//osk.exe");
 npsi.executable = file;     
 if ((process)&&(process.running))
  return ;
 process = new flash.desktop.NativeProcess();
 process.start(npsi);   
      
}
-----------------------------
Flex中的局中:
horizontalCenter="0" //水平方向永远居中
verticalCenter="0" //竖直方向永远居中
注意:
组件的parent的layout属性(如果有的话),必须为absolute,这两个样式才会有效

你是用FlexBuilder3开发的吧SDK3吧.
我用4的话就不用写layout这个属性都可以局中.S标签.
------------------------------------------------------------
将mx:panel的表头去掉:
只需要在css中,headHeight=0就可以了。flex4中,是没有这个属性的,只能改为用group组件。
---------------------------------------------------------
如何去掉组件自带的阴影:
注意:对于显示在容器上的投影,需设置 contentBackgroundColor 属性。否则,由于容器的背景默认为透明,阴影将显示在容器后。
然后dropShadowVisible="false"

 

原创粉丝点击