Windows 在屏幕上居中显示swf(不带html)

Windows 在屏幕上居中显示swf(不带html),windows,actionscript-3,flash,actionscript-2,Windows,Actionscript 3,Flash,Actionscript 2,我创建了一个flash动画,并希望将其作为.exe文件打开。如何打开屏幕中央的exe?我的项目使用的是AS3,但也可以是as2。我只需要在Windows操作系统上打开这个exe 我不知道在纯flash中有什么方法可以做到这一点,但如果你使用AIR,这很容易做到 下面是一个使窗口居中的示例: import flash.system.Capabilities public function setupWindow():void { var screenX:uint = Capabilitie

我创建了一个flash动画,并希望将其作为.exe文件打开。如何打开屏幕中央的exe?我的项目使用的是AS3,但也可以是as2。我只需要在Windows操作系统上打开这个exe

我不知道在纯flash中有什么方法可以做到这一点,但如果你使用AIR,这很容易做到

下面是一个使窗口居中的示例:

import flash.system.Capabilities
public function setupWindow():void
{
    var screenX:uint = Capabilities.screenResolutionX
    var screenY:uint = Capabilities.screenResolutionY
    stage.nativeWindow.x = (screenX-stage.nativeWindow.width)/2
    stage.nativeWindow.y = (screenY-stage.nativeWindow.height)/2
}

我不知道用纯闪光灯怎么做,但如果你用空气,这很容易做到

下面是一个使窗口居中的示例:

import flash.system.Capabilities
public function setupWindow():void
{
    var screenX:uint = Capabilities.screenResolutionX
    var screenY:uint = Capabilities.screenResolutionY
    stage.nativeWindow.x = (screenX-stage.nativeWindow.width)/2
    stage.nativeWindow.y = (screenY-stage.nativeWindow.height)/2
}

flash窗口具有属性“Startposition”;将其设置为“CenterScreen”

flash窗口具有属性“Startposition”;将其设置为“中心屏幕”

如果可以使用空气,则可以选择设置窗口位置。我不认为有任何选择,这样做只使用AS3和闪光灯投影仪。也许你应该尝试使用.NET?pozdroIf可以使用空气,可以选择设置窗口位置。我不认为有任何选择,这样做只使用AS3和闪光灯投影仪。也许你应该尝试使用.NET?pozdroI没有
nativeWindow
属性。我没有
nativeWindow
属性。