English 中文(简体)
• 插图中用于功能用途的优质生物价值。 申请
原标题:Parse boolean values in strings for use with Function.apply

使用<代码>String.split的Im将指挥线划分成一系列的护卫。 结果是使用<条码>功能称呼一项功能。 页: 1

如果apply(null, [“17”]>,则这一职能称为:

static function test(foo:int):void
{
    trace(foo, typeof(foo));
}

它按预期运作(产出:<代码>17 编号)。

但是,apply (null, ["false”] or apply (null, [0”] with this function:

static function test(foo:Boolean):void
{
    trace(foo, typeof(foo));
}

没有工作(预期产出:<代码>false Boolean;实际产出:true Boolean)。

是否有办法承认<条码>真实性”<><>>> >和“false”(或任何其它内容)为诱杀性价值,就像用数字扼杀一样? 理想情况下,<代码>“真实”和>“false”也应当保持有效指示值。

问题回答

没有任何东西可以用来解释“真实”和“false”作为ole子。

在《行动》的文字和其他欧安会的文字中,唯一被评价为蓝ool假的显眼价值是空洞的“”。 任何长篇的体形都经过了评估,包括“false”和“0”。

在实践中,这很少是一个大问题,因为比较简单容易。 https://stackoverflow.com/questions/263965/how-can-i-convert-a-string-to-boolean-in-javascript>。 我怎么能够把str子改成ool子?





相关问题
Disable button tooltip in AS3

I want to disable the tooltip on certain buttons. The tooltip manager seems to be an all or nothing solution. Is it possible to disable the tooltip for just one or two buttons?

Multiple Remote call made simultenously

I was making multiple remote calls and they are done sequentially and when I am getting a result event back it s triggering calls to all the methods with ResultEvent as an argument . I am supposed to ...

Attaching a property to an event in Flex/AS3

I have a parameter that needs to be passed along with an event. After unsuccessful attempts to place it on the type by extending the class, I ve been advised in another SO question to write a custom ...

Clearing RSL in Cache

I have built a flex application which has a "main" project and it is assosciated with a few RSL s which are loaded and cached once i run my "main" application. The problem i am facing is that the ...

What s a good way of deserializing data into mock objects?

I m writing a mock backend service for my flex application. Because I will likely need to add/edit/modify the mock data over time, I d prefer not to generate the data in code like this: var mockData =...

AS3 try/catch out of memory

I m loading a few huge images on my flex/as3 app, but I can t manage to catch the error when the flash player runs out of memory. Here is the what I was thinking might work (I use ???? because i dont ...

热门标签