Groups | Blog | Home
all groups > flash actionscript > january 2006 >

flash actionscript : NaN


Motion Maker
1/12/2006 9:05:29 PM
Try isNaN(expression)

http://livedocs.macromedia.com/flash/8/main/wwhelp/wwhimpl/common/html/wwhelp.htm?context=LiveDocs_Parts&file=00001737.html

if (isNaN(_parent.PresCloseRate))
--
Lon Hosford
www.lonhosford.com
May many happy bits flow your way!
[quoted text, click to view]
Any help on this would be appriciated.

How do i set a variable from NaN to 0? Currently im trying to use an if
statment to check and see if the value is NaN...But it doesnt seem to do
anything. On the main timeline where i instanciate my variables i set
PresCloseRate = Number(0).

if (_parent.PresCloseRate == NaN) {
_parent.PresCloseRate = Number(0);
}

and ive also tried...

if (_parent.PresCloseRate == "NaN") {
_parent.PresCloseRate = Number(0);
}

Thanks in advance,

TJ

ni9e
1/12/2006 10:38:00 PM
Any help on this would be appriciated.

How do i set a variable from NaN to 0? Currently im trying to use an if
statment to check and see if the value is NaN...But it doesnt seem to do
anything. On the main timeline where i instanciate my variables i set
PresCloseRate = Number(0).

if (_parent.PresCloseRate == NaN) {
_parent.PresCloseRate = Number(0);
}

and ive also tried...

if (_parent.PresCloseRate == "NaN") {
_parent.PresCloseRate = Number(0);
}

Thanks in advance,

TJ
ni9e
1/12/2006 10:44:19 PM
Nevermind I used the mad skillz of Kglad....i hate that guy j/k

Anyways here is the fix...

if(isNaN(whatever)){
whatever=0
AddThis Social Bookmark Button