hide NaN results
- Started
- Last post
- 8 Responses
- v3nt
flash preloaders do me tits in. how can i use an if statement and detect 'NaN' so i can hide the preloader?
if(per == NaN) {
_parent._alpha = 0;
}or
if(per == "NaN") {
_parent._alpha = 0;
}doesn't seem to work! cheers. D
- rafalski0
post preloader to a pastebin
- nospacebar0
if (per == Math.NaN) {}
I'd suggest starting the alpha at zero and increasing it using:
if (per > 0) {
//increase alpha
}
- rafalski0
wouldnt..
if (!per) {}
..work in Flash 7+ ?
starting alpha at zero is not always useful if you'reusing one preloader for many elements, ie images in a slideshow
- acescence0
if (isNan(expression))
- mimeartist0
don't have a NaN in the first place
- v3nt0
tis imposible to not get a nan when wait for totlabytes etc on image preloaders - please share if not!
anyhows - got it in the end so cheers for help...
if (!per || per == 100 || per
- mimeartist0
just check if the totalbytes and getbytestotals are greater than 0
- caseyc0
What ace said, 'cept with the proper case:
if ( isNaN(per) )
that means the if body would occur if per is NOT a number, alternatively:
if( !isNaN(per) )
means the if body will occur if per IS a number.
Cheers,