Re: [Flashcoders] AS3: if (urlvars.bids != null) trace(urlvars.bids); still prints null?
if you're sure you receive an empty value and the check does not work, maybe try if (String(urlvars.bids) != "") Romu Muzak wrote: If the variable is actually present, it will have a value: an emtpy string. And you may have to check for "0" instead of 0, again a string. if (urlvars.bids != "" && urlvars.bids != "0") regards, Muzak - Original Message - From: "Alexander Farber" To: "Flash Coders List" Sent: Thursday, April 09, 2009 3:13 PM Subject: [Flashcoders] AS3: if (urlvars.bids != null) trace(urlvars.bids);still prints null? Hello, does anybody please have an idea, why would this code: private function handleComplete(event:Event):void { var urlvars:URLVariables = event.target.data; .. if (urlvars.bids != null && urlvars.bids != 0) { trace(urlvars.bids); . } } still print out "null"? Is it maybe because null != null in AS3 and I have to perform some other check similar to isNaN()? Thank you Alex ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] AS3: if (urlvars.bids != null) trace(urlvars.bids); still prints null?
If the variable is actually present, it will have a value: an emtpy string. And you may have to check for "0" instead of 0, again a string. if (urlvars.bids != "" && urlvars.bids != "0") regards, Muzak - Original Message - From: "Alexander Farber" To: "Flash Coders List" Sent: Thursday, April 09, 2009 3:13 PM Subject: [Flashcoders] AS3: if (urlvars.bids != null) trace(urlvars.bids);still prints null? Hello, does anybody please have an idea, why would this code: private function handleComplete(event:Event):void { var urlvars:URLVariables = event.target.data; .. if (urlvars.bids != null && urlvars.bids != 0) { trace(urlvars.bids); . } } still print out "null"? Is it maybe because null != null in AS3 and I have to perform some other check similar to isNaN()? Thank you Alex ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] AS3: if (urlvars.bids != null) trace(urlvars.bids); still prints null?
No, null==null in AS3. I suspect that your url variable bids contains the string "null", sent from the server-side. HTH, Ian On Thu, Apr 9, 2009 at 2:13 PM, Alexander Farber wrote: > Hello, > > does anybody please have an idea, why would this code: > > private function handleComplete(event:Event):void { > var urlvars:URLVariables = event.target.data; > .. > if (urlvars.bids != null && urlvars.bids != 0) { > trace(urlvars.bids); > . > } > } > > still print out "null"? Is it maybe because null != null in AS3 > and I have to perform some other check similar to isNaN()? > > Thank you > Alex > ___ > Flashcoders mailing list > Flashcoders@chattyfig.figleaf.com > http://chattyfig.figleaf.com/mailman/listinfo/flashcoders > ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] AS3: if (urlvars.bids != null) trace(urlvars.bids); still prints null?
the "null" is maybe a string if it's from url variables. Alexander Farber wrote: Hello, does anybody please have an idea, why would this code: private function handleComplete(event:Event):void { var urlvars:URLVariables = event.target.data; .. if (urlvars.bids != null && urlvars.bids != 0) { trace(urlvars.bids); . } } still print out "null"? Is it maybe because null != null in AS3 and I have to perform some other check similar to isNaN()? Thank you Alex ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
[Flashcoders] AS3: if (urlvars.bids != null) trace(urlvars.bids); still prints null?
Hello, does anybody please have an idea, why would this code: private function handleComplete(event:Event):void { var urlvars:URLVariables = event.target.data; .. if (urlvars.bids != null && urlvars.bids != 0) { trace(urlvars.bids); . } } still print out "null"? Is it maybe because null != null in AS3 and I have to perform some other check similar to isNaN()? Thank you Alex ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders