<?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: SQLite data types</title>
	<atom:link href="http://samhassan.co.uk/2009/11/30/sqlite-data-types/feed/" rel="self" type="application/rss+xml" />
	<link>http://samhassan.co.uk/2009/11/30/sqlite-data-types/</link>
	<description>A blog about Web, Dev, Design, Fun and Food</description>
	<lastBuildDate>Tue, 28 Jun 2011 12:25:36 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: Sam</title>
		<link>http://samhassan.co.uk/2009/11/30/sqlite-data-types/comment-page-1/#comment-533</link>
		<dc:creator>Sam</dc:creator>
		<pubDate>Tue, 28 Jun 2011 12:25:36 +0000</pubDate>
		<guid isPermaLink="false">http://samhassan.co.uk/blog/?p=211#comment-533</guid>
		<description>Hi Laurence,

The Sprite class has properties: soundTransform and transform which are of the type  flash.media.SoundTransform and flash.geom.Transform.
This goes some way to explaining the type errors you&#039;re getting.
As a guess it may not be interpreting the object as a sprite correctly, try tracing whats inside the object that&#039;s returned and see wat you get. If you&#039;re not already make sure you specify the type it should be ie: var newItem : MyCustomClass = MyCustomClass(returnedObj)    where the returnedObj is whats coming back from the database.
** Have you you seen my post about using registerClassAlias: http://samhassan.co.uk/2010/01/20/storing-an-actionscript-object-class-in-sqlite-with-air/ 

One possibility is that registerClassAlias doesn&#039;t work with Sprite or other complex classes, you could try using the itemClass property of  SQLStatement class, it&#039;s probably a better way or storing custom data types in SQLite but I havent tried it myself.
Have a look at the documentation here: http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/data/SQLStatement.html#itemClass 

