<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Cast to int issue</title>
	<atom:link href="http://www.flexer.info/2008/01/11/cast-to-int-issue/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.flexer.info/2008/01/11/cast-to-int-issue/</link>
	<description>flex developers web corner</description>
	<lastBuildDate>Wed, 18 Jan 2012 13:28:25 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=abc</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: gtb</title>
		<link>http://www.flexer.info/2008/01/11/cast-to-int-issue/comment-page-1/#comment-2029</link>
		<dc:creator>gtb</dc:creator>
		<pubDate>Wed, 20 Apr 2011 21:00:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.flexer.info/2008/01/11/cast-to-int-issue/#comment-2029</guid>
		<description>From the adobe manual: &quot;The inclusion of a decimal point causes uint() and int() to return an integer, truncating the decimal and the characters following it.&quot; (http://livedocs.adobe.com/flex/3/html/help.html?content=03_Language_and_Syntax_12.html)

I fixed this by type-casting as Number, not int (eg. Number(&#039;1.25&#039;))</description>
		<content:encoded><![CDATA[<p>From the adobe manual: &#8220;The inclusion of a decimal point causes uint() and int() to return an integer, truncating the decimal and the characters following it.&#8221; (<a href="http://livedocs.adobe.com/flex/3/html/help.html?content=03_Language_and_Syntax_12.html" rel="nofollow">http://livedocs.adobe.com/flex/3/html/help.html?content=03_Language_and_Syntax_12.html</a>)</p>
<p>I fixed this by type-casting as Number, not int (eg. Number(&#8216;1.25&#8242;))</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tom</title>
		<link>http://www.flexer.info/2008/01/11/cast-to-int-issue/comment-page-1/#comment-1741</link>
		<dc:creator>Tom</dc:creator>
		<pubDate>Wed, 11 Nov 2009 16:47:42 +0000</pubDate>
		<guid isPermaLink="false">http://www.flexer.info/2008/01/11/cast-to-int-issue/#comment-1741</guid>
		<description>The difference in how the cast, int() and the &#039;as&#039; operator work. &#039;as&#039; assumes that the value is an instance of what it is being cast to, ie, that 57.83 is at least an int. If it isn&#039;t an int, or a descendant of int, it will return null. In this case, 57.83 is a Number, which isn&#039;t an int or a descendant of int, so &#039;57.83 as int&#039; returns null because 57.83 isn&#039;t an int.

On the other hand, the call to int() will explicitly try to convert the value to an int.

There&#039;s a good discussion of the differences here:

http://stackoverflow.com/questions/996478/actionscript-is-there-ever-a-good-reason-to-use-as-casting</description>
		<content:encoded><![CDATA[<p>The difference in how the cast, int() and the &#8216;as&#8217; operator work. &#8216;as&#8217; assumes that the value is an instance of what it is being cast to, ie, that 57.83 is at least an int. If it isn&#8217;t an int, or a descendant of int, it will return null. In this case, 57.83 is a Number, which isn&#8217;t an int or a descendant of int, so &#8216;57.83 as int&#8217; returns null because 57.83 isn&#8217;t an int.</p>
<p>On the other hand, the call to int() will explicitly try to convert the value to an int.</p>
<p>There&#8217;s a good discussion of the differences here:</p>
<p><a href="http://stackoverflow.com/questions/996478/actionscript-is-there-ever-a-good-reason-to-use-as-casting" rel="nofollow">http://stackoverflow.com/questions/996478/actionscript-is-there-ever-a-good-reason-to-use-as-casting</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Cyianite</title>
		<link>http://www.flexer.info/2008/01/11/cast-to-int-issue/comment-page-1/#comment-1651</link>
		<dc:creator>Cyianite</dc:creator>
		<pubDate>Tue, 07 Jul 2009 17:56:58 +0000</pubDate>
		<guid isPermaLink="false">http://www.flexer.info/2008/01/11/cast-to-int-issue/#comment-1651</guid>
		<description>Any solution with this issue?</description>
		<content:encoded><![CDATA[<p>Any solution with this issue?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: cyianite</title>
		<link>http://www.flexer.info/2008/01/11/cast-to-int-issue/comment-page-1/#comment-1646</link>
		<dc:creator>cyianite</dc:creator>
		<pubDate>Fri, 03 Jul 2009 11:11:20 +0000</pubDate>
		<guid isPermaLink="false">http://www.flexer.info/2008/01/11/cast-to-int-issue/#comment-1646</guid>
		<description>Its the same issue when you converting long-int , like 100000000000000 it will give you different after conversion</description>
		<content:encoded><![CDATA[<p>Its the same issue when you converting long-int , like 100000000000000 it will give you different after conversion</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Glen</title>
		<link>http://www.flexer.info/2008/01/11/cast-to-int-issue/comment-page-1/#comment-219</link>
		<dc:creator>Glen</dc:creator>
		<pubDate>Mon, 19 May 2008 19:14:07 +0000</pubDate>
		<guid isPermaLink="false">http://www.flexer.info/2008/01/11/cast-to-int-issue/#comment-219</guid>
		<description>I had a similar problem with XML data loaded in and numbers vs strings:

var splashString:String = xml.year.value as String;


Is null / empty.
 is okay because it contains non-integer characters.

Fix:
var splashString:String = xml.year.value.toString(); //grr</description>
		<content:encoded><![CDATA[<p>I had a similar problem with XML data loaded in and numbers vs strings:</p>
<p>var splashString:String = xml.year.value as String;</p>
<p>Is null / empty.<br />
 is okay because it contains non-integer characters.</p>
<p>Fix:<br />
var splashString:String = xml.year.value.toString(); //grr</p>
]]></content:encoded>
	</item>
</channel>
</rss>

