<?xml version="1.0" encoding="UTF-8"?><!-- generator="wordpress/2.3.1" -->
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	>
<channel>
	<title>Comments on: AS3 Tips, Tricks and Experiments</title>
	<link>http://www.learningactionscript3.com/2009/06/30/as3-tips-tricks-and-experiments/</link>
	<description>A digital supplement for the O'Reilly book</description>
	<pubDate>Sat, 04 Feb 2012 06:17:11 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.3.1</generator>
		<item>
		<title>By: Rich</title>
		<link>http://www.learningactionscript3.com/2009/06/30/as3-tips-tricks-and-experiments/#comment-18913</link>
		<dc:creator>Rich</dc:creator>
		<pubDate>Tue, 19 Jul 2011 14:00:52 +0000</pubDate>
		<guid>http://www.learningactionscript3.com/2009/06/30/as3-tips-tricks-and-experiments/#comment-18913</guid>
		<description>@Alessandro: Sorry, FileReference only saves locally. You'll need a server script to save to the server, such as PHP. That's included in the book, too. Note: I think the first edition uses PHP4, while the second edition uses PHP5.</description>
		<content:encoded><![CDATA[<p>@Alessandro: Sorry, FileReference only saves locally. You&#8217;ll need a server script to save to the server, such as PHP. That&#8217;s included in the book, too. Note: I think the first edition uses PHP4, while the second edition uses PHP5.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Alessandro</title>
		<link>http://www.learningactionscript3.com/2009/06/30/as3-tips-tricks-and-experiments/#comment-18433</link>
		<dc:creator>Alessandro</dc:creator>
		<pubDate>Fri, 08 Jul 2011 12:53:04 +0000</pubDate>
		<guid>http://www.learningactionscript3.com/2009/06/30/as3-tips-tricks-and-experiments/#comment-18433</guid>
		<description>Hello everyone,
I try to used FileReference to save an img from my swf in a specific directory on the server and not on the Pc users.
someone can help me?
Thank you</description>
		<content:encoded><![CDATA[<p>Hello everyone,<br />
I try to used FileReference to save an img from my swf in a specific directory on the server and not on the Pc users.<br />
someone can help me?<br />
Thank you</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: lucien</title>
		<link>http://www.learningactionscript3.com/2009/06/30/as3-tips-tricks-and-experiments/#comment-10087</link>
		<dc:creator>lucien</dc:creator>
		<pubDate>Sat, 04 Dec 2010 21:12:17 +0000</pubDate>
		<guid>http://www.learningactionscript3.com/2009/06/30/as3-tips-tricks-and-experiments/#comment-10087</guid>
		<description>thanks for this greate tutorials but can we save Data silently because i m building a game and i dont wont tha users save thier data ;)</description>
		<content:encoded><![CDATA[<p>thanks for this greate tutorials but can we save Data silently because i m building a game and i dont wont tha users save thier data <img src='http://www.learningactionscript3.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: jason mcdonald</title>
		<link>http://www.learningactionscript3.com/2009/06/30/as3-tips-tricks-and-experiments/#comment-8459</link>
		<dc:creator>jason mcdonald</dc:creator>
		<pubDate>Sat, 18 Sep 2010 23:24:17 +0000</pubDate>
		<guid>http://www.learningactionscript3.com/2009/06/30/as3-tips-tricks-and-experiments/#comment-8459</guid>
		<description>thanks so much for the help :)</description>
		<content:encoded><![CDATA[<p>thanks so much for the help <img src='http://www.learningactionscript3.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Rich</title>
		<link>http://www.learningactionscript3.com/2009/06/30/as3-tips-tricks-and-experiments/#comment-8286</link>
		<dc:creator>Rich</dc:creator>
		<pubDate>Mon, 06 Sep 2010 18:54:32 +0000</pubDate>
		<guid>http://www.learningactionscript3.com/2009/06/30/as3-tips-tricks-and-experiments/#comment-8286</guid>
		<description>@Ricky, it's not possible to save a Sprite, but it is possible to save a Bitmap. You can use the BitmapData class to create a Bitmap from the drawing.</description>
		<content:encoded><![CDATA[<p>@Ricky, it&#8217;s not possible to save a Sprite, but it is possible to save a Bitmap. You can use the BitmapData class to create a Bitmap from the drawing.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ricky</title>
		<link>http://www.learningactionscript3.com/2009/06/30/as3-tips-tricks-and-experiments/#comment-8084</link>
		<dc:creator>Ricky</dc:creator>
		<pubDate>Tue, 17 Aug 2010 04:03:32 +0000</pubDate>
		<guid>http://www.learningactionscript3.com/2009/06/30/as3-tips-tricks-and-experiments/#comment-8084</guid>
		<description>Is it possible to save a flash sprite object into a file? My program allow user to addChild on a sprite, and I would like to add a function to save user's drawing. Is it possible?</description>
		<content:encoded><![CDATA[<p>Is it possible to save a flash sprite object into a file? My program allow user to addChild on a sprite, and I would like to add a function to save user&#8217;s drawing. Is it possible?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Rich</title>
		<link>http://www.learningactionscript3.com/2009/06/30/as3-tips-tricks-and-experiments/#comment-7515</link>
		<dc:creator>Rich</dc:creator>
		<pubDate>Mon, 05 Jul 2010 14:34:10 +0000</pubDate>
		<guid>http://www.learningactionscript3.com/2009/06/30/as3-tips-tricks-and-experiments/#comment-7515</guid>
		<description>@Arul, it's not possible to save the text file using FileReference without the dialog box.</description>
		<content:encoded><![CDATA[<p>@Arul, it&#8217;s not possible to save the text file using FileReference without the dialog box.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Arul</title>
		<link>http://www.learningactionscript3.com/2009/06/30/as3-tips-tricks-and-experiments/#comment-7512</link>
		<dc:creator>Arul</dc:creator>
		<pubDate>Mon, 05 Jul 2010 12:01:36 +0000</pubDate>
		<guid>http://www.learningactionscript3.com/2009/06/30/as3-tips-tricks-and-experiments/#comment-7512</guid>
		<description>How to save the text File without Dailog box?</description>
		<content:encoded><![CDATA[<p>How to save the text File without Dailog box?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Zevan</title>
		<link>http://www.learningactionscript3.com/2009/06/30/as3-tips-tricks-and-experiments/#comment-4378</link>
		<dc:creator>Zevan</dc:creator>
		<pubDate>Thu, 22 Oct 2009 17:37:46 +0000</pubDate>
		<guid>http://www.learningactionscript3.com/2009/06/30/as3-tips-tricks-and-experiments/#comment-4378</guid>
		<description>@Marcos This feature is flash player 10 only... that message makes me think you may be using CS3 or publishing to flash player 9</description>
		<content:encoded><![CDATA[<p>@Marcos This feature is flash player 10 only&#8230; that message makes me think you may be using CS3 or publishing to flash player 9</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Zevan</title>
		<link>http://www.learningactionscript3.com/2009/06/30/as3-tips-tricks-and-experiments/#comment-4339</link>
		<dc:creator>Zevan</dc:creator>
		<pubDate>Tue, 20 Oct 2009 20:13:22 +0000</pubDate>
		<guid>http://www.learningactionscript3.com/2009/06/30/as3-tips-tricks-and-experiments/#comment-4339</guid>
		<description>Hey Frank... your right... load() and browse() are the way to go.... have a look at this snippet:

&lt;pre&gt;
var file:FileReference = new FileReference();
file.addEventListener(Event.COMPLETE, onSaved);
stage.addEventListener(MouseEvent.CLICK, onSave);
function onSave(evt:MouseEvent):void {
	file.save("some text.\nsome more text", "actionsnippet.txt");
}

// user has saved the file... clicking again will bring up the browse window
function onSaved(evt:Event):void{
   file.removeEventListener(Event.COMPLETE, onSaved);
   stage.removeEventListener(MouseEvent.CLICK, onSave);
   stage.addEventListener(MouseEvent.CLICK, onBrowse);
}
 
// bring up the browse window in reponse to a mouse click
function onBrowse(evt:MouseEvent):void{
	file.browse([ new FileFilter("Text Files", "*.txt")]);
	file.addEventListener(Event.SELECT, onSelected);
}

// user has selected a file to upload from the localhost
function onSelected(evt:Event):void{
	stage.removeEventListener(MouseEvent.CLICK, onBrowse);
	file.removeEventListener(Event.SELECT, onSelected);
	file.load();
	file.addEventListener(Event.COMPLETE, onContentLoaded);
}

// the local file has been loaded, trace out the data and remove the last listener
function onContentLoaded(evt:Event):void{
	var txtContent:String  = String(evt.target.data);
	trace(txtContent);
	file.removeEventListener(Event.COMPLETE, onContentLoaded);
}
&lt;/pre&gt;</description>
		<content:encoded><![CDATA[<p>Hey Frank&#8230; your right&#8230; load() and browse() are the way to go&#8230;. have a look at this snippet:</p>
<pre>
var file:FileReference = new FileReference();
file.addEventListener(Event.COMPLETE, onSaved);
stage.addEventListener(MouseEvent.CLICK, onSave);
function onSave(evt:MouseEvent):void {
	file.save("some text.\nsome more text", "actionsnippet.txt");
}

// user has saved the file... clicking again will bring up the browse window
function onSaved(evt:Event):void{
   file.removeEventListener(Event.COMPLETE, onSaved);
   stage.removeEventListener(MouseEvent.CLICK, onSave);
   stage.addEventListener(MouseEvent.CLICK, onBrowse);
}

// bring up the browse window in reponse to a mouse click
function onBrowse(evt:MouseEvent):void{
	file.browse([ new FileFilter("Text Files", "*.txt")]);
	file.addEventListener(Event.SELECT, onSelected);
}

// user has selected a file to upload from the localhost
function onSelected(evt:Event):void{
	stage.removeEventListener(MouseEvent.CLICK, onBrowse);
	file.removeEventListener(Event.SELECT, onSelected);
	file.load();
	file.addEventListener(Event.COMPLETE, onContentLoaded);
}

// the local file has been loaded, trace out the data and remove the last listener
function onContentLoaded(evt:Event):void{
	var txtContent:String  = String(evt.target.data);
	trace(txtContent);
	file.removeEventListener(Event.COMPLETE, onContentLoaded);
}
</pre>
]]></content:encoded>
	</item>
</channel>
</rss>

