Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/flash/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/actionscript-3/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Flash as3corelib中的NumberFormatter_Flash_Actionscript 3 - Fatal编程技术网

Flash as3corelib中的NumberFormatter

Flash as3corelib中的NumberFormatter,flash,actionscript-3,Flash,Actionscript 3,我似乎无法让这个简单的设置与as3corelib一起工作 import com.adobe.utils.NumberFormatter; trace(NumberFormatter.addLeadingZero(1)); 我得到的只是 Scene 1, Layer 'Layer 1', Frame 1, Line 2 1061: Call to a possibly undefined method addLeadingZero through a reference with static

我似乎无法让这个简单的设置与as3corelib一起工作

import com.adobe.utils.NumberFormatter;
trace(NumberFormatter.addLeadingZero(1));
我得到的只是

Scene 1, Layer 'Layer 1', Frame 1, Line 2 1061: Call to a possibly undefined method addLeadingZero through a reference with static type Class.

使用字符串实用程序效果很好,但这里似乎不适用于此。

我认为您需要先像这样创建NumberFormatter对象

var formatter:NumberFormatter = new NumberFormatter();
然后打电话

trace(formatter.addLeadingZero(1));

我还没有测试过这个,但我猜这就是你需要做的。

你是如何通过
mxmlc
或Flash Professional编译你的SWF的?我也尝试过这个,但我得到了1136:不正确的参数数。预期1。我想它是在尝试调用旧的mx.NumberFormatter