我想做的是行动文件3:
if(variable is Object) ...;
else ...;
String(
,Number(>
,Array()
,Object(
.
目前,上述所有这类检查都属于实情。 但是,我只想回去对用<代码>新目的(<>>/代码>的物体。
任何帮助都会受到高度赞赏!
我想做的是行动文件3:
if(variable is Object) ...;
else ...;
String(
,Number(>
,Array()
,Object(
.
目前,上述所有这类检查都属于实情。 但是,我只想回去对用<代码>新目的(<>>/代码>的物体。
任何帮助都会受到高度赞赏!
您应努力利用这一职能——、QualisedClassName
和。 这里有一部说明其如何掌握所列出的不同数据类型的代码,尤其见Array和数字的区别:
<><>Code>:
var o = new Array();
trace ("var o = new Array()");
trace (getQualifiedClassName(o));
trace (typeof(o));
var o = new Object();
trace ("var o = new Object();");
trace (getQualifiedClassName(o));
trace (typeof(o));
var o = new String();
trace ("var o = new String()");
trace (getQualifiedClassName(o));
trace (typeof(o));
var o = new Number()
trace ("var o = new Number()");
trace (getQualifiedClassName(o));
trace (typeof(o));
var o = 3.14;
trace ("var o = 3.14");
trace (getQualifiedClassName(o));
trace (typeof(o));
结果:
var o = new Array()
Array
object
var o = new Object();
Object
object
var o = new String()
String
string
var o = new Number()
int
number
var o = 3.14
Number
number
我假定,获得“QualisedClassName”是你重新研究的,这在“闪电”计划中:
import flash.utils.getQualifiedClassName;
围绕其中一项内容进行询问:
if (variable.constructor.toString().match(/object/i) == Object )
if (variable.constructor.toString().indexOf("Object") != -1)
如果物体为目的,则建筑设计师的扼杀将类似目标。
function Object() { ... }
因此,你可以检查。
您也可使用<条码>,<条码>,<>条码>。 反对: a) 具有超等级:
public static function isObject( obj:* ):Boolean
{
if ( obj == null )
return false;
return ( getQualifiedSuperclassName( obj ) == null );
}
各位来到这里,尝试这样做。
var ob:Object = new Object();
trace(ob); //[object Object]
trace(typeof(ob) == "object"); //true
if(typeof(ob) == "object"){
//true
}else{
//false
}
Need a code that only accepts numbers. Upon inputting, the code must check if it is number, if not, it must remove the entered key or not enter it at all
Context : I m working on a Flash application developed with FDT and compiled with Flash CS4 (I need a huge library). It should connect to various Weborb services. Weborb is properly configured. My ...
I have a for loop in action script which I m trying to use to dynamically create variable. Example for( i = 0 ; i < 3 ; i++) { var MyVar+i = i; } after this for loop runs, i would like to ...
I m trying to create a simple loop that adds a random number of stars, fades them out and removes them. The script I ve come up with does everything but remove them, and perhaps I need a less on ...
Could someone please let me know if is possible to drag (multiple) files from desktop directly into a flash webpage. If yes could you please link me to some online resources.
I have a XMLSocket and I call send twice in the same function. The first send works but the second does not? Does XMLSocket have a restriction to only send one message per frame? Do I have to queue ...
I have a function that I want to run at an interval within a frame. I use the following code to start the function: var intervalID = setInterval(intervalFunction, 3000); Then, in a button s ...
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 =...