Flasher Archive

[Previous] [Next] - [Index] [Thread Index] - [Previous in Thread] [Next in Thread]


Subject: Re: [flasher] Re: checking for undefined.
From: Muzak
Date: Mon, 12 Feb 2001 23:03:03 -0000

Actually the answer was in your subject :-)
You can use 'undefined' or 'null' to see if a variable excists.

if (myVar == undefined) {
trace ("myVar is undefined");
} else {
trace ("myVar= "+myVar);
}
----------------------------
if (myVar == null) {
trace ("myVar is undefined");
} else {
trace ("myVar= "+myVar);
}
----------------------------
'Undefined' is not listed in the documentation, but it works.

hth,
Muzak

> DRMRLPLSataol [dot] com wrote:
> >
> > How do we check for undefined values in Flash 5.
> >
> > My movie needs to check for values that may be passed from an outside script.
> > So I am checking to see if the value is defined or not and nothing is
> > working.
> >
> > I've tried :
> > if (value1 == "")
> > if (isNaN(value1))
> > if(number(value1))
> >
> > What do I need to check for? I was told that undefined values in Flash 5 are
> > 0, but this doesn't seem to be true.
> >
> > Andrew




[Previous] [Next] - [Index] [Thread Index] - [Next in Thread] [Previous in Thread]