FlashDevelop/OpenFL:如何将默认目标设置为neko [英] FlashDevelop/OpenFL: How to set default target to neko

查看:128
本文介绍了FlashDevelop/OpenFL:如何将默认目标设置为neko的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用Haxe/OpenFL编写一些跨语言代码,并使用FalshDevelop对其进行编译.但是,一旦使用基本的Sys.print函数,我就会收到错误消息.最小的示例如下:

I am trying to write some cross-language code with Haxe/OpenFL and compile it using FalshDevelop. But I get an error as soon as I use the basic Sys.print function. A minimal example is as follows:

package;

import flash.display.Sprite;

class Graphic extends Sprite {


    public function new () {
        super ();
    }

    static function main() { //used in standalone swf project
        Sys.print("Hi");
        }
}

事实证明,FlashDevelop的默认编译命令类似于:

It turns out that the default compile command of FlashDevelop is something like:

haxelib run openfl build project.xml flash

,这会在Sys.print上显示错误:

Graphic.hx:xx: characters 2-11 : Accessing this field requires a system platform
 (php,neko,cpp,etc.)

我的猜测是Sys.print在Flash目标中不可用,或者Flash不是a system platform(奇怪).我想知道是否有解决此问题的方法,并配置FlashDevelop以便编译命令为:

My guess is that Sys.print isn't available in the flash target or flash isn't a system platform (strange). I was wondering if there is way to work around this, and configure FlashDevelop so that the compile command is:

haxelib运行openfl构建project.xml neko

谢谢

推荐答案

实际上有2个问题.

对于第一个,Sys.print仅在某些平台上可用,因为它在其他平台上没有意义(它在Flash中会做什么?),您可能想要的是trace,用于打印内容.调试目的.

For the first one, Sys.print is available only on some platforms because it wouldn't make sense in others(what would it do in flash?), what you probably want is trace, which is used to print things for debug purposes.

对于第二个问题,如果您创建的openfl项目看起来像这样并恰好做到了,那么在flashdevelop的顶部会有一个下拉菜单:

For the second question there is a drop down menu at the top of flashdevelop if you created a openfl project that looks like this and does exactly that:

这篇关于FlashDevelop/OpenFL:如何将默认目标设置为neko的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