Hope that helps.
Sam.</description>
		<content:encoded><![CDATA[<p>Hi Laurence,</p>
<p>The Sprite class has properties: soundTransform and transform which are of the type  flash.media.SoundTransform and flash.geom.Transform.<br />
This goes some way to explaining the type errors you&#8217;re getting.<br />
As a guess it may not be interpreting the object as a sprite correctly, try tracing whats inside the object that&#8217;s returned and see wat you get. If you&#8217;re not already make sure you specify the type it should be ie: var newItem : MyCustomClass = MyCustomClass(returnedObj)    where the returnedObj is whats coming back from the database.<br />
** Have you you seen my post about using registerClassAlias: <a href="http://samhassan.co.uk/2010/01/20/storing-an-actionscript-object-class-in-sqlite-with-air/" rel="nofollow">http://samhassan.co.uk/2010/01/20/storing-an-actionscript-object-class-in-sqlite-with-air/</a> </p>
<p>One possibility is that registerClassAlias doesn&#8217;t work with Sprite or other complex classes, you could try using the itemClass property of  SQLStatement class, it&#8217;s probably a better way or storing custom data types in SQLite but I havent tried it myself.<br />
Have a look at the documentation here: <a href="http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/data/SQLStatement.html#itemClass" rel="nofollow">http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/data/SQLStatement.html#itemClass</a> </p>
<p>Hope that helps.<br />
Sam.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Laurence Howells</title>
		<link>http://samhassan.co.uk/2009/11/30/sqlite-data-types/comment-page-1/#comment-532</link>
		<dc:creator>Laurence Howells</dc:creator>
		<pubDate>Mon, 27 Jun 2011 20:55:51 +0000</pubDate>
		<guid isPermaLink="false">http://samhassan.co.uk/blog/?p=211#comment-532</guid>
		<description>Hi!  Thanks very much for this post, which helped me a lot.  But I am still stuck with this.  The custom class I have been using extends Sprite rather than Object and when I use the above solution I get the following error messages:


TypeError: Error #1034: Type Coercion failed: cannot convert Object@14911cb9 to flash.media.SoundTransform.
TypeError: Error #1034: Type Coercion failed: cannot convert Object@14911221 to flash.geom.Transform.

I seem to get two of these for every row in the database (quite why it refers to soundTransform and Transform, I don&#039;t know since I am not using either of these).

I tried simply turning your Custom Class DataVO into extends Sprite to see what would happen (you have to make one more change because the name property then clashes).  When you run it you get exactly the same error messages as above.  I am guessing therefore that the register alias thing doesn&#039;t work for Sprite????  

I am scratching my head over this and wondered if you had any advice?</description>
		<content:encoded><![CDATA[<p>Hi!  Thanks very much for this post, which helped me a lot.  But I am still stuck with this.  The custom class I have been using extends Sprite rather than Object and when I use the above solution I get the following error messages:</p>
<p>TypeError: Error #1034: Type Coercion failed: cannot convert Object@14911cb9 to flash.media.SoundTransform.<br />
TypeError: Error #1034: Type Coercion failed: cannot convert Object@14911221 to flash.geom.Transform.</p>
<p>I seem to get two of these for every row in the database (quite why it refers to soundTransform and Transform, I don&#8217;t know since I am not using either of these).</p>
<p>I tried simply turning your Custom Class DataVO into extends Sprite to see what would happen (you have to make one more change because the name property then clashes).  When you run it you get exactly the same error messages as above.  I am guessing therefore that the register alias thing doesn&#8217;t work for Sprite????  </p>
<p>I am scratching my head over this and wondered if you had any advice?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sam Hassan</title>
		<link>http://samhassan.co.uk/2009/11/30/sqlite-data-types/comment-page-1/#comment-211</link>
		<dc:creator>Sam Hassan</dc:creator>
		<pubDate>Wed, 20 Jan 2010 18:19:40 +0000</pubDate>
		<guid isPermaLink="false">http://samhassan.co.uk/blog/?p=211#comment-211</guid>
		<description>I&#039;ve posted an example of storing ActionScrip Objects in SQLite: http://samhassan.co.uk/blog/2010/01/20/storing-an-actionscript-object-class-in-sqlite-with-air/ 
sam.</description>
		<content:encoded><![CDATA[<p>I&#8217;ve posted an example of storing ActionScrip Objects in SQLite: <a href="http://samhassan.co.uk/blog/2010/01/20/storing-an-actionscript-object-class-in-sqlite-with-air/" rel="nofollow">http://samhassan.co.uk/blog/2010/01/20/storing-an-actionscript-object-class-in-sqlite-with-air/</a><br />
sam.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Storing an ActionScript Object class in SQLite with AIR &#124; This'N'That</title>
		<link>http://samhassan.co.uk/2009/11/30/sqlite-data-types/comment-page-1/#comment-210</link>
		<dc:creator>Storing an ActionScript Object class in SQLite with AIR &#124; This'N'That</dc:creator>
		<pubDate>Wed, 20 Jan 2010 18:17:16 +0000</pubDate>
		<guid isPermaLink="false">http://samhassan.co.uk/blog/?p=211#comment-210</guid>
		<description>[...] CV         &#171; SQLite data types [...]</description>
		<content:encoded><![CDATA[<p>[...] CV         &laquo; SQLite data types [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sam Hassan</title>
		<link>http://samhassan.co.uk/2009/11/30/sqlite-data-types/comment-page-1/#comment-208</link>
		<dc:creator>Sam Hassan</dc:creator>
		<pubDate>Sun, 10 Jan 2010 16:42:53 +0000</pubDate>
		<guid isPermaLink="false">http://samhassan.co.uk/blog/?p=211#comment-208</guid>
		<description>No I haven’t had a chance to store a custom object but I am using Date objects in a current project which is saving a lot of time</description>
		<content:encoded><![CDATA[<p>No I haven’t had a chance to store a custom object but I am using Date objects in a current project which is saving a lot of time</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sankalp Kallakuri</title>
		<link>http://samhassan.co.uk/2009/11/30/sqlite-data-types/comment-page-1/#comment-207</link>
		<dc:creator>Sankalp Kallakuri</dc:creator>
		<pubDate>Thu, 07 Jan 2010 03:11:40 +0000</pubDate>
		<guid isPermaLink="false">http://samhassan.co.uk/blog/?p=211#comment-207</guid>
		<description>Hi,

Were you able to perform any experiments on storing actionscript objects in SQLite tables and retrieving them? If yes were you successful?</description>
		<content:encoded><![CDATA[<p>Hi,</p>
<p>Were you able to perform any experiments on storing actionscript objects in SQLite tables and retrieving them? If yes were you successful?</p>
]]></content:encoded>
	</item>
</channel>
</rss>

